From a64124c88245ed3f54be9e78940fc6433749654c Mon Sep 17 00:00:00 2001 From: Kurt Wolf Date: Sat, 11 Jan 2025 01:54:31 -0500 Subject: [PATCH] update --- examples/accounts_balance_get.rs | 11 +- examples/accounts_get.rs | 4 +- examples/application_get.rs | 4 +- examples/asset_report_audit_copy_create.rs | 4 +- examples/asset_report_audit_copy_get.rs | 4 +- examples/asset_report_audit_copy_remove.rs | 4 +- examples/asset_report_create.rs | 7 +- examples/asset_report_filter.rs | 4 +- examples/asset_report_get.rs | 4 +- examples/asset_report_pdf_get.rs | 4 +- examples/asset_report_refresh.rs | 4 +- examples/asset_report_remove.rs | 4 +- examples/auth_get.rs | 4 +- examples/bank_transfer_balance_get.rs | 4 +- examples/bank_transfer_cancel.rs | 4 +- examples/bank_transfer_create.rs | 46 +- examples/bank_transfer_event_list.rs | 6 +- examples/bank_transfer_event_sync.rs | 4 +- examples/bank_transfer_get.rs | 4 +- examples/bank_transfer_list.rs | 4 +- examples/bank_transfer_migrate_account.rs | 4 +- examples/bank_transfer_sweep_get.rs | 4 +- examples/bank_transfer_sweep_list.rs | 4 +- examples/beacon_account_risk_evaluate.rs | 24 + examples/beacon_duplicate_get.rs | 4 +- examples/beacon_report_create.rs | 8 +- examples/beacon_report_get.rs | 4 +- examples/beacon_report_list.rs | 4 +- examples/beacon_report_syndication_get.rs | 4 +- examples/beacon_report_syndication_list.rs | 4 +- examples/beacon_user_account_insights_get.rs | 14 + examples/beacon_user_create.rs | 20 +- examples/beacon_user_get.rs | 4 +- examples/beacon_user_history_list.rs | 14 + examples/beacon_user_review.rs | 6 +- examples/beacon_user_update.rs | 61 +- examples/categories_get.rs | 7 +- examples/consent_events_get.rs | 10 + examples/consumer_report_pdf_get.rs | 10 + examples/cra_bank_income_create.rs | 18 + examples/cra_bank_income_get.rs | 4 +- examples/cra_base_report_create.rs | 20 + examples/cra_base_report_get.rs | 10 + examples/cra_check_report_base_report_get.rs | 15 + examples/cra_check_report_create.rs | 23 + .../cra_check_report_income_insights_get.rs | 14 + .../cra_check_report_network_insights_get.rs | 14 + .../cra_check_report_partner_insights_get.rs | 22 + examples/cra_check_report_pdf_get.rs | 15 + examples/cra_loans_applications_register.rs | 16 + examples/cra_loans_register.rs | 19 + examples/cra_loans_unregister.rs | 14 + examples/cra_loans_update.rs | 16 + examples/cra_monitoring_insights_get.rs | 14 + examples/cra_monitoring_insights_subscribe.rs | 14 + .../cra_monitoring_insights_unsubscribe.rs | 13 + examples/cra_partner_insights_get.rs | 10 + examples/create_payment_token.rs | 4 +- .../credit_asset_report_freddie_mac_get.rs | 4 +- examples/credit_audit_copy_token_create.rs | 4 +- examples/credit_audit_copy_token_update.rs | 4 +- examples/credit_bank_employment_get.rs | 4 +- examples/credit_bank_income_get.rs | 4 +- examples/credit_bank_income_pdf_get.rs | 4 +- examples/credit_bank_income_refresh.rs | 4 +- examples/credit_bank_income_webhook_update.rs | 4 +- .../credit_bank_statements_uploads_get.rs | 12 +- examples/credit_employment_get.rs | 4 +- examples/credit_freddie_mac_reports_get.rs | 4 +- examples/credit_payroll_income_get.rs | 7 +- ...it_payroll_income_parsing_config_update.rs | 6 +- examples/credit_payroll_income_precheck.rs | 4 +- examples/credit_payroll_income_refresh.rs | 4 +- .../credit_payroll_income_risk_signals_get.rs | 4 +- examples/credit_relay_create.rs | 4 +- examples/credit_relay_get.rs | 12 +- examples/credit_relay_pdf_get.rs | 6 +- examples/credit_relay_refresh.rs | 6 +- examples/credit_relay_remove.rs | 4 +- examples/credit_report_audit_copy_remove.rs | 4 +- examples/credit_sessions_get.rs | 4 +- examples/dashboard_user_get.rs | 4 +- examples/dashboard_user_list.rs | 4 +- examples/deposit_switch_alt_create.rs | 4 +- examples/deposit_switch_create.rs | 4 +- examples/deposit_switch_get.rs | 4 +- examples/deposit_switch_token_create.rs | 4 +- examples/employers_search.rs | 4 +- examples/employment_verification_get.rs | 4 +- examples/fdx_notifications.rs | 56 +- examples/get_recipient.rs | 14 + examples/get_recipients.rs | 9 + examples/identity_documents_uploads_get.rs | 18 + examples/identity_get.rs | 4 +- examples/identity_match.rs | 4 +- examples/identity_refresh.rs | 4 +- .../identity_verification_autofill_create.rs | 4 +- examples/identity_verification_create.rs | 6 +- examples/identity_verification_get.rs | 4 +- examples/identity_verification_list.rs | 4 +- examples/identity_verification_retry.rs | 9 +- examples/income_verification_create.rs | 4 +- .../income_verification_documents_download.rs | 4 +- examples/income_verification_paystubs_get.rs | 4 +- examples/income_verification_precheck.rs | 4 +- examples/income_verification_taxforms_get.rs | 4 +- examples/institutions_get.rs | 8 +- examples/institutions_get_by_id.rs | 6 +- examples/institutions_search.rs | 8 +- examples/investments_auth_get.rs | 4 +- examples/investments_holdings_get.rs | 4 +- examples/investments_refresh.rs | 4 +- examples/investments_transactions_get.rs | 4 +- examples/issues_get.rs | 10 + examples/issues_search.rs | 15 + examples/issues_subscribe.rs | 14 + examples/item_access_token_invalidate.rs | 4 +- examples/item_activity_list.rs | 4 +- examples/item_application_list.rs | 4 +- examples/item_application_scopes_update.rs | 61 +- examples/item_application_unlink.rs | 4 +- examples/item_create_public_token.rs | 4 +- examples/item_get.rs | 4 +- examples/item_import.rs | 6 +- examples/item_public_token_exchange.rs | 4 +- examples/item_remove.rs | 4 +- examples/item_webhook_update.rs | 4 +- examples/liabilities_get.rs | 4 +- examples/link_delivery_create.rs | 6 +- examples/link_delivery_get.rs | 4 +- .../link_oauth_correlation_id_exchange.rs | 4 +- examples/link_profile_eligibility_check.rs | 16 + examples/link_token_create.rs | 141 +- examples/link_token_get.rs | 4 +- examples/network_insights_report_get.rs | 10 + examples/partner_customer_create.rs | 42 +- examples/partner_customer_enable.rs | 4 +- examples/partner_customer_get.rs | 4 +- ...partner_customer_oauth_institutions_get.rs | 4 +- examples/partner_customer_remove.rs | 4 +- examples/payment_initiation_consent_create.rs | 62 +- examples/payment_initiation_consent_get.rs | 4 +- ...ment_initiation_consent_payment_execute.rs | 9 +- examples/payment_initiation_consent_revoke.rs | 4 +- examples/payment_initiation_payment_create.rs | 8 +- examples/payment_initiation_payment_get.rs | 4 +- examples/payment_initiation_payment_list.rs | 4 +- .../payment_initiation_payment_reverse.rs | 13 +- .../payment_initiation_recipient_create.rs | 4 +- examples/payment_initiation_recipient_get.rs | 4 +- examples/payment_initiation_recipient_list.rs | 7 +- examples/payment_profile_create.rs | 7 +- examples/payment_profile_get.rs | 4 +- examples/payment_profile_remove.rs | 4 +- examples/processor_account_get.rs | 4 +- .../processor_apex_processor_token_create.rs | 4 +- examples/processor_auth_get.rs | 4 +- examples/processor_balance_get.rs | 4 +- examples/processor_bank_transfer_create.rs | 43 +- examples/processor_identity_get.rs | 4 +- examples/processor_identity_match.rs | 4 +- examples/processor_liabilities_get.rs | 4 +- examples/processor_signal_decision_report.rs | 8 +- examples/processor_signal_evaluate.rs | 5 +- examples/processor_signal_prepare.rs | 4 +- examples/processor_signal_return_report.rs | 4 +- ...cessor_stripe_bank_account_token_create.rs | 4 +- examples/processor_token_create.rs | 4 +- examples/processor_token_permissions_get.rs | 4 +- examples/processor_token_permissions_set.rs | 6 +- examples/processor_token_webhook_update.rs | 4 +- examples/processor_transactions_get.rs | 4 +- .../processor_transactions_recurring_get.rs | 4 +- examples/processor_transactions_refresh.rs | 4 +- examples/processor_transactions_sync.rs | 4 +- examples/profile_get.rs | 10 + examples/profile_network_status_get.rs | 12 + examples/sandbox_bank_income_fire_webhook.rs | 8 +- .../sandbox_bank_transfer_fire_webhook.rs | 4 +- examples/sandbox_bank_transfer_simulate.rs | 4 +- examples/sandbox_income_fire_webhook.rs | 6 +- examples/sandbox_item_fire_webhook.rs | 6 +- examples/sandbox_item_reset_login.rs | 4 +- .../sandbox_item_set_verification_status.rs | 4 +- examples/sandbox_oauth_select_accounts.rs | 4 +- .../sandbox_payment_profile_reset_login.rs | 4 +- examples/sandbox_processor_token_create.rs | 4 +- examples/sandbox_public_token_create.rs | 12 +- examples/sandbox_transfer_fire_webhook.rs | 4 +- ...andbox_transfer_ledger_deposit_simulate.rs | 6 +- ...dbox_transfer_ledger_simulate_available.rs | 6 +- ...ndbox_transfer_ledger_withdraw_simulate.rs | 6 +- examples/sandbox_transfer_refund_simulate.rs | 5 +- .../sandbox_transfer_repayment_simulate.rs | 7 +- examples/sandbox_transfer_simulate.rs | 5 +- examples/sandbox_transfer_sweep_simulate.rs | 5 +- .../sandbox_transfer_test_clock_advance.rs | 4 +- .../sandbox_transfer_test_clock_create.rs | 4 +- examples/sandbox_transfer_test_clock_get.rs | 4 +- examples/sandbox_transfer_test_clock_list.rs | 4 +- examples/sandbox_user_reset_login.rs | 14 + examples/signal_decision_report.rs | 8 +- examples/signal_evaluate.rs | 22 +- examples/signal_prepare.rs | 4 +- examples/signal_return_report.rs | 4 +- examples/statements_download.rs | 4 +- examples/statements_list.rs | 4 +- examples/statements_refresh.rs | 4 +- examples/transactions_enhance.rs | 4 +- examples/transactions_enrich.rs | 8 +- examples/transactions_get.rs | 4 +- examples/transactions_recurring_get.rs | 8 +- examples/transactions_refresh.rs | 4 +- examples/transactions_rules_create.rs | 8 +- examples/transactions_rules_list.rs | 4 +- examples/transactions_rules_remove.rs | 4 +- examples/transactions_sync.rs | 4 +- examples/transactions_user_insights_get.rs | 4 +- examples/transfer_authorization_cancel.rs | 10 + examples/transfer_authorization_create.rs | 53 +- examples/transfer_balance_get.rs | 6 +- examples/transfer_cancel.rs | 4 +- examples/transfer_capabilities_get.rs | 4 +- examples/transfer_configuration_get.rs | 4 +- examples/transfer_create.rs | 29 +- .../transfer_diligence_document_upload.rs | 6 +- examples/transfer_diligence_submit.rs | 12 +- examples/transfer_event_list.rs | 6 +- examples/transfer_event_sync.rs | 4 +- examples/transfer_get.rs | 9 +- examples/transfer_intent_create.rs | 47 +- examples/transfer_intent_get.rs | 4 +- examples/transfer_ledger_deposit.rs | 7 +- examples/transfer_ledger_distribute.rs | 21 +- examples/transfer_ledger_get.rs | 5 +- examples/transfer_ledger_withdraw.rs | 7 +- examples/transfer_list.rs | 4 +- examples/transfer_metrics_get.rs | 4 +- examples/transfer_migrate_account.rs | 4 +- examples/transfer_originator_create.rs | 4 +- ...nsfer_originator_funding_account_update.rs | 4 +- examples/transfer_originator_get.rs | 4 +- examples/transfer_originator_list.rs | 4 +- .../transfer_platform_originator_create.rs | 23 + examples/transfer_platform_person_create.rs | 33 + .../transfer_platform_requirement_submit.rs | 21 + examples/transfer_questionnaire_create.rs | 4 +- examples/transfer_recurring_cancel.rs | 4 +- examples/transfer_recurring_create.rs | 70 +- examples/transfer_recurring_get.rs | 4 +- examples/transfer_recurring_list.rs | 4 +- examples/transfer_refund_cancel.rs | 4 +- examples/transfer_refund_create.rs | 4 +- examples/transfer_refund_get.rs | 4 +- examples/transfer_repayment_list.rs | 4 +- examples/transfer_repayment_return_list.rs | 4 +- examples/transfer_sweep_get.rs | 4 +- examples/transfer_sweep_list.rs | 6 +- examples/user_account_session_get.rs | 10 + examples/user_create.rs | 7 +- .../{base_report_get.rs => user_items_get.rs} | 6 +- examples/user_remove.rs | 10 + examples/user_third_party_token_create.rs | 15 + examples/user_third_party_token_remove.rs | 13 + examples/user_update.rs | 6 +- examples/wallet_create.rs | 6 +- examples/wallet_get.rs | 4 +- examples/wallet_list.rs | 6 +- examples/wallet_transaction_execute.rs | 63 +- examples/wallet_transaction_get.rs | 4 +- examples/wallet_transaction_list.rs | 4 +- examples/watchlist_screening_entity_create.rs | 4 +- examples/watchlist_screening_entity_get.rs | 4 +- ...watchlist_screening_entity_history_list.rs | 4 +- .../watchlist_screening_entity_hit_list.rs | 4 +- examples/watchlist_screening_entity_list.rs | 6 +- .../watchlist_screening_entity_program_get.rs | 4 +- ...watchlist_screening_entity_program_list.rs | 4 +- ...atchlist_screening_entity_review_create.rs | 4 +- .../watchlist_screening_entity_review_list.rs | 4 +- examples/watchlist_screening_entity_update.rs | 12 +- .../watchlist_screening_individual_create.rs | 4 +- .../watchlist_screening_individual_get.rs | 4 +- ...hlist_screening_individual_history_list.rs | 4 +- ...watchlist_screening_individual_hit_list.rs | 4 +- .../watchlist_screening_individual_list.rs | 6 +- ...chlist_screening_individual_program_get.rs | 4 +- ...hlist_screening_individual_program_list.rs | 4 +- ...list_screening_individual_review_create.rs | 4 +- ...chlist_screening_individual_review_list.rs | 4 +- .../watchlist_screening_individual_update.rs | 12 +- examples/webhook_verification_key_get.rs | 4 +- src/lib.rs | 4988 +---------------- src/model/account_access.rs | 2 +- src/model/account_assets.rs | 91 +- src/model/account_balance.rs | 4 +- src/model/account_base.rs | 29 +- src/model/account_filters_response.rs | 2 +- src/model/account_holder_category.rs | 11 + src/model/account_identity.rs | 9 +- src/model/account_identity_document_upload.rs | 31 + src/model/account_identity_match_score.rs | 4 +- src/model/account_ids_with_updated_auth.rs | 3 + .../account_ids_with_updated_identity.rs | 12 +- src/model/account_product_access.rs | 2 +- src/model/account_subtype.rs | 146 +- src/model/account_type.rs | 27 + src/model/account_verification_insights.rs | 27 + ...fication_insights_account_number_format.rs | 17 + ...nt_verification_insights_network_status.rs | 14 + ..._verification_insights_previous_returns.rs | 12 + .../accounts_balance_get_request_options.rs | 8 +- ...nts_balance_get_request_payment_details.rs | 22 +- ...ce_get_response_payment_risk_assessment.rs | 42 +- src/model/accounts_get_request_options.rs | 2 +- src/model/accounts_get_response.rs | 6 +- src/model/ach_class.rs | 24 + src/model/action_state.rs | 15 + src/model/activity.rs | 13 +- src/model/activity_type.rs | 25 + src/model/address.rs | 2 +- src/model/address_data.rs | 2 +- src/model/address_data_not_required.rs | 2 +- src/model/address_match_score.rs | 2 +- src/model/address_purpose_label.rs | 13 + src/model/application.rs | 2 +- src/model/application_get_response.rs | 2 +- src/model/apr.rs | 2 +- src/model/asset.rs | 4 +- src/model/asset_detail.rs | 7 +- src/model/asset_holder.rs | 2 +- src/model/asset_holder_name.rs | 2 +- src/model/asset_owner.rs | 2 +- src/model/asset_owners.rs | 2 +- src/model/asset_report.rs | 2 +- src/model/asset_report_account_balance.rs | 65 + src/model/asset_report_add_ons.rs | 13 + ...asset_report_audit_copy_create_response.rs | 2 +- ...asset_report_audit_copy_remove_response.rs | 2 +- .../asset_report_create_request_options.rs | 11 +- src/model/asset_report_create_response.rs | 2 +- src/model/asset_report_filter_response.rs | 2 +- src/model/asset_report_freddie.rs | 4 +- .../asset_report_freddie_get_response.rs | 4 +- src/model/asset_report_get_request_options.rs | 2 +- src/model/asset_report_get_response.rs | 2 +- src/model/asset_report_investments.rs | 13 +- src/model/asset_report_item.rs | 2 +- .../asset_report_pdf_get_request_options.rs | 2 +- .../asset_report_refresh_request_options.rs | 2 +- src/model/asset_report_refresh_response.rs | 2 +- src/model/asset_report_remove_response.rs | 2 +- src/model/asset_report_transaction.rs | 8 +- src/model/asset_report_transaction_type.rs | 19 + src/model/asset_report_type.rs | 9 + src/model/asset_report_user.rs | 2 +- src/model/asset_transaction.rs | 4 +- src/model/asset_transaction_category_type.rs | 119 + src/model/asset_transaction_description.rs | 2 +- src/model/asset_transaction_detail.rs | 9 +- src/model/asset_transaction_type.rs | 7 + src/model/asset_transactions.rs | 2 +- src/model/asset_type.rs | 10 + src/model/assets.rs | 2 +- src/model/assets_error_webhook.rs | 10 +- src/model/assets_product_ready_webhook.rs | 11 +- src/model/auth_default_update_webhook.rs | 29 + src/model/auth_get_numbers.rs | 2 +- src/model/auth_get_request_options.rs | 2 +- src/model/auth_get_response.rs | 4 +- src/model/auth_metadata.rs | 2 +- src/model/auth_supported_methods.rs | 2 +- src/model/auth_update_types.rs | 9 + src/model/automatically_verified_webhook.rs | 10 +- src/model/balance_plus_attributes.rs | 113 + src/model/balance_plus_risk_level.rs | 27 + src/model/bank_income_complete_result.rs | 13 + src/model/bank_income_complete_webhook.rs | 9 +- .../bank_income_refresh_complete_result.rs | 13 + .../bank_income_refresh_complete_webhook.rs | 9 +- .../bank_income_refresh_update_webhook.rs | 7 +- src/model/bank_initiated_return_risk.rs | 2 +- src/model/bank_transfer.rs | 20 +- src/model/bank_transfer_balance.rs | 2 +- .../bank_transfer_balance_get_response.rs | 2 +- src/model/bank_transfer_cancel_response.rs | 2 +- src/model/bank_transfer_create_response.rs | 4 +- src/model/bank_transfer_direction.rs | 2 +- src/model/bank_transfer_event.rs | 12 +- ..._transfer_event_list_bank_transfer_type.rs | 2 +- .../bank_transfer_event_list_direction.rs | 2 +- .../bank_transfer_event_list_response.rs | 2 +- .../bank_transfer_event_sync_response.rs | 2 +- src/model/bank_transfer_event_type.rs | 25 + src/model/bank_transfer_failure.rs | 2 +- src/model/bank_transfer_get_response.rs | 4 +- src/model/bank_transfer_list_response.rs | 2 +- src/model/bank_transfer_metadata.rs | 14 +- .../bank_transfer_migrate_account_response.rs | 2 +- src/model/bank_transfer_network.rs | 11 + src/model/bank_transfer_status.rs | 15 + src/model/bank_transfer_sweep.rs | 2 +- src/model/bank_transfer_sweep_get_response.rs | 2 +- .../bank_transfer_sweep_list_response.rs | 2 +- src/model/bank_transfer_type.rs | 9 + src/model/bank_transfer_user.rs | 2 +- .../bank_transfers_events_update_webhook.rs | 7 +- src/model/base_report.rs | 5 +- src/model/base_report_account.rs | 31 +- src/model/base_report_account_balances.rs | 65 +- src/model/base_report_account_insights.rs | 21 +- src/model/base_report_account_metadata.rs | 16 + src/model/base_report_attributes.rs | 54 + .../base_report_average_flow_insights.rs | 13 +- .../base_report_average_monthly_balances.rs | 19 + src/model/base_report_historical_balance.rs | 24 + src/model/base_report_item.rs | 4 +- src/model/base_report_longest_gap_insights.rs | 2 +- src/model/base_report_number_flow_insights.rs | 13 +- src/model/base_report_transaction.rs | 25 +- src/model/base_report_transaction_type.rs | 19 + src/model/base_report_warning.rs | 15 +- src/model/base_report_warning_code.rs | 11 + src/model/base_reports_error_webhook.rs | 10 +- .../base_reports_product_ready_webhook.rs | 7 +- src/model/beacon_account_risk_attributes.rs | 121 + .../beacon_account_risk_evaluate_account.rs | 39 + ...ccount_risk_evaluate_account_attributes.rs | 121 + ...account_risk_evaluate_evaluation_reason.rs | 21 + ...n_account_risk_evaluate_request_options.rs | 13 + .../beacon_account_risk_evaluate_response.rs | 16 + src/model/beacon_audit_trail.rs | 11 +- src/model/beacon_audit_trail_source.rs | 22 + src/model/beacon_bank_account_insights.rs | 36 + src/model/beacon_bank_accounts.rs | 15 + .../beacon_duplicate_detected_webhook.rs | 7 +- src/model/beacon_duplicate_get_response.rs | 4 +- src/model/beacon_match_summary_analysis.rs | 19 +- src/model/beacon_match_summary_code.rs | 22 + src/model/beacon_report.rs | 15 +- src/model/beacon_report_create_response.rs | 15 +- src/model/beacon_report_create_type.rs | 27 + src/model/beacon_report_created_webhook.rs | 7 +- src/model/beacon_report_get_response.rs | 15 +- src/model/beacon_report_list_response.rs | 2 +- src/model/beacon_report_syndication.rs | 4 +- .../beacon_report_syndication_analysis.rs | 23 +- ...acon_report_syndication_created_webhook.rs | 7 +- .../beacon_report_syndication_get_response.rs | 4 +- ...beacon_report_syndication_list_response.rs | 2 +- ...acon_report_syndication_original_report.rs | 14 +- src/model/beacon_report_type.rs | 29 + src/model/beacon_report_updated_webhook.rs | 7 +- ...eport_depository_account_match_analysis.rs | 26 + src/model/beacon_user.rs | 38 + ...acon_user_account_insights_get_response.rs | 21 + src/model/beacon_user_address.rs | 8 +- src/model/beacon_user_create_response.rs | 13 +- src/model/beacon_user_data.rs | 12 +- src/model/beacon_user_depository_account.rs | 16 + src/model/beacon_user_get_response.rs | 13 +- .../beacon_user_history_list_response.rs | 18 + src/model/beacon_user_id_number.rs | 9 +- src/model/beacon_user_name.rs | 2 +- src/model/beacon_user_name_nullable.rs | 2 +- src/model/beacon_user_request_address.rs | 8 +- .../beacon_user_request_address_nullable.rs | 8 +- src/model/beacon_user_request_data.rs | 26 +- .../beacon_user_request_depository_account.rs | 14 + src/model/beacon_user_revision.rs | 2 +- src/model/beacon_user_status.rs | 17 + .../beacon_user_status_updated_webhook.rs | 7 +- src/model/beacon_user_update_request_data.rs | 11 +- src/model/beacon_user_update_response.rs | 13 +- src/model/cashflow_attributes_version.rs | 7 + src/model/categories_get_response.rs | 2 +- src/model/category.rs | 2 +- src/model/category_insight_details.rs | 2 +- src/model/category_insights.rs | 2 +- src/model/cause.rs | 9 +- .../client_provided_enhanced_transaction.rs | 4 +- .../client_provided_enriched_transaction.rs | 8 +- src/model/client_provided_raw_transaction.rs | 2 +- src/model/client_provided_transaction.rs | 8 +- .../client_provided_transaction_location.rs | 2 +- src/model/connected_application.rs | 2 +- src/model/consent_event.rs | 43 + src/model/consent_event_code.rs | 13 + src/model/consent_event_initiator.rs | 13 + src/model/consent_event_type.rs | 11 + src/model/consent_events_get_response.rs | 16 + src/model/consented_account.rs | 40 + src/model/consumer_dispute.rs | 19 + src/model/consumer_dispute_category.rs | 13 + .../consumer_report_permissible_purpose.rs | 37 + src/model/consumer_report_user_identity.rs | 15 +- src/model/counterparty.rs | 9 +- src/model/counterparty_insights.rs | 2 +- src/model/counterparty_type.rs | 24 + src/model/country_code.rs | 41 + src/model/cra_bank_income.rs | 14 +- src/model/cra_bank_income_account.rs | 22 +- src/model/cra_bank_income_account_metadata.rs | 16 + src/model/cra_bank_income_bonus_type.rs | 3 + src/model/cra_bank_income_cause.rs | 7 +- src/model/cra_bank_income_complete_result.rs | 13 + src/model/cra_bank_income_complete_webhook.rs | 10 +- src/model/cra_bank_income_create_response.rs | 13 + src/model/cra_bank_income_employer.rs | 2 +- src/model/cra_bank_income_error_webhook.rs | 19 + src/model/cra_bank_income_get_response.rs | 2 +- .../cra_bank_income_historical_summary.rs | 2 +- src/model/cra_bank_income_item.rs | 15 +- src/model/cra_bank_income_source.rs | 40 +- src/model/cra_bank_income_summary.rs | 13 +- src/model/cra_bank_income_transaction.rs | 19 +- src/model/cra_bank_income_warning.rs | 12 +- src/model/cra_bank_income_warning_code.rs | 17 + src/model/cra_base_report_create_response.rs | 12 + ...nse.rs => cra_base_report_get_response.rs} | 12 +- ...a_check_report_base_report_get_response.rs | 18 + src/model/cra_check_report_create_response.rs | 13 + src/model/cra_check_report_failed_webhook.rs | 19 + ...eck_report_income_insights_get_response.rs | 16 + ...ck_report_network_insights_get_response.rs | 15 + ...eck_report_partner_insights_get_options.rs | 17 + ...ck_report_partner_insights_get_response.rs | 16 + src/model/cra_check_report_ready_webhook.rs | 22 + src/model/cra_income_insights.rs | 29 + src/model/cra_loan_application.rs | 27 + src/model/cra_loan_application_decision.rs | 11 + src/model/cra_loan_closed_status.rs | 15 + src/model/cra_loan_opened_status.rs | 15 + src/model/cra_loan_payment_history.rs | 26 + src/model/cra_loan_payment_schedule.rs | 20 + src/model/cra_loan_register.rs | 34 + src/model/cra_loan_register_application.rs | 17 + src/model/cra_loan_status.rs | 25 + src/model/cra_loan_status_history_update.rs | 15 + src/model/cra_loan_type.rs | 23 + src/model/cra_loan_unregister.rs | 16 + src/model/cra_loan_unregister_response.rs | 12 + src/model/cra_loan_update.rs | 21 + ...ra_loans_applications_register_response.rs | 12 + src/model/cra_loans_register_response.rs | 12 + src/model/cra_loans_update_response.rs | 12 + .../cra_monitoring_insights_get_response.rs | 16 + src/model/cra_monitoring_insights_item.rs | 20 + ..._monitoring_insights_subscribe_response.rs | 14 + ...onitoring_insights_unsubscribe_response.rs | 12 + src/model/cra_network_insights_item.rs | 16 + src/model/cra_network_insights_report.rs | 20 + src/model/cra_partner_insights.rs | 23 + .../cra_partner_insights_complete_webhook.rs | 19 + .../cra_partner_insights_error_webhook.rs | 19 + .../cra_partner_insights_get_response.rs | 15 + src/model/cra_partner_insights_item.rs | 23 + .../cra_partner_insights_item_account.rs | 41 + ..._partner_insights_item_account_metadata.rs | 16 + src/model/cra_partner_insights_prism.rs | 22 + src/model/cra_pdf_add_ons.rs | 9 + src/model/cra_prediction_interval.rs | 20 + src/model/credit1099.rs | 7 +- src/model/credit1099_filer.rs | 2 +- src/model/credit1099_payer.rs | 2 +- src/model/credit1099_recipient.rs | 2 +- src/model/credit_account_subtype.rs | 11 + src/model/credit_account_subtypes.rs | 4 + src/model/credit_ach_class.rs | 17 + src/model/credit_amount_with_currency.rs | 5 +- ...credit_audit_copy_token_create_response.rs | 2 +- ...credit_audit_copy_token_remove_response.rs | 2 +- ...credit_audit_copy_token_update_response.rs | 4 +- src/model/credit_bank_employer.rs | 2 +- src/model/credit_bank_employment.rs | 2 +- .../credit_bank_employment_get_response.rs | 2 +- src/model/credit_bank_employment_item.rs | 2 +- src/model/credit_bank_employment_report.rs | 2 +- src/model/credit_bank_employment_warning.rs | 12 +- .../credit_bank_employment_warning_type.rs | 7 + src/model/credit_bank_income.rs | 8 +- src/model/credit_bank_income_account.rs | 10 +- src/model/credit_bank_income_account_type.rs | 7 + src/model/credit_bank_income_category.rs | 50 + src/model/credit_bank_income_cause.rs | 7 +- src/model/credit_bank_income_error_type.rs | 37 + .../credit_bank_income_get_request_options.rs | 2 +- src/model/credit_bank_income_get_response.rs | 2 +- .../credit_bank_income_historical_summary.rs | 2 +- src/model/credit_bank_income_item.rs | 2 +- src/model/credit_bank_income_pay_frequency.rs | 17 + ...dit_bank_income_refresh_request_options.rs | 2 +- .../credit_bank_income_refresh_response.rs | 2 +- src/model/credit_bank_income_source.rs | 32 +- src/model/credit_bank_income_summary.rs | 2 +- src/model/credit_bank_income_transaction.rs | 2 +- src/model/credit_bank_income_warning.rs | 12 +- src/model/credit_bank_income_warning_code.rs | 20 + src/model/credit_bank_income_warning_type.rs | 7 + ...dit_bank_income_webhook_update_response.rs | 2 +- ...dit_bank_statement_upload_account_owner.rs | 2 +- ..._statement_upload_account_owner_address.rs | 2 +- ...edit_bank_statement_upload_bank_account.rs | 2 +- ...nk_statement_upload_bank_account_period.rs | 2 +- .../credit_bank_statement_upload_item.rs | 2 +- .../credit_bank_statement_upload_object.rs | 2 +- ...redit_bank_statement_upload_transaction.rs | 2 +- ..._statements_uploads_get_request_options.rs | 13 + ...it_bank_statements_uploads_get_response.rs | 2 +- src/model/credit_card_liability.rs | 2 +- src/model/credit_category.rs | 2 +- src/model/credit_document_metadata.rs | 11 +- src/model/credit_employer_verification.rs | 2 +- src/model/credit_employment_get_response.rs | 2 +- src/model/credit_employment_item.rs | 2 +- src/model/credit_employment_verification.rs | 2 +- src/model/credit_filter.rs | 6 +- src/model/credit_freddie_mac_asset.rs | 4 +- .../credit_freddie_mac_asset_transaction.rs | 4 +- .../credit_freddie_mac_asset_transactions.rs | 2 +- src/model/credit_freddie_mac_assets.rs | 2 +- .../credit_freddie_mac_individual_name.rs | 2 +- src/model/credit_freddie_mac_loan.rs | 2 +- .../credit_freddie_mac_loan_identifiers.rs | 2 +- src/model/credit_freddie_mac_loans.rs | 2 +- src/model/credit_freddie_mac_parties.rs | 2 +- src/model/credit_freddie_mac_party.rs | 4 +- .../credit_freddie_mac_party_individual.rs | 2 +- ...redit_freddie_mac_reporting_information.rs | 2 +- ...credit_freddie_mac_reports_get_response.rs | 2 +- src/model/credit_freddie_mac_service.rs | 2 +- src/model/credit_freddie_mac_services.rs | 2 +- ...redit_freddie_mac_verification_of_asset.rs | 4 +- ...ddie_mac_verification_of_asset_response.rs | 2 +- ...freddie_mac_verification_of_assets_deal.rs | 2 +- src/model/credit_pay_stub.rs | 4 +- src/model/credit_pay_stub_address.rs | 2 +- src/model/credit_pay_stub_deductions.rs | 2 +- src/model/credit_pay_stub_earnings.rs | 2 +- src/model/credit_pay_stub_employee.rs | 2 +- src/model/credit_pay_stub_employer.rs | 2 +- src/model/credit_pay_stub_net_pay.rs | 2 +- src/model/credit_pay_stub_pay_basis_type.rs | 11 + ...edit_payroll_income_get_request_options.rs | 13 + .../credit_payroll_income_get_response.rs | 6 +- ...l_income_parsing_config_update_response.rs | 2 +- ...credit_payroll_income_precheck_response.rs | 7 +- ..._payroll_income_refresh_request_options.rs | 2 +- .../credit_payroll_income_refresh_response.rs | 2 +- ...ayroll_income_risk_signals_get_response.rs | 6 +- src/model/credit_platform_ids.rs | 2 +- src/model/credit_relay_create_response.rs | 2 +- src/model/credit_relay_refresh_response.rs | 2 +- src/model/credit_relay_remove_response.rs | 2 +- src/model/credit_session.rs | 2 +- .../credit_session_bank_employment_result.rs | 7 +- .../credit_session_bank_employment_status.rs | 21 + .../credit_session_bank_income_result.rs | 7 +- .../credit_session_bank_income_status.rs | 21 + .../credit_session_document_income_result.rs | 5 +- src/model/credit_session_error.rs | 2 +- src/model/credit_session_item_add_result.rs | 2 +- .../credit_session_payroll_income_result.rs | 2 +- src/model/credit_session_results.rs | 2 +- src/model/credit_sessions_get_response.rs | 2 +- src/model/credit_w2.rs | 2 +- src/model/customer_initiated_return_risk.rs | 2 +- src/model/dashboard_user.rs | 11 +- src/model/dashboard_user_get_response.rs | 11 +- src/model/dashboard_user_list_response.rs | 2 +- src/model/dashboard_user_status.rs | 11 + src/model/data_sources.rs | 15 + src/model/date_range.rs | 2 +- src/model/deductions.rs | 2 +- src/model/deductions_breakdown.rs | 2 +- src/model/deductions_total.rs | 2 +- src/model/default_update_webhook.rs | 10 +- src/model/deposit_switch_address_data.rs | 4 +- .../deposit_switch_alt_create_response.rs | 4 +- .../deposit_switch_create_request_options.rs | 4 +- src/model/deposit_switch_create_response.rs | 4 +- src/model/deposit_switch_get_response.rs | 4 +- .../deposit_switch_state_update_webhook.rs | 9 +- src/model/deposit_switch_target_account.rs | 4 +- src/model/deposit_switch_target_user.rs | 6 +- .../deposit_switch_token_create_response.rs | 4 +- src/model/depository_account_subtype.rs | 25 + src/model/depository_account_subtypes.rs | 4 + src/model/depository_filter.rs | 6 +- src/model/detailed_originator.rs | 10 +- src/model/detected_account.rs | 2 +- src/model/distribution_breakdown.rs | 17 +- src/model/doc_type.rs | 49 + src/model/document_analysis.rs | 12 +- src/model/document_authenticity_match_code.rs | 29 + .../document_date_of_birth_match_code.rs | 13 + src/model/document_metadata.rs | 7 +- src/model/document_name_match_code.rs | 13 + src/model/document_risk_signal.rs | 6 +- ...cument_risk_signal_institution_metadata.rs | 2 +- src/model/document_risk_signals_object.rs | 2 +- src/model/document_risk_summary.rs | 4 +- src/model/document_status.rs | 11 + src/model/documentary_verification.rs | 2 +- .../documentary_verification_document.rs | 11 +- src/model/earnings.rs | 2 +- src/model/earnings_breakdown.rs | 2 +- ...arnings_breakdown_canonical_description.rs | 2 +- src/model/earnings_total.rs | 2 +- src/model/email.rs | 2 +- src/model/email_address_match_score.rs | 2 +- src/model/employee.rs | 2 +- src/model/employer.rs | 2 +- src/model/employer_verification.rs | 2 +- src/model/employers_search_response.rs | 2 +- src/model/employment_details.rs | 2 +- src/model/employment_source_type.rs | 9 + src/model/employment_verification.rs | 2 +- .../employment_verification_get_response.rs | 2 +- src/model/employment_verification_status.rs | 2 +- src/model/enhancements.rs | 8 +- src/model/enrich_transaction_direction.rs | 13 + src/model/enrichments.rs | 10 +- src/model/entity_document.rs | 9 +- src/model/entity_document_type.rs | 29 + src/model/entity_screening_hit_analysis.rs | 17 +- src/model/entity_screening_hit_data.rs | 2 +- .../entity_screening_hit_documents_items.rs | 4 +- src/model/entity_screening_hit_emails.rs | 4 +- .../entity_screening_hit_emails_items.rs | 4 +- src/model/entity_screening_hit_names.rs | 7 +- src/model/entity_screening_hit_names_items.rs | 4 +- .../entity_screening_hit_phone_numbers.rs | 7 +- src/model/entity_screening_hit_urls.rs | 2 +- src/model/entity_screening_hit_urls_items.rs | 4 +- ...ntity_screening_hits_phone_number_items.rs | 4 +- ...entity_screening_status_updated_webhook.rs | 11 +- src/model/entity_watchlist_code.rs | 47 + src/model/entity_watchlist_program.rs | 10 +- src/model/entity_watchlist_screening.rs | 13 +- src/model/entity_watchlist_screening_hit.rs | 13 +- .../entity_watchlist_screening_review.rs | 4 +- ...entity_watchlist_screening_search_terms.rs | 8 +- src/model/entity_watchlist_search_terms.rs | 8 +- src/model/expiration_date.rs | 13 + src/model/extended_recipient_metadata.rs | 31 + ...rnal_payment_initiation_consent_options.rs | 4 +- src/model/external_payment_options.rs | 2 +- src/model/external_payment_refund_details.rs | 2 +- src/model/external_payment_schedule_base.rs | 7 +- .../external_payment_schedule_request.rs | 2 +- ...auth_microdeposit_auto_verified_webhook.rs | 7 +- ...crodeposit_verification_expired_webhook.rs | 7 +- src/model/fdx_content_types.rs | 17 + src/model/fdx_fi_attribute.rs | 2 +- src/model/fdx_hateoas_link.rs | 9 +- src/model/fdx_hateoas_link_action.rs | 15 + src/model/fdx_notification_category.rs | 15 + src/model/fdx_notification_payload.rs | 8 +- src/model/fdx_notification_payload_id_type.rs | 15 + src/model/fdx_notification_priority.rs | 11 + src/model/fdx_notification_severity.rs | 15 + src/model/fdx_notification_type.rs | 17 + src/model/fdx_party.rs | 9 +- src/model/fdx_party_registry.rs | 13 + src/model/fdx_party_type.rs | 17 + src/model/fdx_recipient_metadata.rs | 19 + src/model/financial_institution_insights.rs | 2 +- src/model/forecasted_monthly_income.rs | 14 + src/model/form1099_type.rs | 11 + src/model/fraud_amount.rs | 7 +- .../generic_screening_hit_location_items.rs | 4 +- src/model/get_recipient_response.rs | 2 + src/model/get_recipients_response.rs | 13 + src/model/health_incident.rs | 2 +- src/model/hidden_match_summary_code.rs | 26 + src/model/historical_annual_income.rs | 14 + src/model/historical_balance.rs | 2 +- src/model/historical_update_webhook.rs | 14 +- src/model/holding.rs | 8 +- src/model/holdings_default_update_webhook.rs | 10 +- src/model/holdings_override.rs | 2 +- src/model/hosted_link_delivery_method.rs | 11 + src/model/hosted_mmd_verification_webhook.rs | 13 +- src/model/id_number_type.rs | 75 + src/model/identity_default_update_webhook.rs | 10 +- src/model/identity_document_metadata.rs | 31 - src/model/identity_document_upload.rs | 20 + .../identity_document_upload_metadata.rs | 25 + .../identity_document_upload_risk_insights.rs | 17 + .../identity_document_upload_risk_signal.rs | 23 + .../identity_document_upload_risk_summary.rs | 13 + ...y_documents_uploads_get_request_options.rs | 14 + ...identity_documents_uploads_get_response.rs | 18 + src/model/identity_get_request_options.rs | 2 +- src/model/identity_get_response.rs | 4 +- src/model/identity_match_request_options.rs | 2 +- src/model/identity_match_response.rs | 4 +- src/model/identity_match_user.rs | 4 +- src/model/identity_refresh_response.rs | 2 +- src/model/identity_update_types.rs | 13 + src/model/identity_verification.rs | 18 +- .../identity_verification_autofill_address.rs | 15 +- ...y_verification_autofill_create_response.rs | 8 +- .../identity_verification_autofill_status.rs | 9 + ...dentity_verification_autofill_user_data.rs | 4 +- ...entity_verification_create_request_user.rs | 8 +- .../identity_verification_create_response.rs | 18 +- ..._verification_document_address_response.rs | 2 +- ...ity_verification_document_name_response.rs | 14 + .../identity_verification_get_response.rs | 18 +- .../identity_verification_list_response.rs | 2 +- .../identity_verification_request_user.rs | 8 +- ...identity_verification_request_user_name.rs | 2 +- ...dentity_verification_response_user_name.rs | 2 +- .../identity_verification_retried_webhook.rs | 7 +- ...verification_retry_request_steps_object.rs | 4 +- .../identity_verification_retry_response.rs | 18 +- src/model/identity_verification_status.rs | 30 + ...ity_verification_status_updated_webhook.rs | 7 +- .../identity_verification_step_status.rs | 27 + .../identity_verification_step_summary.rs | 19 +- ...ntity_verification_step_updated_webhook.rs | 7 +- ...dentity_verification_template_reference.rs | 2 +- .../identity_verification_user_address.rs | 8 +- src/model/identity_verification_user_data.rs | 8 +- src/model/image_quality.rs | 15 + src/model/incident_update.rs | 2 +- src/model/income_breakdown.rs | 2 +- src/model/income_breakdown_type.rs | 2 +- src/model/income_override.rs | 8 +- src/model/income_sources_counts.rs | 14 + src/model/income_summary_field_number.rs | 7 +- src/model/income_summary_field_string.rs | 7 +- ...ome_verification_create_request_options.rs | 2 +- .../income_verification_create_response.rs | 2 +- .../income_verification_doc_parsing_config.rs | 9 + .../income_verification_payroll_flow_type.rs | 9 + ...come_verification_paystubs_get_response.rs | 6 +- ...income_verification_precheck_confidence.rs | 17 + .../income_verification_precheck_employer.rs | 2 +- ..._verification_precheck_employer_address.rs | 2 +- ...ome_verification_precheck_military_info.rs | 2 +- ...rification_precheck_payroll_institution.rs | 2 +- .../income_verification_precheck_response.rs | 7 +- .../income_verification_precheck_user.rs | 2 +- ...cation_refresh_reconnect_needed_webhook.rs | 7 +- ...erification_risk_signals_status_webhook.rs | 7 +- src/model/income_verification_source_type.rs | 9 + .../income_verification_status_webhook.rs | 9 +- ...come_verification_taxforms_get_response.rs | 6 +- src/model/individual_name.rs | 2 +- src/model/individual_screening_hit_names.rs | 7 +- src/model/individual_watchlist_code.rs | 76 + src/model/individual_watchlist_program.rs | 12 +- src/model/inflow_model.rs | 2 +- src/model/initial_update_webhook.rs | 11 +- src/model/institution.rs | 14 +- src/model/institution_status.rs | 2 +- src/model/institution_status_alert_webhook.rs | 7 +- src/model/institution_supported_networks.rs | 2 +- .../institutions_get_by_id_request_options.rs | 2 +- src/model/institutions_get_by_id_response.rs | 2 +- src/model/institutions_get_request_options.rs | 11 +- src/model/institutions_get_response.rs | 2 +- ...tions_search_payment_initiation_options.rs | 2 +- .../institutions_search_request_options.rs | 2 +- src/model/institutions_search_response.rs | 2 +- src/model/investment_account_subtype.rs | 105 + src/model/investment_account_subtypes.rs | 4 + src/model/investment_filter.rs | 6 +- ...investment_holdings_get_request_options.rs | 2 +- src/model/investment_transaction.rs | 9 +- src/model/investment_transaction_subtype.rs | 101 + src/model/investment_transaction_type.rs | 25 + src/model/investments_auth_data_sources.rs | 32 + src/model/investments_auth_get_numbers.rs | 2 +- .../investments_auth_get_request_options.rs | 2 +- src/model/investments_auth_get_response.rs | 9 +- src/model/investments_auth_owner.rs | 2 +- .../investments_default_update_webhook.rs | 10 +- .../investments_historical_update_webhook.rs | 10 +- .../investments_holdings_get_response.rs | 4 +- src/model/investments_refresh_response.rs | 2 +- ...tments_transactions_get_request_options.rs | 4 +- .../investments_transactions_get_response.rs | 4 +- .../investments_transactions_override.rs | 2 +- src/model/iso_currency_code.rs | 7 + src/model/issue.rs | 32 + src/model/issue_resolved_webhook.rs | 24 + src/model/issues_get_response.rs | 17 + src/model/issues_search_response.rs | 17 + src/model/issues_status.rs | 17 + src/model/issues_subscribe_response.rs | 12 + src/model/issuing_country.rs | 11 + src/model/item.rs | 22 +- .../item_access_token_invalidate_response.rs | 2 +- src/model/item_activity_list_response.rs | 2 +- src/model/item_add_result_webhook.rs | 23 + src/model/item_application_list_response.rs | 2 +- ...item_application_scopes_update_response.rs | 2 +- src/model/item_application_unlink_response.rs | 2 +- src/model/item_create_authentication.rs | 11 + src/model/item_error_webhook.rs | 10 +- src/model/item_get_response.rs | 8 +- src/model/item_import_request_options.rs | 2 +- src/model/item_import_request_user_auth.rs | 2 +- src/model/item_import_response.rs | 2 +- src/model/item_login_repaired_webhook.rs | 7 +- src/model/item_product_ready_webhook.rs | 10 +- .../item_public_token_create_response.rs | 2 +- .../item_public_token_exchange_response.rs | 2 +- src/model/item_remove_response.rs | 2 +- src/model/item_status.rs | 2 +- src/model/item_status_investments.rs | 2 +- src/model/item_status_last_webhook.rs | 2 +- src/model/item_status_transactions.rs | 6 +- src/model/item_webhook_update_response.rs | 4 +- src/model/item_with_consent_fields.rs | 2 + src/model/jwk_public_key.rs | 2 +- src/model/kyc_check_address_summary.rs | 73 +- src/model/kyc_check_date_of_birth_summary.rs | 49 +- src/model/kyc_check_details.rs | 6 +- ...kyc_check_details_international_address.rs | 89 + src/model/kyc_check_id_number_summary.rs | 7 +- src/model/kyc_check_name_summary.rs | 35 +- src/model/kyc_check_phone_summary.rs | 9 +- src/model/last_data_access_times.rs | 2 +- ...es_account_ids_with_updated_liabilities.rs | 11 +- .../liabilities_default_update_webhook.rs | 12 +- src/model/liabilities_get_request_options.rs | 2 +- src/model/liabilities_get_response.rs | 4 +- src/model/liabilities_object.rs | 2 +- src/model/liability_override.rs | 6 +- src/model/link_callback_metadata.rs | 13 +- src/model/link_delivery_account.rs | 9 +- src/model/link_delivery_callback_webhook.rs | 6 +- .../link_delivery_communication_method.rs | 7 +- src/model/link_delivery_create_response.rs | 2 +- src/model/link_delivery_delivery_method.rs | 13 + src/model/link_delivery_get_response.rs | 7 +- src/model/link_delivery_institution.rs | 2 +- src/model/link_delivery_metadata.rs | 9 +- src/model/link_delivery_options.rs | 2 +- src/model/link_delivery_recipient.rs | 2 +- src/model/link_delivery_session_status.rs | 25 + .../link_delivery_verification_status.rs | 21 + .../link_delivery_webhook_callback_type.rs | 11 + ...k_delivery_webhook_communication_method.rs | 9 + .../link_delivery_webhook_delivery_status.rs | 9 + src/model/link_event.rs | 5 +- src/model/link_event_metadata.rs | 55 + src/model/link_event_name.rs | 57 + src/model/link_events_webhook.rs | 12 +- ...o_auth_correlation_id_exchange_response.rs | 2 +- ...link_profile_eligibility_check_response.rs | 14 + .../link_profile_eligibility_check_user.rs | 12 + src/model/link_session_bank_income_result.rs | 28 + src/model/link_session_cra_item_add_result.rs | 19 + src/model/link_session_exit.rs | 6 +- src/model/link_session_exit_deprecated.rs | 17 + src/model/link_session_exit_metadata.rs | 4 +- .../link_session_exit_metadata_institution.rs | 4 +- src/model/link_session_finished_webhook.rs | 16 +- src/model/link_session_item_add_result.rs | 19 + .../link_session_payroll_income_result.rs | 19 + src/model/link_session_results.rs | 29 + src/model/link_session_success.rs | 4 +- src/model/link_session_success_metadata.rs | 11 +- .../link_session_success_metadata_account.rs | 12 +- ...nk_session_success_metadata_institution.rs | 4 +- ...ession_success_metadata_transfer_status.rs | 3 + src/model/link_token_account_filters.rs | 2 +- src/model/link_token_create_card_switch.rs | 2 +- src/model/link_token_create_hosted_link.rs | 18 +- src/model/link_token_create_identity.rs | 20 + .../link_token_create_institution_data.rs | 2 +- src/model/link_token_create_request_auth.rs | 24 +- .../link_token_create_request_base_report.rs | 5 +- .../link_token_create_request_cra_options.rs | 29 + ..._create_request_cra_options_base_report.rs | 13 + ...e_request_cra_options_cashflow_insights.rs | 17 + ...te_request_cra_options_partner_insights.rs | 17 + ..._create_request_credit_partner_insights.rs | 17 + ...ink_token_create_request_deposit_switch.rs | 4 +- .../link_token_create_request_employment.rs | 6 +- ...n_create_request_employment_bank_income.rs | 2 +- ...en_create_request_identity_verification.rs | 2 +- ...oken_create_request_income_verification.rs | 8 +- ...request_income_verification_bank_income.rs | 4 +- ...uest_income_verification_payroll_income.rs | 7 +- ...en_create_request_payment_configuration.rs | 15 + ...token_create_request_payment_initiation.rs | 2 +- .../link_token_create_request_statements.rs | 14 +- .../link_token_create_request_transfer.rs | 5 +- src/model/link_token_create_request_update.rs | 13 +- src/model/link_token_create_request_user.rs | 6 +- ...reate_request_user_stated_income_source.rs | 14 +- src/model/link_token_create_response.rs | 6 +- src/model/link_token_eu_config.rs | 2 +- src/model/link_token_get_metadata_response.rs | 13 +- src/model/link_token_get_response.rs | 4 +- src/model/link_token_get_sessions_response.rs | 26 +- src/model/link_token_investments.rs | 2 +- src/model/link_token_investments_auth.rs | 7 +- src/model/link_token_transactions.rs | 6 +- .../link_user_delivery_status_webhook.rs | 4 +- src/model/loan.rs | 4 +- src/model/loan_account_subtype.rs | 29 + src/model/loan_account_subtypes.rs | 4 + src/model/loan_filter.rs | 6 +- src/model/loan_identifier.rs | 7 +- src/model/loan_identifier_type.rs | 7 + src/model/loan_identifiers.rs | 4 +- src/model/loan_payments_counts.rs | 14 + src/model/loan_payments_merchant_counts.rs | 14 + src/model/loans.rs | 4 +- src/model/location.rs | 2 +- src/model/match_summary.rs | 7 +- src/model/match_summary_code.rs | 26 + src/model/merchant_insights.rs | 2 +- src/model/meta.rs | 2 +- src/{model.rs => model/mod.rs} | 850 ++- ...ing_consumer_report_permissible_purpose.rs | 13 + src/model/monitoring_income_insights.rs | 25 + src/model/monitoring_income_source.rs | 34 + src/model/monitoring_insights.rs | 15 + src/model/monitoring_insights_item_status.rs | 17 + src/model/monitoring_insights_status.rs | 15 + src/model/monitoring_insights_webhook.rs | 24 + src/model/monitoring_item_status_code.rs | 15 + src/model/monitoring_loan_insights.rs | 17 + src/model/mortgage_interest_rate.rs | 2 +- src/model/mortgage_liability.rs | 2 +- src/model/mortgage_property_address.rs | 2 +- src/model/multi_document_risk_signal.rs | 2 +- src/model/name_match_score.rs | 4 +- src/model/net_pay.rs | 2 +- src/model/network_insights_item.rs | 16 + src/model/network_insights_report.rs | 20 + .../network_insights_report_get_response.rs | 15 + src/model/network_insights_schema.rs | 9 + src/model/new_accounts_available_webhook.rs | 12 +- src/model/numbers.rs | 4 +- src/model/numbers_acats.rs | 4 +- src/model/numbers_ach.rs | 6 +- src/model/numbers_aton.rs | 2 +- src/model/numbers_bacs.rs | 2 +- src/model/numbers_eft.rs | 2 +- src/model/numbers_international.rs | 2 +- src/model/numbers_international_iban.rs | 2 +- src/model/omittable_transfer_type.rs | 9 + src/model/option_contract.rs | 2 +- src/model/originator.rs | 9 +- .../originator_expected_transfer_frequency.rs | 13 + src/model/other_account_subtype.rs | 9 + src/model/other_account_subtypes.rs | 4 + src/model/other_filter.rs | 6 +- src/model/override_account_type.rs | 29 + src/model/owner.rs | 5 +- src/model/owner_override.rs | 2 +- src/model/ownership_type.rs | 2 +- src/model/parties.rs | 2 +- src/model/partner_customer_create_response.rs | 4 +- src/model/partner_customer_enable_response.rs | 2 +- src/model/partner_customer_get_response.rs | 4 +- ...stomer_o_auth_institutions_get_response.rs | 13 +- src/model/partner_customer_remove_response.rs | 2 +- src/model/partner_end_customer.rs | 15 +- src/model/partner_end_customer_address.rs | 2 +- ...er_end_customer_assets_under_management.rs | 2 +- .../partner_end_customer_billing_contact.rs | 2 +- ...tner_end_customer_customer_support_info.rs | 2 +- .../partner_end_customer_flowdown_status.rs | 13 + ...partner_end_customer_o_auth_institution.rs | 4 +- ...r_o_auth_institution_application_status.rs | 15 + ...ustomer_o_auth_institution_environments.rs | 9 +- ...d_customer_o_auth_status_updated_values.rs | 15 + ..._customer_o_auth_status_updated_webhook.rs | 9 +- ...rtner_end_customer_questionnaire_status.rs | 11 + src/model/partner_end_customer_status.rs | 21 + .../partner_end_customer_technical_contact.rs | 2 +- .../partner_end_customer_with_secrets.rs | 9 +- src/model/party.rs | 4 +- src/model/party_individual.rs | 2 +- src/model/party_role_type.rs | 6 + src/model/pay.rs | 2 +- src/model/pay_frequency_value.rs | 2 +- src/model/pay_period_details.rs | 2 +- src/model/pay_period_details_pay_frequency.rs | 2 +- src/model/pay_stub_deductions_breakdown.rs | 2 +- src/model/pay_stub_deductions_total.rs | 2 +- src/model/pay_stub_distribution_breakdown.rs | 2 +- src/model/pay_stub_earnings_breakdown.rs | 2 +- src/model/pay_stub_earnings_total.rs | 2 +- src/model/pay_stub_pay_period_details.rs | 8 +- src/model/pay_stub_taxpayer_id.rs | 2 +- src/model/payment_amount.rs | 7 +- src/model/payment_amount_currency.rs | 17 + src/model/payment_amount_nullable.rs | 7 +- src/model/payment_amount_refunded.rs | 2 +- src/model/payment_amount_to_refund.rs | 2 +- src/model/payment_channel.rs | 16 + .../payment_consent_max_payment_amount.rs | 2 +- .../payment_consent_periodic_alignment.rs | 15 + src/model/payment_consent_periodic_amount.rs | 15 +- .../payment_consent_periodic_amount_amount.rs | 2 +- .../payment_consent_periodic_interval.rs | 13 + src/model/payment_consent_valid_date_time.rs | 2 +- src/model/payment_initiation_address.rs | 2 +- .../payment_initiation_consent_constraints.rs | 4 +- ...ment_initiation_consent_create_response.rs | 7 +- ...payment_initiation_consent_get_response.rs | 9 +- ...ayment_initiation_consent_payer_details.rs | 28 + ...ayment_initiation_consent_payer_numbers.rs | 17 + ...iation_consent_payment_execute_response.rs | 7 +- ...ment_initiation_consent_processing_mode.rs | 13 + ...ment_initiation_consent_revoke_response.rs | 2 +- src/model/payment_initiation_consent_scope.rs | 15 + .../payment_initiation_consent_status.rs | 25 + src/model/payment_initiation_consent_type.rs | 13 + ...yment_initiation_maximum_payment_amount.rs | 11 +- src/model/payment_initiation_metadata.rs | 4 +- src/model/payment_initiation_payment.rs | 8 +- ...ment_initiation_payment_create_response.rs | 7 +- ...ayment_initiation_payment_create_status.rs | 9 + ...payment_initiation_payment_get_response.rs | 4 +- ...ayment_initiation_payment_list_response.rs | 2 +- ...ent_initiation_payment_reverse_response.rs | 7 +- .../payment_initiation_payment_status.rs | 64 + ...nitiation_payment_token_create_response.rs | 2 +- src/model/payment_initiation_recipient.rs | 2 +- ...nt_initiation_recipient_create_response.rs | 2 +- ...yment_initiation_recipient_get_response.rs | 2 +- ...ment_initiation_recipient_list_response.rs | 2 +- ...ment_initiation_standing_order_metadata.rs | 5 +- src/model/payment_meta.rs | 2 +- src/model/payment_profile_create_response.rs | 2 +- src/model/payment_profile_get_response.rs | 7 +- src/model/payment_profile_remove_response.rs | 2 +- src/model/payment_profile_status.rs | 17 + src/model/payment_schedule_interval.rs | 9 + src/model/payment_scheme.rs | 2 +- src/model/payment_status_update_webhook.rs | 14 +- src/model/payroll_income_account_data.rs | 2 +- src/model/payroll_income_object.rs | 2 +- src/model/payroll_income_rate_of_pay.rs | 2 +- src/model/payroll_item.rs | 2 +- src/model/payroll_item_status.rs | 2 +- src/model/payroll_risk_signals_item.rs | 2 +- src/model/paystub.rs | 2 +- src/model/paystub_address.rs | 2 +- src/model/paystub_details.rs | 2 +- src/model/paystub_employer.rs | 2 +- src/model/paystub_override.rs | 14 +- src/model/paystub_override_deductions.rs | 16 + .../paystub_override_deductions_breakdown.rs | 22 + .../paystub_override_deductions_total.rs | 19 + ...paystub_override_distribution_breakdown.rs | 2 +- src/model/paystub_override_earnings.rs | 16 + .../paystub_override_earnings_breakdown.rs | 32 + src/model/paystub_override_earnings_total.rs | 19 + src/model/paystub_override_employee.rs | 10 +- .../paystub_override_employee_address.rs | 2 +- src/model/paystub_override_employer.rs | 6 +- .../paystub_override_employer_address.rs | 27 + src/model/paystub_override_net_pay.rs | 19 + .../paystub_override_pay_period_details.rs | 2 +- ...ent.rs => paystub_override_taxpayer_id.rs} | 16 +- src/model/paystub_pay_frequency.rs | 2 +- src/model/paystub_ytd_details.rs | 2 +- src/model/pending_disconnect_webhook.rs | 23 + .../pending_disconnect_webhook_reason.rs | 11 + src/model/pending_expiration_webhook.rs | 9 +- src/model/personal_finance_category.rs | 2 +- src/model/phone_number.rs | 2 +- src/model/phone_number_match_score.rs | 2 +- src/model/phone_type.rs | 9 + src/model/physical_document_category.rs | 31 + src/model/physical_document_extracted_data.rs | 14 +- ...ysical_document_extracted_data_analysis.rs | 15 +- src/model/physical_document_images.rs | 2 +- src/model/plaid_error.rs | 21 +- src/model/plaid_error_type.rs | 43 + src/model/platform_ids.rs | 2 +- src/model/po_box_status.rs | 11 + src/model/prism_cash_score.rs | 27 + src/model/prism_cash_score_metadata.rs | 42 + src/model/prism_cash_score_version.rs | 3 + src/model/prism_first_detect.rs | 27 + src/model/prism_first_detect_version.rs | 3 + src/model/prism_insights.rs | 19 + src/model/prism_insights_result.rs | 9 + src/model/prism_insights_version.rs | 3 + src/model/prism_product.rs | 9 + src/model/prism_versions.rs | 20 + src/model/processor_account_get_response.rs | 6 +- src/model/processor_auth_get_response.rs | 4 +- .../processor_balance_get_request_options.rs | 8 +- src/model/processor_balance_get_response.rs | 4 +- ...processor_bank_transfer_create_response.rs | 4 +- src/model/processor_default_update_webhook.rs | 10 +- .../processor_historical_update_webhook.rs | 14 +- src/model/processor_identity_get_response.rs | 4 +- .../processor_identity_match_response.rs | 4 +- src/model/processor_initial_update_webhook.rs | 11 +- .../processor_liabilities_get_response.rs | 4 +- src/model/processor_number.rs | 2 +- ...r_recurring_transactions_update_webhook.rs | 7 +- ...ocessor_signal_decision_report_response.rs | 2 +- .../processor_signal_evaluate_response.rs | 10 +- .../processor_signal_prepare_response.rs | 2 +- ...processor_signal_return_report_response.rs | 2 +- ...ripe_bank_account_token_create_response.rs | 2 +- ...rocessor_sync_updates_available_webhook.rs | 7 +- src/model/processor_token_create_response.rs | 2 +- ...rocessor_token_permissions_get_response.rs | 5 +- ...rocessor_token_permissions_set_response.rs | 2 +- ...processor_token_webhook_update_response.rs | 2 +- ...cessor_transactions_get_request_options.rs | 4 +- .../processor_transactions_get_response.rs | 4 +- ...sor_transactions_recurring_get_response.rs | 2 +- ...processor_transactions_refresh_response.rs | 2 +- .../processor_transactions_removed_webhook.rs | 10 +- .../processor_transactions_sync_response.rs | 15 +- src/model/product_access.rs | 2 +- ...oduct_permissions_required_auth_webhook.rs | 7 +- ...t_permissions_required_identity_webhook.rs | 7 +- src/model/product_status.rs | 2 +- src/model/product_status_breakdown.rs | 4 +- src/model/products.rs | 69 + src/model/profile_get_response.rs | 18 + src/model/profile_identity.rs | 33 + src/model/profile_identity_address.rs | 30 + src/model/profile_identity_name.rs | 14 + src/model/profile_item.rs | 16 + ...ofile_network_status_get_network_status.rs | 9 + .../profile_network_status_get_response.rs | 15 + src/model/profile_network_status_get_user.rs | 12 + src/model/program_name_sensitivity.rs | 21 + src/model/proxy_type.rs | 25 + src/model/pslf_status.rs | 4 +- src/model/recipient_bacs.rs | 2 +- src/model/recipient_bacs_nullable.rs | 2 +- src/model/recurrence.rs | 2 +- src/model/recurring_cancelled_webhook.rs | 7 +- src/model/recurring_frequency.rs | 2 +- src/model/recurring_insights_stream.rs | 12 +- src/model/recurring_new_transfer_webhook.rs | 7 +- src/model/recurring_transaction_frequency.rs | 29 + src/model/recurring_transactions.rs | 2 +- .../recurring_transactions_update_webhook.rs | 7 +- src/model/recurring_transfer.rs | 30 +- src/model/recurring_transfer_nullable.rs | 9 +- .../recurring_transfer_skipped_webhook.rs | 27 +- src/model/removed_transaction.rs | 7 +- src/model/report_type.rs | 7 + src/model/reporting_information.rs | 2 +- src/model/risk_check_behavior.rs | 14 +- .../risk_check_behavior_bot_detected_label.rs | 17 + ...heck_behavior_fraud_ring_detected_label.rs | 17 + ..._check_behavior_user_interactions_label.rs | 21 + src/model/risk_check_details.rs | 12 +- src/model/risk_check_device.rs | 7 +- src/model/risk_check_email.rs | 21 +- .../risk_check_email_domain_is_custom.rs | 11 + .../risk_check_email_domain_is_disposable.rs | 11 + ...isk_check_email_domain_is_free_provider.rs | 11 + .../risk_check_email_is_deliverable_status.rs | 11 + ...ck_email_top_level_domain_is_suspicious.rs | 11 + .../risk_check_identity_abuse_signals.rs | 4 +- src/model/risk_check_linked_service.rs | 185 + src/model/risk_check_phone.rs | 5 +- src/model/risk_check_stolen_identity.rs | 2 +- src/model/risk_check_synthetic_identity.rs | 2 +- src/model/risk_profile.rs | 8 +- src/model/risk_reason.rs | 16 + src/model/risk_signal_document_reference.rs | 13 +- src/model/risk_signal_document_status.rs | 15 + src/model/risk_signal_document_type.rs | 29 + src/model/risk_signal_file_type.rs | 21 + src/model/role.rs | 4 +- src/model/role_detail.rs | 7 +- src/model/roles.rs | 4 +- src/model/ruleset.rs | 16 + ...ndbox_bank_income_fire_webhook_response.rs | 2 +- ...ncome_webhook_fire_request_webhook_code.rs | 9 + ...ome_webhook_fire_request_webhook_fields.rs | 7 +- ...box_bank_transfer_fire_webhook_response.rs | 2 +- ...sandbox_bank_transfer_simulate_response.rs | 2 +- .../sandbox_income_fire_webhook_response.rs | 2 +- ...ncome_webhook_fire_request_webhook_code.rs | 9 + .../sandbox_item_fire_webhook_response.rs | 2 +- .../sandbox_item_reset_login_response.rs | 2 +- ...x_item_set_verification_status_response.rs | 2 +- .../sandbox_oauth_select_accounts_response.rs | 9 +- ...ox_payment_profile_reset_login_response.rs | 2 +- ..._processor_token_create_request_options.rs | 2 +- ...sandbox_processor_token_create_response.rs | 2 +- ...request_income_verification_bank_income.rs | 2 +- ...box_public_token_create_request_options.rs | 6 +- ...ate_request_options_income_verification.rs | 9 +- ...token_create_request_options_statements.rs | 14 + ...ken_create_request_options_transactions.rs | 2 +- .../sandbox_public_token_create_response.rs | 2 +- .../sandbox_transfer_fire_webhook_response.rs | 2 +- ...ansfer_ledger_deposit_simulate_response.rs | 2 +- ...sfer_ledger_simulate_available_response.rs | 2 +- ...nsfer_ledger_withdraw_simulate_response.rs | 2 +- ...ndbox_transfer_refund_simulate_response.rs | 2 +- ...ox_transfer_repayment_simulate_response.rs | 2 +- .../sandbox_transfer_simulate_response.rs | 2 +- ...andbox_transfer_sweep_simulate_response.rs | 2 +- ...ox_transfer_test_clock_advance_response.rs | 2 +- ...box_transfer_test_clock_create_response.rs | 2 +- ...andbox_transfer_test_clock_get_response.rs | 2 +- ...ndbox_transfer_test_clock_list_response.rs | 2 +- .../sandbox_user_reset_login_response.rs | 12 + src/model/scopes.rs | 2 +- src/model/scopes_context.rs | 9 + src/model/screening_hit_analysis.rs | 13 +- src/model/screening_hit_data.rs | 2 +- src/model/screening_hit_date_of_birth_item.rs | 4 +- src/model/screening_hit_documents_items.rs | 4 +- src/model/screening_hit_names_items.rs | 4 +- src/model/screening_status_updated_webhook.rs | 7 +- src/model/security.rs | 18 +- src/model/security_override.rs | 6 +- src/model/selfie_analysis.rs | 15 +- .../selfie_analysis_document_comparison.rs | 11 + src/model/selfie_analysis_facial_analysis.rs | 35 + ...selfie_analysis_facial_analysis_outcome.rs | 9 + src/model/selfie_analysis_liveness_check.rs | 9 + src/model/selfie_capture.rs | 2 +- src/model/selfie_check.rs | 8 +- src/model/selfie_check_selfie.rs | 8 +- src/model/selfie_check_status.rs | 9 + src/model/selfie_status.rs | 9 + src/model/service.rs | 4 +- src/model/service_product_fulfillment.rs | 4 +- .../service_product_fulfillment_detail.rs | 7 +- .../service_product_fulfillment_identifier.rs | 9 + src/model/servicer_address_data.rs | 2 +- src/model/services.rs | 4 +- src/model/signal_address_data.rs | 2 +- src/model/signal_decision_outcome.rs | 27 + src/model/signal_decision_report_response.rs | 2 +- src/model/signal_device.rs | 4 +- src/model/signal_evaluate_core_attributes.rs | 53 +- src/model/signal_evaluate_response.rs | 16 +- src/model/signal_payment_method.rs | 31 + src/model/signal_person_name.rs | 2 +- src/model/signal_prepare_response.rs | 2 +- src/model/signal_return_report_response.rs | 2 +- src/model/signal_scores.rs | 2 +- src/model/signal_user.rs | 4 +- src/model/signal_warning.rs | 2 +- src/model/simulated_transfer_sweep.rs | 10 +- src/model/single_document_risk_signal.rs | 4 +- src/model/sms_verification.rs | 31 + src/model/sms_verification_status.rs | 13 + src/model/source.rs | 13 + src/model/statements_account.rs | 2 +- src/model/statements_list_response.rs | 2 +- .../statements_refresh_complete_result.rs | 13 + .../statements_refresh_complete_webhook.rs | 9 +- src/model/statements_refresh_response.rs | 2 +- src/model/statements_statement.rs | 2 +- src/model/status.rs | 2 +- src/model/statuses.rs | 2 +- src/model/strategy.rs | 28 + src/model/student_loan.rs | 11 +- src/model/student_loan_repayment_model.rs | 2 +- src/model/student_loan_status.rs | 2 +- src/model/student_repayment_plan.rs | 2 +- src/model/sweep_status.rs | 2 +- src/model/sweep_trigger.rs | 18 + src/model/sync_updates_available_webhook.rs | 7 +- src/model/taxform.rs | 2 +- src/model/taxpayer_id.rs | 2 +- src/model/taxpayer_identifier.rs | 7 +- src/model/taxpayer_identifier_type.rs | 7 + src/model/taxpayer_identifiers.rs | 4 +- src/model/total.rs | 2 +- src/model/total_canonical_description.rs | 2 +- src/model/total_inflow_amount.rs | 19 + src/model/total_inflow_amount30_d.rs | 19 + src/model/total_inflow_amount60_d.rs | 19 + src/model/total_inflow_amount90_d.rs | 19 + src/model/total_monthly_income_insights.rs | 14 + src/model/total_outflow_amount.rs | 19 + src/model/total_outflow_amount30_d.rs | 19 + src/model/total_outflow_amount60_d.rs | 19 + src/model/total_outflow_amount90_d.rs | 19 + src/model/transaction.rs | 8 +- src/model/transaction_base.rs | 14 +- src/model/transaction_code.rs | 2 +- src/model/transaction_counterparty.rs | 7 +- src/model/transaction_override.rs | 2 +- src/model/transaction_stream.rs | 16 +- src/model/transaction_stream_amount.rs | 2 +- src/model/transaction_stream_status.rs | 21 + src/model/transactions_category_rule.rs | 4 +- .../transactions_enhance_get_response.rs | 2 +- .../transactions_enrich_request_options.rs | 2 +- src/model/transactions_enrich_response.rs | 2 +- src/model/transactions_get_request_options.rs | 12 +- src/model/transactions_get_response.rs | 4 +- ...nsactions_recurring_get_request_options.rs | 2 +- .../transactions_recurring_get_response.rs | 2 +- src/model/transactions_refresh_response.rs | 2 +- src/model/transactions_removed_webhook.rs | 10 +- src/model/transactions_rule_details.rs | 9 +- src/model/transactions_rule_field.rs | 9 + src/model/transactions_rule_type.rs | 10 + .../transactions_rules_create_response.rs | 4 +- src/model/transactions_rules_list_response.rs | 2 +- .../transactions_rules_remove_response.rs | 2 +- .../transactions_sync_request_options.rs | 12 +- src/model/transactions_sync_response.rs | 16 +- src/model/transactions_update_status.rs | 18 + ...transactions_user_insights_get_response.rs | 2 +- src/model/transfer.rs | 41 +- src/model/transfer_ach_network.rs | 11 + src/model/transfer_authorization.rs | 15 +- .../transfer_authorization_cancel_response.rs | 12 + .../transfer_authorization_create_response.rs | 4 +- src/model/transfer_authorization_decision.rs | 17 + ...ansfer_authorization_decision_rationale.rs | 10 +- ...r_authorization_decision_rationale_code.rs | 2 +- src/model/transfer_authorization_device.rs | 2 +- ...ansfer_authorization_guarantee_decision.rs | 2 +- ...horization_guarantee_decision_rationale.rs | 7 +- ...ation_guarantee_decision_rationale_code.rs | 25 + .../transfer_authorization_payment_risk.rs | 8 +- ...ransfer_authorization_proposed_transfer.rs | 24 +- .../transfer_authorization_risk_level.rs | 15 + .../transfer_authorization_user_in_request.rs | 2 +- src/model/transfer_balance.rs | 7 +- src/model/transfer_balance_get_response.rs | 4 +- src/model/transfer_balance_type.rs | 12 + src/model/transfer_cancel_response.rs | 2 +- .../transfer_capabilities_get_response.rs | 2 +- src/model/transfer_capabilities_get_rtp.rs | 2 +- .../transfer_configuration_get_response.rs | 2 +- src/model/transfer_create_response.rs | 4 +- src/model/transfer_credit_funds_source.rs | 2 +- .../transfer_credit_usage_configuration.rs | 9 +- .../transfer_debit_usage_configuration.rs | 9 +- src/model/transfer_device.rs | 2 +- ...sfer_diligence_document_upload_response.rs | 2 +- src/model/transfer_diligence_status.rs | 17 + .../transfer_diligence_submit_response.rs | 2 +- src/model/transfer_document_purpose.rs | 9 + src/model/transfer_event.rs | 15 +- src/model/transfer_event_list_response.rs | 4 +- .../transfer_event_list_transfer_type.rs | 2 +- src/model/transfer_event_sync_response.rs | 4 +- src/model/transfer_event_type.rs | 97 + src/model/transfer_events_update_webhook.rs | 9 +- ...expected_sweep_settlement_schedule_item.rs | 2 +- src/model/transfer_failure.rs | 2 +- src/model/transfer_funding_account.rs | 2 +- src/model/transfer_get_response.rs | 4 +- .../transfer_intent_authorization_decision.rs | 13 + src/model/transfer_intent_create.rs | 28 +- src/model/transfer_intent_create_mode.rs | 13 + src/model/transfer_intent_create_network.rs | 17 + src/model/transfer_intent_create_response.rs | 4 +- src/model/transfer_intent_get.rs | 36 +- .../transfer_intent_get_failure_reason.rs | 2 +- src/model/transfer_intent_get_response.rs | 4 +- src/model/transfer_intent_status.rs | 15 + src/model/transfer_ledger_balance.rs | 2 +- src/model/transfer_ledger_deposit_response.rs | 4 +- .../transfer_ledger_distribute_response.rs | 2 +- src/model/transfer_ledger_get_response.rs | 8 +- ...ansfer_ledger_sweep_simulate_event_type.rs | 25 + .../transfer_ledger_withdraw_response.rs | 4 +- src/model/transfer_list_response.rs | 2 +- src/model/transfer_metadata.rs | 14 +- ...ransfer_metrics_get_authorization_usage.rs | 22 + src/model/transfer_metrics_get_response.rs | 9 +- .../transfer_metrics_get_return_rates.rs | 15 + ..._metrics_get_return_rates_over_interval.rs | 19 + .../transfer_migrate_account_response.rs | 2 +- src/model/transfer_network.rs | 21 + src/model/transfer_originator_address.rs | 2 +- .../transfer_originator_create_response.rs | 2 +- src/model/transfer_originator_diligence.rs | 4 +- ...ginator_funding_account_update_response.rs | 2 +- src/model/transfer_originator_get_response.rs | 4 +- .../transfer_originator_list_response.rs | 2 +- ...fer_platform_originator_create_response.rs | 12 + src/model/transfer_platform_person_address.rs | 24 + ...ransfer_platform_person_create_response.rs | 14 + .../transfer_platform_person_id_number.rs | 16 + src/model/transfer_platform_person_name.rs | 14 + src/model/transfer_platform_requirement.rs | 16 + ...ransfer_platform_requirement_submission.rs | 17 + ...er_platform_requirement_submit_response.rs | 12 + ...ansfer_platform_tos_acceptance_metadata.rs | 16 + .../transfer_questionnaire_create_response.rs | 2 +- .../transfer_recurring_cancel_response.rs | 2 +- .../transfer_recurring_create_response.rs | 17 +- src/model/transfer_recurring_get_response.rs | 4 +- src/model/transfer_recurring_list_response.rs | 2 +- src/model/transfer_recurring_network.rs | 11 + src/model/transfer_recurring_schedule.rs | 10 +- src/model/transfer_recurring_status.rs | 15 + src/model/transfer_refund.rs | 15 +- src/model/transfer_refund_cancel_response.rs | 2 +- src/model/transfer_refund_create_response.rs | 4 +- src/model/transfer_refund_failure.rs | 2 +- src/model/transfer_refund_get_response.rs | 4 +- src/model/transfer_refund_status.rs | 24 + src/model/transfer_repayment.rs | 2 +- src/model/transfer_repayment_list_response.rs | 2 +- src/model/transfer_repayment_return.rs | 2 +- ...transfer_repayment_return_list_response.rs | 2 +- src/model/transfer_schedule_interval_unit.rs | 9 + src/model/transfer_status.rs | 27 + src/model/transfer_sweep.rs | 15 +- src/model/transfer_sweep_get_response.rs | 4 +- src/model/transfer_sweep_list_response.rs | 2 +- src/model/transfer_sweep_status.rs | 2 +- src/model/transfer_test_clock.rs | 2 +- src/model/transfer_type.rs | 9 + src/model/transfer_user_address_in_request.rs | 2 +- .../transfer_user_address_in_response.rs | 2 +- src/model/transfer_user_in_request.rs | 2 +- .../transfer_user_in_request_deprecated.rs | 2 +- src/model/transfer_user_in_response.rs | 2 +- src/model/transfer_wire_details.rs | 13 + ...e_entity_screening_request_search_terms.rs | 8 +- ...dividual_screening_request_search_terms.rs | 6 +- src/model/user_account_identity.rs | 35 + src/model/user_account_identity_address.rs | 30 + src/model/user_account_identity_name.rs | 14 + src/model/user_account_item.rs | 16 + src/model/user_account_revoked_webhook.rs | 18 +- .../user_account_session_get_response.rs | 18 + src/model/user_address.rs | 8 +- src/model/user_create_response.rs | 2 +- src/model/user_data_overview.rs | 2 +- src/model/user_id_number.rs | 9 +- src/model/user_items_get_response.rs | 15 + src/model/user_permission_revoked_webhook.rs | 14 +- src/model/user_remove_response.rs | 12 + .../user_stated_income_source_category.rs | 27 + .../user_stated_income_source_frequency.rs | 15 + .../user_stated_income_source_pay_type.rs | 11 + .../user_third_party_token_create_response.rs | 14 + .../user_third_party_token_remove_response.rs | 14 + src/model/user_update_response.rs | 2 +- src/model/validation_source.rs | 2 +- src/model/validation_sources.rs | 2 +- src/model/verification_expired_webhook.rs | 10 +- src/model/verification_of_asset.rs | 4 +- src/model/verification_of_asset_response.rs | 2 +- src/model/verification_status.rs | 25 + src/model/verify_sms_details.rs | 16 + src/model/verify_sms_details_status.rs | 9 + src/model/w2.rs | 2 +- src/model/w2_box12.rs | 2 +- src/model/w2_box12_override.rs | 16 + src/model/w2_override.rs | 77 + src/model/w2_state_and_local_wages.rs | 2 +- .../w2_state_and_local_wages_override.rs | 31 + src/model/wallet.rs | 8 +- src/model/wallet_balance.rs | 2 +- src/model/wallet_create_response.rs | 9 +- src/model/wallet_get_response.rs | 9 +- src/model/wallet_iso_currency_code.rs | 9 + src/model/wallet_list_response.rs | 2 +- src/model/wallet_numbers.rs | 2 +- src/model/wallet_payment_scheme.rs | 2 +- src/model/wallet_status.rs | 17 + src/model/wallet_transaction.rs | 20 +- src/model/wallet_transaction_amount.rs | 7 +- src/model/wallet_transaction_counterparty.rs | 2 +- .../wallet_transaction_counterparty_bacs.rs | 2 +- ..._transaction_counterparty_international.rs | 2 +- ...wallet_transaction_counterparty_numbers.rs | 2 +- .../wallet_transaction_execute_response.rs | 7 +- .../wallet_transaction_failure_reason.rs | 20 + src/model/wallet_transaction_get_response.rs | 9 +- ...wallet_transaction_list_request_options.rs | 2 +- src/model/wallet_transaction_list_response.rs | 2 +- src/model/wallet_transaction_relation.rs | 25 + src/model/wallet_transaction_status.rs | 29 + ...allet_transaction_status_update_webhook.rs | 11 +- src/model/warning.rs | 5 +- src/model/watchlist_screening_audit_trail.rs | 9 +- src/model/watchlist_screening_document.rs | 9 +- .../watchlist_screening_document_type.rs | 57 + ...chlist_screening_entity_create_response.rs | 13 +- ...watchlist_screening_entity_get_response.rs | 13 +- ..._screening_entity_history_list_response.rs | 2 +- ...list_screening_entity_hit_list_response.rs | 2 +- ...atchlist_screening_entity_list_response.rs | 2 +- ...t_screening_entity_program_get_response.rs | 10 +- ..._screening_entity_program_list_response.rs | 2 +- ...screening_entity_review_create_response.rs | 4 +- ...t_screening_entity_review_list_response.rs | 2 +- ..._entity_update_request_resettable_field.rs | 7 + ...ty_update_request_resettable_field_list.rs | 6 + ...chlist_screening_entity_update_response.rs | 13 +- src/model/watchlist_screening_hit.rs | 13 +- .../watchlist_screening_hit_locations.rs | 2 +- src/model/watchlist_screening_hit_status.rs | 11 + src/model/watchlist_screening_individual.rs | 12 +- ...st_screening_individual_create_response.rs | 12 +- ...hlist_screening_individual_get_response.rs | 12 +- ...eening_individual_history_list_response.rs | 2 +- ..._screening_individual_hit_list_response.rs | 2 +- ...list_screening_individual_list_response.rs | 2 +- ...reening_individual_program_get_response.rs | 12 +- ...eening_individual_program_list_response.rs | 2 +- ...ening_individual_review_create_response.rs | 4 +- ...reening_individual_review_list_response.rs | 2 +- ...ividual_update_request_resettable_field.rs | 7 + ...al_update_request_resettable_field_list.rs | 6 + ...st_screening_individual_update_response.rs | 12 +- ...atchlist_screening_request_search_terms.rs | 6 +- src/model/watchlist_screening_review.rs | 4 +- src/model/watchlist_screening_search_terms.rs | 6 +- src/model/watchlist_screening_status.rs | 11 + src/model/weak_alias_determination.rs | 11 + src/model/webhook_environment_values.rs | 9 + src/model/webhook_type.rs | 19 + .../webhook_update_acknowledged_webhook.rs | 10 +- .../webhook_verification_key_get_response.rs | 2 +- src/request/accounts_balance_get.rs | 39 +- src/request/accounts_get.rs | 38 +- src/request/application_get.rs | 29 +- src/request/asset_report_audit_copy_create.rs | 41 +- src/request/asset_report_audit_copy_get.rs | 33 +- src/request/asset_report_audit_copy_remove.rs | 35 +- src/request/asset_report_create.rs | 44 +- src/request/asset_report_filter.rs | 46 +- src/request/asset_report_get.rs | 47 +- src/request/asset_report_pdf_get.rs | 40 +- src/request/asset_report_refresh.rs | 44 +- src/request/asset_report_remove.rs | 35 +- src/request/auth_get.rs | 32 +- src/request/bank_transfer_balance_get.rs | 34 +- src/request/bank_transfer_cancel.rs | 33 +- src/request/bank_transfer_create.rs | 97 +- src/request/bank_transfer_event_list.rs | 83 +- src/request/bank_transfer_event_sync.rs | 34 +- src/request/bank_transfer_get.rs | 33 +- src/request/bank_transfer_list.rs | 48 +- src/request/bank_transfer_migrate_account.rs | 48 +- src/request/bank_transfer_sweep_get.rs | 28 +- src/request/bank_transfer_sweep_list.rs | 42 +- src/request/base_report_get.rs | 29 - src/request/beacon_account_risk_evaluate.rs | 120 + src/request/beacon_duplicate_get.rs | 37 +- src/request/beacon_report_create.rs | 46 +- src/request/beacon_report_get.rs | 33 +- src/request/beacon_report_list.rs | 35 +- src/request/beacon_report_syndication_get.rs | 30 +- src/request/beacon_report_syndication_list.rs | 37 +- .../beacon_user_account_insights_get.rs | 53 + src/request/beacon_user_create.rs | 68 +- src/request/beacon_user_get.rs | 34 +- src/request/beacon_user_history_list.rs | 59 + src/request/beacon_user_review.rs | 49 +- src/request/beacon_user_update.rs | 74 +- src/request/categories_get.rs | 32 +- src/request/consent_events_get.rs | 41 + src/request/consumer_report_pdf_get.rs | 45 + src/request/cra_bank_income_create.rs | 94 + src/request/cra_bank_income_get.rs | 26 +- src/request/cra_base_report_create.rs | 72 + src/request/cra_base_report_get.rs | 43 + .../cra_check_report_base_report_get.rs | 80 + src/request/cra_check_report_create.rs | 82 + .../cra_check_report_income_insights_get.rs | 63 + .../cra_check_report_network_insights_get.rs | 65 + .../cra_check_report_partner_insights_get.rs | 76 + src/request/cra_check_report_pdf_get.rs | 71 + .../cra_loans_applications_register.rs | 47 + src/request/cra_loans_register.rs | 42 + src/request/cra_loans_unregister.rs | 42 + src/request/cra_loans_update.rs | 42 + src/request/cra_monitoring_insights_get.rs | 57 + .../cra_monitoring_insights_subscribe.rs | 50 + .../cra_monitoring_insights_unsubscribe.rs | 51 + src/request/cra_partner_insights_get.rs | 45 + src/request/create_payment_token.rs | 30 +- .../credit_asset_report_freddie_mac_get.rs | 35 +- src/request/credit_audit_copy_token_create.rs | 35 +- src/request/credit_audit_copy_token_update.rs | 42 +- src/request/credit_bank_employment_get.rs | 30 +- src/request/credit_bank_income_get.rs | 33 +- src/request/credit_bank_income_pdf_get.rs | 26 +- src/request/credit_bank_income_refresh.rs | 35 +- .../credit_bank_income_webhook_update.rs | 41 +- .../credit_bank_statements_uploads_get.rs | 47 +- src/request/credit_employment_get.rs | 28 +- src/request/credit_freddie_mac_reports_get.rs | 35 +- src/request/credit_payroll_income_get.rs | 41 +- ...it_payroll_income_parsing_config_update.rs | 42 +- src/request/credit_payroll_income_precheck.rs | 54 +- src/request/credit_payroll_income_refresh.rs | 35 +- .../credit_payroll_income_risk_signals_get.rs | 34 +- src/request/credit_relay_create.rs | 43 +- src/request/credit_relay_get.rs | 48 +- src/request/credit_relay_pdf_get.rs | 39 +- src/request/credit_relay_refresh.rs | 39 +- src/request/credit_relay_remove.rs | 28 +- .../credit_report_audit_copy_remove.rs | 35 +- src/request/credit_sessions_get.rs | 30 +- src/request/dashboard_user_get.rs | 33 +- src/request/dashboard_user_list.rs | 26 +- src/request/deposit_switch_alt_create.rs | 49 +- src/request/deposit_switch_create.rs | 48 +- src/request/deposit_switch_get.rs | 33 +- src/request/deposit_switch_token_create.rs | 36 +- src/request/employers_search.rs | 34 +- src/request/employment_verification_get.rs | 32 +- src/request/fdx_notifications.rs | 88 +- src/request/get_recipient.rs | 53 + src/request/get_recipients.rs | 34 + src/request/identity_documents_uploads_get.rs | 81 + src/request/identity_get.rs | 35 +- src/request/identity_match.rs | 39 +- src/request/identity_refresh.rs | 32 +- .../identity_verification_autofill_create.rs | 30 +- src/request/identity_verification_create.rs | 55 +- src/request/identity_verification_get.rs | 30 +- src/request/identity_verification_list.rs | 41 +- src/request/identity_verification_retry.rs | 65 +- src/request/income_verification_create.rs | 39 +- .../income_verification_documents_download.rs | 42 +- .../income_verification_paystubs_get.rs | 36 +- src/request/income_verification_precheck.rs | 64 +- .../income_verification_taxforms_get.rs | 36 +- src/request/institutions_get.rs | 48 +- src/request/institutions_get_by_id.rs | 48 +- src/request/institutions_search.rs | 62 +- src/request/investments_auth_get.rs | 33 +- src/request/investments_holdings_get.rs | 35 +- src/request/investments_refresh.rs | 32 +- src/request/investments_transactions_get.rs | 51 +- src/request/issues_get.rs | 40 + src/request/issues_search.rs | 70 + src/request/issues_subscribe.rs | 54 + src/request/item_access_token_invalidate.rs | 33 +- src/request/item_activity_list.rs | 30 +- src/request/item_application_list.rs | 24 +- src/request/item_application_scopes_update.rs | 50 +- src/request/item_application_unlink.rs | 41 +- src/request/item_create_public_token.rs | 36 +- src/request/item_get.rs | 25 +- src/request/item_import.rs | 39 +- src/request/item_public_token_exchange.rs | 32 +- src/request/item_remove.rs | 38 +- src/request/item_webhook_update.rs | 32 +- src/request/liabilities_get.rs | 35 +- src/request/link_delivery_create.rs | 33 +- src/request/link_delivery_get.rs | 28 +- .../link_oauth_correlation_id_exchange.rs | 33 +- src/request/link_profile_eligibility_check.rs | 58 + src/request/link_token_create.rs | 323 +- src/request/link_token_get.rs | 28 +- src/{request.rs => request/mod.rs} | 604 +- src/request/network_insights_report_get.rs | 49 + src/request/partner_customer_create.rs | 124 +- src/request/partner_customer_enable.rs | 38 +- src/request/partner_customer_get.rs | 36 +- ...partner_customer_oauth_institutions_get.rs | 36 +- src/request/partner_customer_remove.rs | 38 +- .../payment_initiation_consent_create.rs | 91 +- src/request/payment_initiation_consent_get.rs | 30 +- ...ment_initiation_consent_payment_execute.rs | 78 +- .../payment_initiation_consent_revoke.rs | 30 +- .../payment_initiation_payment_create.rs | 53 +- src/request/payment_initiation_payment_get.rs | 30 +- .../payment_initiation_payment_list.rs | 38 +- .../payment_initiation_payment_reverse.rs | 90 +- .../payment_initiation_recipient_create.rs | 48 +- .../payment_initiation_recipient_get.rs | 30 +- .../payment_initiation_recipient_list.rs | 34 +- src/request/payment_profile_create.rs | 34 +- src/request/payment_profile_get.rs | 28 +- src/request/payment_profile_remove.rs | 28 +- src/request/processor_account_get.rs | 36 +- .../processor_apex_processor_token_create.rs | 32 +- src/request/processor_auth_get.rs | 36 +- src/request/processor_balance_get.rs | 38 +- src/request/processor_bank_transfer_create.rs | 101 +- src/request/processor_identity_get.rs | 33 +- src/request/processor_identity_match.rs | 42 +- src/request/processor_liabilities_get.rs | 39 +- .../processor_signal_decision_report.rs | 77 +- src/request/processor_signal_evaluate.rs | 82 +- src/request/processor_signal_prepare.rs | 37 +- src/request/processor_signal_return_report.rs | 49 +- ...cessor_stripe_bank_account_token_create.rs | 37 +- src/request/processor_token_create.rs | 36 +- .../processor_token_permissions_get.rs | 35 +- .../processor_token_permissions_set.rs | 42 +- src/request/processor_token_webhook_update.rs | 39 +- src/request/processor_transactions_get.rs | 58 +- .../processor_transactions_recurring_get.rs | 48 +- src/request/processor_transactions_refresh.rs | 39 +- src/request/processor_transactions_sync.rs | 66 +- src/request/profile_get.rs | 46 + src/request/profile_network_status_get.rs | 48 + .../sandbox_bank_income_fire_webhook.rs | 47 +- .../sandbox_bank_transfer_fire_webhook.rs | 30 +- src/request/sandbox_bank_transfer_simulate.rs | 44 +- src/request/sandbox_income_fire_webhook.rs | 49 +- src/request/sandbox_item_fire_webhook.rs | 65 +- src/request/sandbox_item_reset_login.rs | 33 +- .../sandbox_item_set_verification_status.rs | 42 +- src/request/sandbox_oauth_select_accounts.rs | 33 +- .../sandbox_payment_profile_reset_login.rs | 34 +- src/request/sandbox_processor_token_create.rs | 38 +- src/request/sandbox_public_token_create.rs | 53 +- src/request/sandbox_transfer_fire_webhook.rs | 30 +- ...andbox_transfer_ledger_deposit_simulate.rs | 39 +- ...dbox_transfer_ledger_simulate_available.rs | 48 +- ...ndbox_transfer_ledger_withdraw_simulate.rs | 39 +- .../sandbox_transfer_refund_simulate.rs | 53 +- .../sandbox_transfer_repayment_simulate.rs | 34 +- src/request/sandbox_transfer_simulate.rs | 53 +- .../sandbox_transfer_sweep_simulate.rs | 40 +- .../sandbox_transfer_test_clock_advance.rs | 52 +- .../sandbox_transfer_test_clock_create.rs | 34 +- .../sandbox_transfer_test_clock_get.rs | 33 +- .../sandbox_transfer_test_clock_list.rs | 42 +- src/request/sandbox_user_reset_login.rs | 66 + src/request/signal_decision_report.rs | 64 +- src/request/signal_evaluate.rs | 81 +- src/request/signal_prepare.rs | 30 +- src/request/signal_return_report.rs | 36 +- src/request/statements_download.rs | 30 +- src/request/statements_list.rs | 28 +- src/request/statements_refresh.rs | 36 +- src/request/transactions_enhance.rs | 35 +- src/request/transactions_enrich.rs | 37 +- src/request/transactions_get.rs | 51 +- src/request/transactions_recurring_get.rs | 62 +- src/request/transactions_refresh.rs | 36 +- src/request/transactions_rules_create.rs | 41 +- src/request/transactions_rules_list.rs | 28 +- src/request/transactions_rules_remove.rs | 32 +- src/request/transactions_sync.rs | 59 +- src/request/transactions_user_insights_get.rs | 35 +- src/request/transfer_authorization_cancel.rs | 51 + src/request/transfer_authorization_create.rs | 158 +- src/request/transfer_balance_get.rs | 37 +- src/request/transfer_cancel.rs | 32 +- src/request/transfer_capabilities_get.rs | 38 +- src/request/transfer_configuration_get.rs | 30 +- src/request/transfer_create.rs | 109 +- .../transfer_diligence_document_upload.rs | 44 +- src/request/transfer_diligence_submit.rs | 39 +- src/request/transfer_event_list.rs | 84 +- src/request/transfer_event_sync.rs | 32 +- src/request/transfer_get.rs | 48 +- src/request/transfer_intent_create.rs | 90 +- src/request/transfer_intent_get.rs | 33 +- src/request/transfer_ledger_deposit.rs | 68 +- src/request/transfer_ledger_distribute.rs | 60 +- src/request/transfer_ledger_get.rs | 36 +- src/request/transfer_ledger_withdraw.rs | 68 +- src/request/transfer_list.rs | 51 +- src/request/transfer_metrics_get.rs | 26 +- src/request/transfer_migrate_account.rs | 48 +- src/request/transfer_originator_create.rs | 30 +- ...nsfer_originator_funding_account_update.rs | 40 +- src/request/transfer_originator_get.rs | 32 +- src/request/transfer_originator_list.rs | 34 +- .../transfer_platform_originator_create.rs | 71 + .../transfer_platform_person_create.rs | 134 + .../transfer_platform_requirement_submit.rs | 62 + src/request/transfer_questionnaire_create.rs | 36 +- src/request/transfer_recurring_cancel.rs | 30 +- src/request/transfer_recurring_create.rs | 102 +- src/request/transfer_recurring_get.rs | 28 +- src/request/transfer_recurring_list.rs | 47 +- src/request/transfer_refund_cancel.rs | 28 +- src/request/transfer_refund_create.rs | 43 +- src/request/transfer_refund_get.rs | 28 +- src/request/transfer_repayment_list.rs | 42 +- src/request/transfer_repayment_return_list.rs | 38 +- src/request/transfer_sweep_get.rs | 28 +- src/request/transfer_sweep_list.rs | 69 +- src/request/user_account_session_get.rs | 45 + src/request/user_create.rs | 57 +- src/request/user_items_get.rs | 43 + src/request/user_remove.rs | 41 + src/request/user_third_party_token_create.rs | 71 + src/request/user_third_party_token_remove.rs | 53 + src/request/user_update.rs | 35 +- src/request/wallet_create.rs | 36 +- src/request/wallet_get.rs | 25 +- src/request/wallet_list.rs | 44 +- src/request/wallet_transaction_execute.rs | 51 +- src/request/wallet_transaction_get.rs | 31 +- src/request/wallet_transaction_list.rs | 43 +- .../watchlist_screening_entity_create.rs | 35 +- src/request/watchlist_screening_entity_get.rs | 30 +- ...watchlist_screening_entity_history_list.rs | 32 +- .../watchlist_screening_entity_hit_list.rs | 34 +- .../watchlist_screening_entity_list.rs | 53 +- .../watchlist_screening_entity_program_get.rs | 30 +- ...watchlist_screening_entity_program_list.rs | 28 +- ...atchlist_screening_entity_review_create.rs | 46 +- .../watchlist_screening_entity_review_list.rs | 34 +- .../watchlist_screening_entity_update.rs | 70 +- .../watchlist_screening_individual_create.rs | 35 +- .../watchlist_screening_individual_get.rs | 30 +- ...hlist_screening_individual_history_list.rs | 32 +- ...watchlist_screening_individual_hit_list.rs | 32 +- .../watchlist_screening_individual_list.rs | 55 +- ...chlist_screening_individual_program_get.rs | 30 +- ...hlist_screening_individual_program_list.rs | 28 +- ...list_screening_individual_review_create.rs | 46 +- ...chlist_screening_individual_review_list.rs | 32 +- .../watchlist_screening_individual_update.rs | 72 +- src/request/webhook_verification_key_get.rs | 32 +- src/serde.rs | 2 +- 1928 files changed, 25904 insertions(+), 10923 deletions(-) create mode 100644 examples/beacon_account_risk_evaluate.rs create mode 100644 examples/beacon_user_account_insights_get.rs create mode 100644 examples/beacon_user_history_list.rs create mode 100644 examples/consent_events_get.rs create mode 100644 examples/consumer_report_pdf_get.rs create mode 100644 examples/cra_bank_income_create.rs create mode 100644 examples/cra_base_report_create.rs create mode 100644 examples/cra_base_report_get.rs create mode 100644 examples/cra_check_report_base_report_get.rs create mode 100644 examples/cra_check_report_create.rs create mode 100644 examples/cra_check_report_income_insights_get.rs create mode 100644 examples/cra_check_report_network_insights_get.rs create mode 100644 examples/cra_check_report_partner_insights_get.rs create mode 100644 examples/cra_check_report_pdf_get.rs create mode 100644 examples/cra_loans_applications_register.rs create mode 100644 examples/cra_loans_register.rs create mode 100644 examples/cra_loans_unregister.rs create mode 100644 examples/cra_loans_update.rs create mode 100644 examples/cra_monitoring_insights_get.rs create mode 100644 examples/cra_monitoring_insights_subscribe.rs create mode 100644 examples/cra_monitoring_insights_unsubscribe.rs create mode 100644 examples/cra_partner_insights_get.rs create mode 100644 examples/get_recipient.rs create mode 100644 examples/get_recipients.rs create mode 100644 examples/identity_documents_uploads_get.rs create mode 100644 examples/issues_get.rs create mode 100644 examples/issues_search.rs create mode 100644 examples/issues_subscribe.rs create mode 100644 examples/link_profile_eligibility_check.rs create mode 100644 examples/network_insights_report_get.rs create mode 100644 examples/profile_get.rs create mode 100644 examples/profile_network_status_get.rs create mode 100644 examples/sandbox_user_reset_login.rs create mode 100644 examples/transfer_authorization_cancel.rs create mode 100644 examples/transfer_platform_originator_create.rs create mode 100644 examples/transfer_platform_person_create.rs create mode 100644 examples/transfer_platform_requirement_submit.rs create mode 100644 examples/user_account_session_get.rs rename examples/{base_report_get.rs => user_items_get.rs} (75%) create mode 100644 examples/user_remove.rs create mode 100644 examples/user_third_party_token_create.rs create mode 100644 examples/user_third_party_token_remove.rs create mode 100644 src/model/account_holder_category.rs create mode 100644 src/model/account_identity_document_upload.rs create mode 100644 src/model/account_ids_with_updated_auth.rs create mode 100644 src/model/account_type.rs create mode 100644 src/model/account_verification_insights.rs create mode 100644 src/model/account_verification_insights_account_number_format.rs create mode 100644 src/model/account_verification_insights_network_status.rs create mode 100644 src/model/account_verification_insights_previous_returns.rs create mode 100644 src/model/ach_class.rs create mode 100644 src/model/action_state.rs create mode 100644 src/model/activity_type.rs create mode 100644 src/model/address_purpose_label.rs create mode 100644 src/model/asset_report_account_balance.rs create mode 100644 src/model/asset_report_add_ons.rs create mode 100644 src/model/asset_report_transaction_type.rs create mode 100644 src/model/asset_report_type.rs create mode 100644 src/model/asset_transaction_category_type.rs create mode 100644 src/model/asset_transaction_type.rs create mode 100644 src/model/asset_type.rs create mode 100644 src/model/auth_default_update_webhook.rs create mode 100644 src/model/auth_update_types.rs create mode 100644 src/model/balance_plus_attributes.rs create mode 100644 src/model/balance_plus_risk_level.rs create mode 100644 src/model/bank_income_complete_result.rs create mode 100644 src/model/bank_income_refresh_complete_result.rs create mode 100644 src/model/bank_transfer_event_type.rs create mode 100644 src/model/bank_transfer_network.rs create mode 100644 src/model/bank_transfer_status.rs create mode 100644 src/model/bank_transfer_type.rs create mode 100644 src/model/base_report_account_metadata.rs create mode 100644 src/model/base_report_attributes.rs create mode 100644 src/model/base_report_average_monthly_balances.rs create mode 100644 src/model/base_report_historical_balance.rs create mode 100644 src/model/base_report_transaction_type.rs create mode 100644 src/model/base_report_warning_code.rs create mode 100644 src/model/beacon_account_risk_attributes.rs create mode 100644 src/model/beacon_account_risk_evaluate_account.rs create mode 100644 src/model/beacon_account_risk_evaluate_account_attributes.rs create mode 100644 src/model/beacon_account_risk_evaluate_evaluation_reason.rs create mode 100644 src/model/beacon_account_risk_evaluate_request_options.rs create mode 100644 src/model/beacon_account_risk_evaluate_response.rs create mode 100644 src/model/beacon_audit_trail_source.rs create mode 100644 src/model/beacon_bank_account_insights.rs create mode 100644 src/model/beacon_bank_accounts.rs create mode 100644 src/model/beacon_match_summary_code.rs create mode 100644 src/model/beacon_report_create_type.rs create mode 100644 src/model/beacon_report_type.rs create mode 100644 src/model/beacon_syndicated_report_depository_account_match_analysis.rs create mode 100644 src/model/beacon_user.rs create mode 100644 src/model/beacon_user_account_insights_get_response.rs create mode 100644 src/model/beacon_user_depository_account.rs create mode 100644 src/model/beacon_user_history_list_response.rs create mode 100644 src/model/beacon_user_request_depository_account.rs create mode 100644 src/model/beacon_user_status.rs create mode 100644 src/model/cashflow_attributes_version.rs create mode 100644 src/model/consent_event.rs create mode 100644 src/model/consent_event_code.rs create mode 100644 src/model/consent_event_initiator.rs create mode 100644 src/model/consent_event_type.rs create mode 100644 src/model/consent_events_get_response.rs create mode 100644 src/model/consented_account.rs create mode 100644 src/model/consumer_dispute.rs create mode 100644 src/model/consumer_dispute_category.rs create mode 100644 src/model/consumer_report_permissible_purpose.rs create mode 100644 src/model/counterparty_type.rs create mode 100644 src/model/country_code.rs create mode 100644 src/model/cra_bank_income_account_metadata.rs create mode 100644 src/model/cra_bank_income_bonus_type.rs create mode 100644 src/model/cra_bank_income_complete_result.rs create mode 100644 src/model/cra_bank_income_create_response.rs create mode 100644 src/model/cra_bank_income_error_webhook.rs create mode 100644 src/model/cra_bank_income_warning_code.rs create mode 100644 src/model/cra_base_report_create_response.rs rename src/model/{base_report_get_response.rs => cra_base_report_get_response.rs} (72%) create mode 100644 src/model/cra_check_report_base_report_get_response.rs create mode 100644 src/model/cra_check_report_create_response.rs create mode 100644 src/model/cra_check_report_failed_webhook.rs create mode 100644 src/model/cra_check_report_income_insights_get_response.rs create mode 100644 src/model/cra_check_report_network_insights_get_response.rs create mode 100644 src/model/cra_check_report_partner_insights_get_options.rs create mode 100644 src/model/cra_check_report_partner_insights_get_response.rs create mode 100644 src/model/cra_check_report_ready_webhook.rs create mode 100644 src/model/cra_income_insights.rs create mode 100644 src/model/cra_loan_application.rs create mode 100644 src/model/cra_loan_application_decision.rs create mode 100644 src/model/cra_loan_closed_status.rs create mode 100644 src/model/cra_loan_opened_status.rs create mode 100644 src/model/cra_loan_payment_history.rs create mode 100644 src/model/cra_loan_payment_schedule.rs create mode 100644 src/model/cra_loan_register.rs create mode 100644 src/model/cra_loan_register_application.rs create mode 100644 src/model/cra_loan_status.rs create mode 100644 src/model/cra_loan_status_history_update.rs create mode 100644 src/model/cra_loan_type.rs create mode 100644 src/model/cra_loan_unregister.rs create mode 100644 src/model/cra_loan_unregister_response.rs create mode 100644 src/model/cra_loan_update.rs create mode 100644 src/model/cra_loans_applications_register_response.rs create mode 100644 src/model/cra_loans_register_response.rs create mode 100644 src/model/cra_loans_update_response.rs create mode 100644 src/model/cra_monitoring_insights_get_response.rs create mode 100644 src/model/cra_monitoring_insights_item.rs create mode 100644 src/model/cra_monitoring_insights_subscribe_response.rs create mode 100644 src/model/cra_monitoring_insights_unsubscribe_response.rs create mode 100644 src/model/cra_network_insights_item.rs create mode 100644 src/model/cra_network_insights_report.rs create mode 100644 src/model/cra_partner_insights.rs create mode 100644 src/model/cra_partner_insights_complete_webhook.rs create mode 100644 src/model/cra_partner_insights_error_webhook.rs create mode 100644 src/model/cra_partner_insights_get_response.rs create mode 100644 src/model/cra_partner_insights_item.rs create mode 100644 src/model/cra_partner_insights_item_account.rs create mode 100644 src/model/cra_partner_insights_item_account_metadata.rs create mode 100644 src/model/cra_partner_insights_prism.rs create mode 100644 src/model/cra_pdf_add_ons.rs create mode 100644 src/model/cra_prediction_interval.rs create mode 100644 src/model/credit_account_subtype.rs create mode 100644 src/model/credit_account_subtypes.rs create mode 100644 src/model/credit_ach_class.rs create mode 100644 src/model/credit_bank_employment_warning_type.rs create mode 100644 src/model/credit_bank_income_account_type.rs create mode 100644 src/model/credit_bank_income_category.rs create mode 100644 src/model/credit_bank_income_error_type.rs create mode 100644 src/model/credit_bank_income_pay_frequency.rs create mode 100644 src/model/credit_bank_income_warning_code.rs create mode 100644 src/model/credit_bank_income_warning_type.rs create mode 100644 src/model/credit_bank_statements_uploads_get_request_options.rs create mode 100644 src/model/credit_pay_stub_pay_basis_type.rs create mode 100644 src/model/credit_payroll_income_get_request_options.rs create mode 100644 src/model/credit_session_bank_employment_status.rs create mode 100644 src/model/credit_session_bank_income_status.rs create mode 100644 src/model/dashboard_user_status.rs create mode 100644 src/model/data_sources.rs create mode 100644 src/model/depository_account_subtype.rs create mode 100644 src/model/depository_account_subtypes.rs create mode 100644 src/model/doc_type.rs create mode 100644 src/model/document_authenticity_match_code.rs create mode 100644 src/model/document_date_of_birth_match_code.rs create mode 100644 src/model/document_name_match_code.rs create mode 100644 src/model/document_status.rs create mode 100644 src/model/employment_source_type.rs create mode 100644 src/model/enrich_transaction_direction.rs create mode 100644 src/model/entity_document_type.rs create mode 100644 src/model/entity_watchlist_code.rs create mode 100644 src/model/expiration_date.rs create mode 100644 src/model/extended_recipient_metadata.rs create mode 100644 src/model/fdx_content_types.rs create mode 100644 src/model/fdx_hateoas_link_action.rs create mode 100644 src/model/fdx_notification_category.rs create mode 100644 src/model/fdx_notification_payload_id_type.rs create mode 100644 src/model/fdx_notification_priority.rs create mode 100644 src/model/fdx_notification_severity.rs create mode 100644 src/model/fdx_notification_type.rs create mode 100644 src/model/fdx_party_registry.rs create mode 100644 src/model/fdx_party_type.rs create mode 100644 src/model/fdx_recipient_metadata.rs create mode 100644 src/model/forecasted_monthly_income.rs create mode 100644 src/model/form1099_type.rs create mode 100644 src/model/get_recipient_response.rs create mode 100644 src/model/get_recipients_response.rs create mode 100644 src/model/hidden_match_summary_code.rs create mode 100644 src/model/historical_annual_income.rs create mode 100644 src/model/hosted_link_delivery_method.rs create mode 100644 src/model/id_number_type.rs delete mode 100644 src/model/identity_document_metadata.rs create mode 100644 src/model/identity_document_upload.rs create mode 100644 src/model/identity_document_upload_metadata.rs create mode 100644 src/model/identity_document_upload_risk_insights.rs create mode 100644 src/model/identity_document_upload_risk_signal.rs create mode 100644 src/model/identity_document_upload_risk_summary.rs create mode 100644 src/model/identity_documents_uploads_get_request_options.rs create mode 100644 src/model/identity_documents_uploads_get_response.rs create mode 100644 src/model/identity_update_types.rs create mode 100644 src/model/identity_verification_autofill_status.rs create mode 100644 src/model/identity_verification_document_name_response.rs create mode 100644 src/model/identity_verification_status.rs create mode 100644 src/model/identity_verification_step_status.rs create mode 100644 src/model/image_quality.rs create mode 100644 src/model/income_sources_counts.rs create mode 100644 src/model/income_verification_doc_parsing_config.rs create mode 100644 src/model/income_verification_payroll_flow_type.rs create mode 100644 src/model/income_verification_precheck_confidence.rs create mode 100644 src/model/income_verification_source_type.rs create mode 100644 src/model/individual_watchlist_code.rs create mode 100644 src/model/investment_account_subtype.rs create mode 100644 src/model/investment_account_subtypes.rs create mode 100644 src/model/investment_transaction_subtype.rs create mode 100644 src/model/investment_transaction_type.rs create mode 100644 src/model/investments_auth_data_sources.rs create mode 100644 src/model/iso_currency_code.rs create mode 100644 src/model/issue.rs create mode 100644 src/model/issue_resolved_webhook.rs create mode 100644 src/model/issues_get_response.rs create mode 100644 src/model/issues_search_response.rs create mode 100644 src/model/issues_status.rs create mode 100644 src/model/issues_subscribe_response.rs create mode 100644 src/model/issuing_country.rs create mode 100644 src/model/item_add_result_webhook.rs create mode 100644 src/model/item_create_authentication.rs create mode 100644 src/model/item_with_consent_fields.rs create mode 100644 src/model/kyc_check_details_international_address.rs create mode 100644 src/model/link_delivery_delivery_method.rs create mode 100644 src/model/link_delivery_session_status.rs create mode 100644 src/model/link_delivery_verification_status.rs create mode 100644 src/model/link_delivery_webhook_callback_type.rs create mode 100644 src/model/link_delivery_webhook_communication_method.rs create mode 100644 src/model/link_delivery_webhook_delivery_status.rs create mode 100644 src/model/link_event_metadata.rs create mode 100644 src/model/link_event_name.rs create mode 100644 src/model/link_profile_eligibility_check_response.rs create mode 100644 src/model/link_profile_eligibility_check_user.rs create mode 100644 src/model/link_session_bank_income_result.rs create mode 100644 src/model/link_session_cra_item_add_result.rs create mode 100644 src/model/link_session_exit_deprecated.rs create mode 100644 src/model/link_session_item_add_result.rs create mode 100644 src/model/link_session_payroll_income_result.rs create mode 100644 src/model/link_session_results.rs create mode 100644 src/model/link_session_success_metadata_transfer_status.rs create mode 100644 src/model/link_token_create_identity.rs create mode 100644 src/model/link_token_create_request_cra_options.rs create mode 100644 src/model/link_token_create_request_cra_options_base_report.rs create mode 100644 src/model/link_token_create_request_cra_options_cashflow_insights.rs create mode 100644 src/model/link_token_create_request_cra_options_partner_insights.rs create mode 100644 src/model/link_token_create_request_credit_partner_insights.rs create mode 100644 src/model/link_token_create_request_payment_configuration.rs create mode 100644 src/model/loan_account_subtype.rs create mode 100644 src/model/loan_account_subtypes.rs create mode 100644 src/model/loan_identifier_type.rs create mode 100644 src/model/loan_payments_counts.rs create mode 100644 src/model/loan_payments_merchant_counts.rs create mode 100644 src/model/match_summary_code.rs rename src/{model.rs => model/mod.rs} (68%) create mode 100644 src/model/monitoring_consumer_report_permissible_purpose.rs create mode 100644 src/model/monitoring_income_insights.rs create mode 100644 src/model/monitoring_income_source.rs create mode 100644 src/model/monitoring_insights.rs create mode 100644 src/model/monitoring_insights_item_status.rs create mode 100644 src/model/monitoring_insights_status.rs create mode 100644 src/model/monitoring_insights_webhook.rs create mode 100644 src/model/monitoring_item_status_code.rs create mode 100644 src/model/monitoring_loan_insights.rs create mode 100644 src/model/network_insights_item.rs create mode 100644 src/model/network_insights_report.rs create mode 100644 src/model/network_insights_report_get_response.rs create mode 100644 src/model/network_insights_schema.rs create mode 100644 src/model/omittable_transfer_type.rs create mode 100644 src/model/originator_expected_transfer_frequency.rs create mode 100644 src/model/other_account_subtype.rs create mode 100644 src/model/other_account_subtypes.rs create mode 100644 src/model/override_account_type.rs create mode 100644 src/model/partner_end_customer_flowdown_status.rs create mode 100644 src/model/partner_end_customer_o_auth_institution_application_status.rs create mode 100644 src/model/partner_end_customer_o_auth_status_updated_values.rs create mode 100644 src/model/partner_end_customer_questionnaire_status.rs create mode 100644 src/model/partner_end_customer_status.rs create mode 100644 src/model/party_role_type.rs create mode 100644 src/model/payment_amount_currency.rs create mode 100644 src/model/payment_channel.rs create mode 100644 src/model/payment_consent_periodic_alignment.rs create mode 100644 src/model/payment_consent_periodic_interval.rs create mode 100644 src/model/payment_initiation_consent_payer_details.rs create mode 100644 src/model/payment_initiation_consent_payer_numbers.rs create mode 100644 src/model/payment_initiation_consent_processing_mode.rs create mode 100644 src/model/payment_initiation_consent_scope.rs create mode 100644 src/model/payment_initiation_consent_status.rs create mode 100644 src/model/payment_initiation_consent_type.rs create mode 100644 src/model/payment_initiation_payment_create_status.rs create mode 100644 src/model/payment_initiation_payment_status.rs create mode 100644 src/model/payment_profile_status.rs create mode 100644 src/model/payment_schedule_interval.rs create mode 100644 src/model/paystub_override_deductions.rs create mode 100644 src/model/paystub_override_deductions_breakdown.rs create mode 100644 src/model/paystub_override_deductions_total.rs create mode 100644 src/model/paystub_override_earnings.rs create mode 100644 src/model/paystub_override_earnings_breakdown.rs create mode 100644 src/model/paystub_override_earnings_total.rs create mode 100644 src/model/paystub_override_employer_address.rs create mode 100644 src/model/paystub_override_net_pay.rs rename src/model/{identity_document.rs => paystub_override_taxpayer_id.rs} (52%) create mode 100644 src/model/pending_disconnect_webhook.rs create mode 100644 src/model/pending_disconnect_webhook_reason.rs create mode 100644 src/model/phone_type.rs create mode 100644 src/model/physical_document_category.rs create mode 100644 src/model/plaid_error_type.rs create mode 100644 src/model/po_box_status.rs create mode 100644 src/model/prism_cash_score.rs create mode 100644 src/model/prism_cash_score_metadata.rs create mode 100644 src/model/prism_cash_score_version.rs create mode 100644 src/model/prism_first_detect.rs create mode 100644 src/model/prism_first_detect_version.rs create mode 100644 src/model/prism_insights.rs create mode 100644 src/model/prism_insights_result.rs create mode 100644 src/model/prism_insights_version.rs create mode 100644 src/model/prism_product.rs create mode 100644 src/model/prism_versions.rs create mode 100644 src/model/products.rs create mode 100644 src/model/profile_get_response.rs create mode 100644 src/model/profile_identity.rs create mode 100644 src/model/profile_identity_address.rs create mode 100644 src/model/profile_identity_name.rs create mode 100644 src/model/profile_item.rs create mode 100644 src/model/profile_network_status_get_network_status.rs create mode 100644 src/model/profile_network_status_get_response.rs create mode 100644 src/model/profile_network_status_get_user.rs create mode 100644 src/model/program_name_sensitivity.rs create mode 100644 src/model/proxy_type.rs create mode 100644 src/model/recurring_transaction_frequency.rs create mode 100644 src/model/report_type.rs create mode 100644 src/model/risk_check_behavior_bot_detected_label.rs create mode 100644 src/model/risk_check_behavior_fraud_ring_detected_label.rs create mode 100644 src/model/risk_check_behavior_user_interactions_label.rs create mode 100644 src/model/risk_check_email_domain_is_custom.rs create mode 100644 src/model/risk_check_email_domain_is_disposable.rs create mode 100644 src/model/risk_check_email_domain_is_free_provider.rs create mode 100644 src/model/risk_check_email_is_deliverable_status.rs create mode 100644 src/model/risk_check_email_top_level_domain_is_suspicious.rs create mode 100644 src/model/risk_check_linked_service.rs create mode 100644 src/model/risk_reason.rs create mode 100644 src/model/risk_signal_document_status.rs create mode 100644 src/model/risk_signal_document_type.rs create mode 100644 src/model/risk_signal_file_type.rs create mode 100644 src/model/ruleset.rs create mode 100644 src/model/sandbox_bank_income_webhook_fire_request_webhook_code.rs create mode 100644 src/model/sandbox_income_webhook_fire_request_webhook_code.rs create mode 100644 src/model/sandbox_public_token_create_request_options_statements.rs create mode 100644 src/model/sandbox_user_reset_login_response.rs create mode 100644 src/model/scopes_context.rs create mode 100644 src/model/selfie_analysis_document_comparison.rs create mode 100644 src/model/selfie_analysis_facial_analysis.rs create mode 100644 src/model/selfie_analysis_facial_analysis_outcome.rs create mode 100644 src/model/selfie_analysis_liveness_check.rs create mode 100644 src/model/selfie_check_status.rs create mode 100644 src/model/selfie_status.rs create mode 100644 src/model/service_product_fulfillment_identifier.rs create mode 100644 src/model/signal_decision_outcome.rs create mode 100644 src/model/signal_payment_method.rs create mode 100644 src/model/sms_verification.rs create mode 100644 src/model/sms_verification_status.rs create mode 100644 src/model/source.rs create mode 100644 src/model/statements_refresh_complete_result.rs create mode 100644 src/model/strategy.rs create mode 100644 src/model/sweep_trigger.rs create mode 100644 src/model/taxpayer_identifier_type.rs create mode 100644 src/model/total_inflow_amount.rs create mode 100644 src/model/total_inflow_amount30_d.rs create mode 100644 src/model/total_inflow_amount60_d.rs create mode 100644 src/model/total_inflow_amount90_d.rs create mode 100644 src/model/total_monthly_income_insights.rs create mode 100644 src/model/total_outflow_amount.rs create mode 100644 src/model/total_outflow_amount30_d.rs create mode 100644 src/model/total_outflow_amount60_d.rs create mode 100644 src/model/total_outflow_amount90_d.rs create mode 100644 src/model/transaction_stream_status.rs create mode 100644 src/model/transactions_rule_field.rs create mode 100644 src/model/transactions_rule_type.rs create mode 100644 src/model/transactions_update_status.rs create mode 100644 src/model/transfer_ach_network.rs create mode 100644 src/model/transfer_authorization_cancel_response.rs create mode 100644 src/model/transfer_authorization_decision.rs create mode 100644 src/model/transfer_authorization_guarantee_decision_rationale_code.rs create mode 100644 src/model/transfer_authorization_risk_level.rs create mode 100644 src/model/transfer_balance_type.rs create mode 100644 src/model/transfer_diligence_status.rs create mode 100644 src/model/transfer_document_purpose.rs create mode 100644 src/model/transfer_event_type.rs create mode 100644 src/model/transfer_intent_authorization_decision.rs create mode 100644 src/model/transfer_intent_create_mode.rs create mode 100644 src/model/transfer_intent_create_network.rs create mode 100644 src/model/transfer_intent_status.rs create mode 100644 src/model/transfer_ledger_sweep_simulate_event_type.rs create mode 100644 src/model/transfer_metrics_get_authorization_usage.rs create mode 100644 src/model/transfer_metrics_get_return_rates.rs create mode 100644 src/model/transfer_metrics_get_return_rates_over_interval.rs create mode 100644 src/model/transfer_network.rs create mode 100644 src/model/transfer_platform_originator_create_response.rs create mode 100644 src/model/transfer_platform_person_address.rs create mode 100644 src/model/transfer_platform_person_create_response.rs create mode 100644 src/model/transfer_platform_person_id_number.rs create mode 100644 src/model/transfer_platform_person_name.rs create mode 100644 src/model/transfer_platform_requirement.rs create mode 100644 src/model/transfer_platform_requirement_submission.rs create mode 100644 src/model/transfer_platform_requirement_submit_response.rs create mode 100644 src/model/transfer_platform_tos_acceptance_metadata.rs create mode 100644 src/model/transfer_recurring_network.rs create mode 100644 src/model/transfer_recurring_status.rs create mode 100644 src/model/transfer_refund_status.rs create mode 100644 src/model/transfer_schedule_interval_unit.rs create mode 100644 src/model/transfer_status.rs create mode 100644 src/model/transfer_type.rs create mode 100644 src/model/transfer_wire_details.rs create mode 100644 src/model/user_account_identity.rs create mode 100644 src/model/user_account_identity_address.rs create mode 100644 src/model/user_account_identity_name.rs create mode 100644 src/model/user_account_item.rs create mode 100644 src/model/user_account_session_get_response.rs create mode 100644 src/model/user_items_get_response.rs create mode 100644 src/model/user_remove_response.rs create mode 100644 src/model/user_stated_income_source_category.rs create mode 100644 src/model/user_stated_income_source_frequency.rs create mode 100644 src/model/user_stated_income_source_pay_type.rs create mode 100644 src/model/user_third_party_token_create_response.rs create mode 100644 src/model/user_third_party_token_remove_response.rs create mode 100644 src/model/verification_status.rs create mode 100644 src/model/verify_sms_details.rs create mode 100644 src/model/verify_sms_details_status.rs create mode 100644 src/model/w2_box12_override.rs create mode 100644 src/model/w2_override.rs create mode 100644 src/model/w2_state_and_local_wages_override.rs create mode 100644 src/model/wallet_iso_currency_code.rs create mode 100644 src/model/wallet_status.rs create mode 100644 src/model/wallet_transaction_failure_reason.rs create mode 100644 src/model/wallet_transaction_relation.rs create mode 100644 src/model/wallet_transaction_status.rs create mode 100644 src/model/watchlist_screening_document_type.rs create mode 100644 src/model/watchlist_screening_entity_update_request_resettable_field.rs create mode 100644 src/model/watchlist_screening_entity_update_request_resettable_field_list.rs create mode 100644 src/model/watchlist_screening_hit_status.rs create mode 100644 src/model/watchlist_screening_individual_update_request_resettable_field.rs create mode 100644 src/model/watchlist_screening_individual_update_request_resettable_field_list.rs create mode 100644 src/model/watchlist_screening_status.rs create mode 100644 src/model/weak_alias_determination.rs create mode 100644 src/model/webhook_environment_values.rs create mode 100644 src/model/webhook_type.rs delete mode 100644 src/request/base_report_get.rs create mode 100644 src/request/beacon_account_risk_evaluate.rs create mode 100644 src/request/beacon_user_account_insights_get.rs create mode 100644 src/request/beacon_user_history_list.rs create mode 100644 src/request/consent_events_get.rs create mode 100644 src/request/consumer_report_pdf_get.rs create mode 100644 src/request/cra_bank_income_create.rs create mode 100644 src/request/cra_base_report_create.rs create mode 100644 src/request/cra_base_report_get.rs create mode 100644 src/request/cra_check_report_base_report_get.rs create mode 100644 src/request/cra_check_report_create.rs create mode 100644 src/request/cra_check_report_income_insights_get.rs create mode 100644 src/request/cra_check_report_network_insights_get.rs create mode 100644 src/request/cra_check_report_partner_insights_get.rs create mode 100644 src/request/cra_check_report_pdf_get.rs create mode 100644 src/request/cra_loans_applications_register.rs create mode 100644 src/request/cra_loans_register.rs create mode 100644 src/request/cra_loans_unregister.rs create mode 100644 src/request/cra_loans_update.rs create mode 100644 src/request/cra_monitoring_insights_get.rs create mode 100644 src/request/cra_monitoring_insights_subscribe.rs create mode 100644 src/request/cra_monitoring_insights_unsubscribe.rs create mode 100644 src/request/cra_partner_insights_get.rs create mode 100644 src/request/get_recipient.rs create mode 100644 src/request/get_recipients.rs create mode 100644 src/request/identity_documents_uploads_get.rs create mode 100644 src/request/issues_get.rs create mode 100644 src/request/issues_search.rs create mode 100644 src/request/issues_subscribe.rs create mode 100644 src/request/link_profile_eligibility_check.rs rename src/{request.rs => request/mod.rs} (82%) create mode 100644 src/request/network_insights_report_get.rs create mode 100644 src/request/profile_get.rs create mode 100644 src/request/profile_network_status_get.rs create mode 100644 src/request/sandbox_user_reset_login.rs create mode 100644 src/request/transfer_authorization_cancel.rs create mode 100644 src/request/transfer_platform_originator_create.rs create mode 100644 src/request/transfer_platform_person_create.rs create mode 100644 src/request/transfer_platform_requirement_submit.rs create mode 100644 src/request/user_account_session_get.rs create mode 100644 src/request/user_items_get.rs create mode 100644 src/request/user_remove.rs create mode 100644 src/request/user_third_party_token_create.rs create mode 100644 src/request/user_third_party_token_remove.rs diff --git a/examples/accounts_balance_get.rs b/examples/accounts_balance_get.rs index 7dbbb888..595ba741 100644 --- a/examples/accounts_balance_get.rs +++ b/examples/accounts_balance_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,12 +12,13 @@ async fn main() { min_last_updated_datetime: Some(chrono::Utc::now()), }) .payment_details(AccountsBalanceGetRequestPaymentDetails { - account_id: Some("your account id".to_owned()), - amount: Some(1.0), + account_id: "your account id".to_owned(), + amount: 1.0, balance_threshold_percentage: Some(1), - client_transaction_id: Some("your client transaction id".to_owned()), + client_transaction_id: "your client transaction id".to_owned(), + requires_real_time_balance_refresh: Some(true), }) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/accounts_get.rs b/examples/accounts_get.rs index 56df0084..6d2bc7ce 100644 --- a/examples/accounts_get.rs +++ b/examples/accounts_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/application_get.rs b/examples/application_get.rs index 30da71ac..a856c157 100644 --- a/examples/application_get.rs +++ b/examples/application_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let application_id = "your application id"; let response = client.application_get(application_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/asset_report_audit_copy_create.rs b/examples/asset_report_audit_copy_create.rs index 774a63b0..91062e02 100644 --- a/examples/asset_report_audit_copy_create.rs +++ b/examples/asset_report_audit_copy_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/asset_report_audit_copy_get.rs b/examples/asset_report_audit_copy_get.rs index 6402f3b5..2dbafee4 100644 --- a/examples/asset_report_audit_copy_get.rs +++ b/examples/asset_report_audit_copy_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let audit_copy_token = "your audit copy token"; let response = client.asset_report_audit_copy_get(audit_copy_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/asset_report_audit_copy_remove.rs b/examples/asset_report_audit_copy_remove.rs index 3005367d..157d5690 100644 --- a/examples/asset_report_audit_copy_remove.rs +++ b/examples/asset_report_audit_copy_remove.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/asset_report_create.rs b/examples/asset_report_create.rs index 7d41d1d9..98f0ef0a 100644 --- a/examples/asset_report_create.rs +++ b/examples/asset_report_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -9,10 +9,11 @@ async fn main() { .asset_report_create(days_requested) .access_tokens(&["your access tokens"]) .options(AssetReportCreateRequestOptions { - add_ons: Some(vec!["your add ons".to_owned()]), + add_ons: Some(vec![AssetReportAddOns::Investments]), client_report_id: Some("your client report id".to_owned()), include_fast_report: Some(true), products: Some(vec!["your products".to_owned()]), + require_all_items: Some(true), user: Some(AssetReportUser { client_user_id: Some("your client user id".to_owned()), email: Some("your email".to_owned()), @@ -27,4 +28,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/asset_report_filter.rs b/examples/asset_report_filter.rs index 99ab3ad2..cd86a91f 100644 --- a/examples/asset_report_filter.rs +++ b/examples/asset_report_filter.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/asset_report_get.rs b/examples/asset_report_get.rs index da71425c..4b7d4cf4 100644 --- a/examples/asset_report_get.rs +++ b/examples/asset_report_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -16,4 +16,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/asset_report_pdf_get.rs b/examples/asset_report_pdf_get.rs index b1513926..e3ea8783 100644 --- a/examples/asset_report_pdf_get.rs +++ b/examples/asset_report_pdf_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/asset_report_refresh.rs b/examples/asset_report_refresh.rs index cecd1299..cf66b04c 100644 --- a/examples/asset_report_refresh.rs +++ b/examples/asset_report_refresh.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -24,4 +24,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/asset_report_remove.rs b/examples/asset_report_remove.rs index 44d063b9..23bf6099 100644 --- a/examples/asset_report_remove.rs +++ b/examples/asset_report_remove.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let asset_report_token = "your asset report token"; let response = client.asset_report_remove(asset_report_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/auth_get.rs b/examples/auth_get.rs index 05ae9a7d..875c3aea 100644 --- a/examples/auth_get.rs +++ b/examples/auth_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_balance_get.rs b/examples/bank_transfer_balance_get.rs index f3e26c08..91ad9c72 100644 --- a/examples/bank_transfer_balance_get.rs +++ b/examples/bank_transfer_balance_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_cancel.rs b/examples/bank_transfer_cancel.rs index 1b4fe355..acfb58dd 100644 --- a/examples/bank_transfer_cancel.rs +++ b/examples/bank_transfer_cancel.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let bank_transfer_id = "your bank transfer id"; let response = client.bank_transfer_cancel(bank_transfer_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_create.rs b/examples/bank_transfer_create.rs index 23e3e873..ee895489 100644 --- a/examples/bank_transfer_create.rs +++ b/examples/bank_transfer_create.rs @@ -1,32 +1,40 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::BankTransferCreateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = BankTransferCreateRequired { - access_token: "your access token", - account_id: "your account id", - amount: "your amount", - description: "your description", - idempotency_key: "your idempotency key", - iso_currency_code: "your iso currency code", - network: "your network", - type_: "your type", - user: BankTransferUser { - email_address: Some("your email address".to_owned()), - legal_name: "your legal name".to_owned(), - routing_number: Some("your routing number".to_owned()), - }, + let access_token = "your access token"; + let account_id = "your account id"; + let amount = "your amount"; + let description = "your description"; + let idempotency_key = "your idempotency key"; + let iso_currency_code = "your iso currency code"; + let network = BankTransferNetwork::Ach; + let type_ = BankTransferType::Debit; + let user = BankTransferUser { + email_address: Some("your email address".to_owned()), + legal_name: "your legal name".to_owned(), + routing_number: Some("your routing number".to_owned()), }; let response = client - .bank_transfer_create(args) - .ach_class("your ach class") + .bank_transfer_create(BankTransferCreateRequired { + access_token, + account_id, + amount, + description, + idempotency_key, + iso_currency_code, + network, + type_, + user, + }) + .ach_class(AchClass::Ccd) .custom_tag("your custom tag") - .metadata(BankTransferMetadata {}) + .metadata("your bank transfer metadata") .origination_account_id("your origination account id") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_event_list.rs b/examples/bank_transfer_event_list.rs index 8038b4a2..47c486ed 100644 --- a/examples/bank_transfer_event_list.rs +++ b/examples/bank_transfer_event_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,11 +12,11 @@ async fn main() { .count(1) .direction(BankTransferEventListDirection(serde_json::json!({}))) .end_date(chrono::Utc::now()) - .event_types(&["your event types"]) + .event_types(vec![BankTransferEventType::Pending]) .offset(1) .origination_account_id("your origination account id") .start_date(chrono::Utc::now()) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_event_sync.rs b/examples/bank_transfer_event_sync.rs index 8967ef1a..56a413ac 100644 --- a/examples/bank_transfer_event_sync.rs +++ b/examples/bank_transfer_event_sync.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let after_id = 1; let response = client.bank_transfer_event_sync(after_id).count(1).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_get.rs b/examples/bank_transfer_get.rs index 0dbb179b..ebaa9dda 100644 --- a/examples/bank_transfer_get.rs +++ b/examples/bank_transfer_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let bank_transfer_id = "your bank transfer id"; let response = client.bank_transfer_get(bank_transfer_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_list.rs b/examples/bank_transfer_list.rs index 73edfe04..832e9308 100644 --- a/examples/bank_transfer_list.rs +++ b/examples/bank_transfer_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -15,4 +15,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_migrate_account.rs b/examples/bank_transfer_migrate_account.rs index 8ab3d5d4..8f8828f6 100644 --- a/examples/bank_transfer_migrate_account.rs +++ b/examples/bank_transfer_migrate_account.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_sweep_get.rs b/examples/bank_transfer_sweep_get.rs index ac02e992..d865cd95 100644 --- a/examples/bank_transfer_sweep_get.rs +++ b/examples/bank_transfer_sweep_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let sweep_id = "your sweep id"; let response = client.bank_transfer_sweep_get(sweep_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/bank_transfer_sweep_list.rs b/examples/bank_transfer_sweep_list.rs index 2ecb0ae5..9c133f11 100644 --- a/examples/bank_transfer_sweep_list.rs +++ b/examples/bank_transfer_sweep_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_account_risk_evaluate.rs b/examples/beacon_account_risk_evaluate.rs new file mode 100644 index 00000000..81f450a7 --- /dev/null +++ b/examples/beacon_account_risk_evaluate.rs @@ -0,0 +1,24 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let response = client + .beacon_account_risk_evaluate() + .access_token("your access token") + .client_evaluation_id("your client evaluation id") + .client_user_id("your client user id") + .device(SignalDevice { + ip_address: Some("your ip address".to_owned()), + user_agent: Some("your user agent".to_owned()), + }) + .evaluate_time("your evaluate time") + .evaluation_reason(BeaconAccountRiskEvaluateEvaluationReason::Onboarding) + .options(BeaconAccountRiskEvaluateRequestOptions { + account_ids: Some(vec!["your account ids".to_owned()]), + }) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/beacon_duplicate_get.rs b/examples/beacon_duplicate_get.rs index afa00d00..6e7c7826 100644 --- a/examples/beacon_duplicate_get.rs +++ b/examples/beacon_duplicate_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let beacon_duplicate_id = "your beacon duplicate id"; let response = client.beacon_duplicate_get(beacon_duplicate_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_report_create.rs b/examples/beacon_report_create.rs index 28c917c5..aaa5de57 100644 --- a/examples/beacon_report_create.rs +++ b/examples/beacon_report_create.rs @@ -1,19 +1,19 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let beacon_user_id = "your beacon user id"; let fraud_date = chrono::Utc::now().date_naive(); - let type_ = "your type"; + let type_ = BeaconReportCreateType::FirstParty; let response = client .beacon_report_create(beacon_user_id, fraud_date, type_) .fraud_amount(FraudAmount { - iso_currency_code: "your iso currency code".to_owned(), + iso_currency_code: IsoCurrencyCode::Usd, value: 1.0, }) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_report_get.rs b/examples/beacon_report_get.rs index 2c2d8e94..f96713fb 100644 --- a/examples/beacon_report_get.rs +++ b/examples/beacon_report_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let beacon_report_id = "your beacon report id"; let response = client.beacon_report_get(beacon_report_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_report_list.rs b/examples/beacon_report_list.rs index 44722f35..f150fb5f 100644 --- a/examples/beacon_report_list.rs +++ b/examples/beacon_report_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_report_syndication_get.rs b/examples/beacon_report_syndication_get.rs index 975b9202..7064873c 100644 --- a/examples/beacon_report_syndication_get.rs +++ b/examples/beacon_report_syndication_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_report_syndication_list.rs b/examples/beacon_report_syndication_list.rs index b4e94261..54d9938a 100644 --- a/examples/beacon_report_syndication_list.rs +++ b/examples/beacon_report_syndication_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_user_account_insights_get.rs b/examples/beacon_user_account_insights_get.rs new file mode 100644 index 00000000..587f9698 --- /dev/null +++ b/examples/beacon_user_account_insights_get.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let access_token = "your access token"; + let beacon_user_id = "your beacon user id"; + let response = client + .beacon_user_account_insights_get(access_token, beacon_user_id) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/beacon_user_create.rs b/examples/beacon_user_create.rs index 79f9f83e..1518625c 100644 --- a/examples/beacon_user_create.rs +++ b/examples/beacon_user_create.rs @@ -1,24 +1,31 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let client_user_id = "your client user id"; let program_id = "your program id"; let user = BeaconUserRequestData { - address: BeaconUserRequestAddress { + address: Some(BeaconUserRequestAddress { city: "your city".to_owned(), country: "your country".to_owned(), postal_code: Some("your postal code".to_owned()), region: Some("your region".to_owned()), street: "your street".to_owned(), street2: Some("your street 2".to_owned()), - }, - date_of_birth: chrono::Utc::now().date_naive(), + }), + date_of_birth: Some(chrono::Utc::now().date_naive()), + depository_accounts: Some( + vec![ + BeaconUserRequestDepositoryAccount { account_number : + "your account number".to_owned(), routing_number : "your routing number" + .to_owned() } + ], + ), email_address: Some("your email address".to_owned()), id_number: Some(BeaconUserIdNumber { - type_: "your type".to_owned(), + type_: IdNumberType::ArDni, value: "your value".to_owned(), }), ip_address: Some("your ip address".to_owned()), @@ -30,7 +37,8 @@ async fn main() { }; let response = client .beacon_user_create(client_user_id, program_id, user) + .access_tokens(&["your access tokens"]) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_user_get.rs b/examples/beacon_user_get.rs index 67361e89..a1db1faf 100644 --- a/examples/beacon_user_get.rs +++ b/examples/beacon_user_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let beacon_user_id = "your beacon user id"; let response = client.beacon_user_get(beacon_user_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_user_history_list.rs b/examples/beacon_user_history_list.rs new file mode 100644 index 00000000..edea2fd4 --- /dev/null +++ b/examples/beacon_user_history_list.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let beacon_user_id = "your beacon user id"; + let response = client + .beacon_user_history_list(beacon_user_id) + .cursor("your cursor") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/beacon_user_review.rs b/examples/beacon_user_review.rs index 3d937b58..4cafbfb4 100644 --- a/examples/beacon_user_review.rs +++ b/examples/beacon_user_review.rs @@ -1,11 +1,11 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let beacon_user_id = "your beacon user id"; - let status = "your status"; + let status = BeaconUserStatus::Rejected; let response = client.beacon_user_review(beacon_user_id, status).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/beacon_user_update.rs b/examples/beacon_user_update.rs index 041394a4..fe90f7a5 100644 --- a/examples/beacon_user_update.rs +++ b/examples/beacon_user_update.rs @@ -1,32 +1,43 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let beacon_user_id = "your beacon user id"; - let user = BeaconUserUpdateRequestData { - address: Some(BeaconUserRequestAddressNullable { - city: "your city".to_owned(), - country: "your country".to_owned(), - postal_code: Some("your postal code".to_owned()), - region: Some("your region".to_owned()), - street: "your street".to_owned(), - street2: Some("your street 2".to_owned()), - }), - date_of_birth: Some(chrono::Utc::now().date_naive()), - email_address: Some("your email address".to_owned()), - id_number: Some(BeaconUserIdNumber { - type_: "your type".to_owned(), - value: "your value".to_owned(), - }), - ip_address: Some("your ip address".to_owned()), - name: Some(BeaconUserNameNullable { - family_name: "your family name".to_owned(), - given_name: "your given name".to_owned(), - }), - phone_number: Some("your phone number".to_owned()), - }; - let response = client.beacon_user_update(beacon_user_id, user).await.unwrap(); + let response = client + .beacon_user_update(beacon_user_id) + .access_tokens(&["your access tokens"]) + .user(BeaconUserUpdateRequestData { + address: Some(BeaconUserRequestAddressNullable { + city: "your city".to_owned(), + country: "your country".to_owned(), + postal_code: Some("your postal code".to_owned()), + region: Some("your region".to_owned()), + street: "your street".to_owned(), + street2: Some("your street 2".to_owned()), + }), + date_of_birth: Some(chrono::Utc::now().date_naive()), + depository_accounts: Some( + vec![ + BeaconUserRequestDepositoryAccount { account_number : + "your account number".to_owned(), routing_number : + "your routing number".to_owned() } + ], + ), + email_address: Some("your email address".to_owned()), + id_number: Some(BeaconUserIdNumber { + type_: IdNumberType::ArDni, + value: "your value".to_owned(), + }), + ip_address: Some("your ip address".to_owned()), + name: Some(BeaconUserNameNullable { + family_name: "your family name".to_owned(), + given_name: "your given name".to_owned(), + }), + phone_number: Some("your phone number".to_owned()), + }) + .await + .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/categories_get.rs b/examples/categories_get.rs index 7d27579a..10bd5b82 100644 --- a/examples/categories_get.rs +++ b/examples/categories_get.rs @@ -1,9 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let response = client.categories_get().await.unwrap(); + let body = serde_json::json!({}); + let response = client.categories_get(body).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/consent_events_get.rs b/examples/consent_events_get.rs new file mode 100644 index 00000000..8fd32b4d --- /dev/null +++ b/examples/consent_events_get.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let access_token = "your access token"; + let response = client.consent_events_get(access_token).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/consumer_report_pdf_get.rs b/examples/consumer_report_pdf_get.rs new file mode 100644 index 00000000..cf12b1fc --- /dev/null +++ b/examples/consumer_report_pdf_get.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let user_token = "your user token"; + let response = client.consumer_report_pdf_get(user_token).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_bank_income_create.rs b/examples/cra_bank_income_create.rs new file mode 100644 index 00000000..f9b07a31 --- /dev/null +++ b/examples/cra_bank_income_create.rs @@ -0,0 +1,18 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let response = client + .cra_bank_income_create() + .consumer_report_permissible_purpose( + ConsumerReportPermissiblePurpose::AccountReviewCredit, + ) + .days_requested(1) + .user_token("your user token") + .webhook("your webhook") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_bank_income_get.rs b/examples/cra_bank_income_get.rs index 2e61bda7..b544ba06 100644 --- a/examples/cra_bank_income_get.rs +++ b/examples/cra_bank_income_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/cra_base_report_create.rs b/examples/cra_base_report_create.rs new file mode 100644 index 00000000..cb383b0b --- /dev/null +++ b/examples/cra_base_report_create.rs @@ -0,0 +1,20 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let consumer_report_permissible_purpose = ConsumerReportPermissiblePurpose::AccountReviewCredit; + let days_requested = 1; + let user_token = "your user token"; + let response = client + .cra_base_report_create( + consumer_report_permissible_purpose, + days_requested, + user_token, + ) + .webhook("your webhook") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_base_report_get.rs b/examples/cra_base_report_get.rs new file mode 100644 index 00000000..7f7dddc1 --- /dev/null +++ b/examples/cra_base_report_get.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let user_token = "your user token"; + let response = client.cra_base_report_get(user_token).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_check_report_base_report_get.rs b/examples/cra_check_report_base_report_get.rs new file mode 100644 index 00000000..8dd31c4c --- /dev/null +++ b/examples/cra_check_report_base_report_get.rs @@ -0,0 +1,15 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let response = client + .cra_check_report_base_report_get() + .item_ids(&["your item ids"]) + .third_party_user_token("your third party user token") + .user_token("your user token") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_check_report_create.rs b/examples/cra_check_report_create.rs new file mode 100644 index 00000000..f39df37c --- /dev/null +++ b/examples/cra_check_report_create.rs @@ -0,0 +1,23 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +use plaid::request::CraCheckReportCreateRequired; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let consumer_report_permissible_purpose = ConsumerReportPermissiblePurpose::AccountReviewCredit; + let days_requested = 1; + let user_token = "your user token"; + let webhook = "your webhook"; + let response = client + .cra_check_report_create(CraCheckReportCreateRequired { + consumer_report_permissible_purpose, + days_requested, + user_token, + webhook, + }) + .days_required(1) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_check_report_income_insights_get.rs b/examples/cra_check_report_income_insights_get.rs new file mode 100644 index 00000000..0b4ccfce --- /dev/null +++ b/examples/cra_check_report_income_insights_get.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let response = client + .cra_check_report_income_insights_get() + .third_party_user_token("your third party user token") + .user_token("your user token") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_check_report_network_insights_get.rs b/examples/cra_check_report_network_insights_get.rs new file mode 100644 index 00000000..2a85b66c --- /dev/null +++ b/examples/cra_check_report_network_insights_get.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let response = client + .cra_check_report_network_insights_get() + .third_party_user_token("your third party user token") + .user_token("your user token") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_check_report_partner_insights_get.rs b/examples/cra_check_report_partner_insights_get.rs new file mode 100644 index 00000000..8fc239f5 --- /dev/null +++ b/examples/cra_check_report_partner_insights_get.rs @@ -0,0 +1,22 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let response = client + .cra_check_report_partner_insights_get() + .options(CraCheckReportPartnerInsightsGetOptions { + prism_products: Some(vec![PrismProduct::Insights]), + prism_versions: Some(PrismVersions { + cashscore: Some(PrismCashScoreVersion(serde_json::json!({}))), + firstdetect: Some(PrismFirstDetectVersion(serde_json::json!({}))), + insights: Some(PrismInsightsVersion(serde_json::json!({}))), + }), + }) + .third_party_user_token("your third party user token") + .user_token("your user token") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_check_report_pdf_get.rs b/examples/cra_check_report_pdf_get.rs new file mode 100644 index 00000000..e269d212 --- /dev/null +++ b/examples/cra_check_report_pdf_get.rs @@ -0,0 +1,15 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let response = client + .cra_check_report_pdf_get() + .add_ons(vec![CraPdfAddOns::CraIncomeInsights]) + .third_party_user_token("your third party user token") + .user_token("your user token") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_loans_applications_register.rs b/examples/cra_loans_applications_register.rs new file mode 100644 index 00000000..a3598d9d --- /dev/null +++ b/examples/cra_loans_applications_register.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let applications = vec![ + CraLoanApplication { application_date : Some(chrono::Utc::now().date_naive()), + application_id : "your application id".to_owned(), decision : + CraLoanApplicationDecision::Approved, decision_date : Some(chrono::Utc::now() + .date_naive()), type_ : CraLoanType::Personal, user_token : "your user token" + .to_owned() } + ]; + let response = client.cra_loans_applications_register(applications).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_loans_register.rs b/examples/cra_loans_register.rs new file mode 100644 index 00000000..f0902414 --- /dev/null +++ b/examples/cra_loans_register.rs @@ -0,0 +1,19 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let loans = vec![ + CraLoanRegister { application : Some(CraLoanRegisterApplication { + application_date : Some(chrono::Utc::now().date_naive()), application_id : + Some("your application id".to_owned()) }), loan_amount : Some(1.0), loan_id : + "your loan id".to_owned(), opened_date : chrono::Utc::now().date_naive(), + opened_with_status : CraLoanOpenedStatus { date : chrono::Utc::now() + .date_naive(), status : CraLoanStatus::Approved }, payment_schedule : + CraLoanPaymentSchedule::Daily, type_ : CraLoanType::Personal, user_token : + "your user token".to_owned() } + ]; + let response = client.cra_loans_register(loans).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_loans_unregister.rs b/examples/cra_loans_unregister.rs new file mode 100644 index 00000000..7d3951c8 --- /dev/null +++ b/examples/cra_loans_unregister.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let loans = vec![ + CraLoanUnregister { closed_with_status : CraLoanClosedStatus { date : + chrono::Utc::now().date_naive(), status : CraLoanStatus::Approved }, loan_id : + "your loan id".to_owned() } + ]; + let response = client.cra_loans_unregister(loans).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_loans_update.rs b/examples/cra_loans_update.rs new file mode 100644 index 00000000..fb471262 --- /dev/null +++ b/examples/cra_loans_update.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let loans = vec![ + CraLoanUpdate { loan_id : Some("your loan id".to_owned()), payment_history : + Some(vec![CraLoanPaymentHistory { amount_past_due : Some(1.0), balance_remaining + : Some(1.0), days_past_due : 1, due_date : chrono::Utc::now().date_naive(), + period : 1 }]), status_history : Some(vec![CraLoanStatusHistoryUpdate { date : + chrono::Utc::now().date_naive(), status : CraLoanStatus::Approved }]) } + ]; + let response = client.cra_loans_update(loans).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_monitoring_insights_get.rs b/examples/cra_monitoring_insights_get.rs new file mode 100644 index 00000000..8d7e8f83 --- /dev/null +++ b/examples/cra_monitoring_insights_get.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let consumer_report_permissible_purpose = MonitoringConsumerReportPermissiblePurpose::AccountReviewCredit; + let user_token = "your user token"; + let response = client + .cra_monitoring_insights_get(consumer_report_permissible_purpose, user_token) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_monitoring_insights_subscribe.rs b/examples/cra_monitoring_insights_subscribe.rs new file mode 100644 index 00000000..c26b9bf2 --- /dev/null +++ b/examples/cra_monitoring_insights_subscribe.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let user_token = "your user token"; + let webhook = "your webhook"; + let response = client + .cra_monitoring_insights_subscribe(user_token, webhook) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_monitoring_insights_unsubscribe.rs b/examples/cra_monitoring_insights_unsubscribe.rs new file mode 100644 index 00000000..4593b9df --- /dev/null +++ b/examples/cra_monitoring_insights_unsubscribe.rs @@ -0,0 +1,13 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let subscription_id = "your subscription id"; + let response = client + .cra_monitoring_insights_unsubscribe(subscription_id) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/cra_partner_insights_get.rs b/examples/cra_partner_insights_get.rs new file mode 100644 index 00000000..ea003199 --- /dev/null +++ b/examples/cra_partner_insights_get.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let user_token = "your user token"; + let response = client.cra_partner_insights_get(user_token).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/create_payment_token.rs b/examples/create_payment_token.rs index a9797d37..3413ce9e 100644 --- a/examples/create_payment_token.rs +++ b/examples/create_payment_token.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let payment_id = "your payment id"; let response = client.create_payment_token(payment_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_asset_report_freddie_mac_get.rs b/examples/credit_asset_report_freddie_mac_get.rs index e3e3db70..74919bac 100644 --- a/examples/credit_asset_report_freddie_mac_get.rs +++ b/examples/credit_asset_report_freddie_mac_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_audit_copy_token_create.rs b/examples/credit_audit_copy_token_create.rs index 7a2f5929..f2f74c30 100644 --- a/examples/credit_audit_copy_token_create.rs +++ b/examples/credit_audit_copy_token_create.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let report_tokens = &["your report tokens"]; let response = client.credit_audit_copy_token_create(report_tokens).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_audit_copy_token_update.rs b/examples/credit_audit_copy_token_update.rs index 265de729..5ad93a29 100644 --- a/examples/credit_audit_copy_token_update.rs +++ b/examples/credit_audit_copy_token_update.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_bank_employment_get.rs b/examples/credit_bank_employment_get.rs index 19d35226..be6bd028 100644 --- a/examples/credit_bank_employment_get.rs +++ b/examples/credit_bank_employment_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let user_token = "your user token"; let response = client.credit_bank_employment_get(user_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_bank_income_get.rs b/examples/credit_bank_income_get.rs index 61b9c8d6..0a6bfab1 100644 --- a/examples/credit_bank_income_get.rs +++ b/examples/credit_bank_income_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_bank_income_pdf_get.rs b/examples/credit_bank_income_pdf_get.rs index 31a85cf2..239c375d 100644 --- a/examples/credit_bank_income_pdf_get.rs +++ b/examples/credit_bank_income_pdf_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let user_token = "your user token"; let response = client.credit_bank_income_pdf_get(user_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_bank_income_refresh.rs b/examples/credit_bank_income_refresh.rs index 257e3b36..7b4728c0 100644 --- a/examples/credit_bank_income_refresh.rs +++ b/examples/credit_bank_income_refresh.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_bank_income_webhook_update.rs b/examples/credit_bank_income_webhook_update.rs index b08a0b11..1b8f6d9b 100644 --- a/examples/credit_bank_income_webhook_update.rs +++ b/examples/credit_bank_income_webhook_update.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_bank_statements_uploads_get.rs b/examples/credit_bank_statements_uploads_get.rs index b6536277..6ad0a0c5 100644 --- a/examples/credit_bank_statements_uploads_get.rs +++ b/examples/credit_bank_statements_uploads_get.rs @@ -1,10 +1,16 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let user_token = "your user token"; - let response = client.credit_bank_statements_uploads_get(user_token).await.unwrap(); + let response = client + .credit_bank_statements_uploads_get(user_token) + .options(CreditBankStatementsUploadsGetRequestOptions { + item_ids: Some(vec!["your item ids".to_owned()]), + }) + .await + .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_employment_get.rs b/examples/credit_employment_get.rs index beb0d564..819358b0 100644 --- a/examples/credit_employment_get.rs +++ b/examples/credit_employment_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let user_token = "your user token"; let response = client.credit_employment_get(user_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_freddie_mac_reports_get.rs b/examples/credit_freddie_mac_reports_get.rs index 0c7bd8e4..3dc56f2e 100644 --- a/examples/credit_freddie_mac_reports_get.rs +++ b/examples/credit_freddie_mac_reports_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_payroll_income_get.rs b/examples/credit_payroll_income_get.rs index e10ca2ba..4bb291ac 100644 --- a/examples/credit_payroll_income_get.rs +++ b/examples/credit_payroll_income_get.rs @@ -1,13 +1,16 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let response = client .credit_payroll_income_get() + .options(CreditPayrollIncomeGetRequestOptions { + item_ids: Some(vec!["your item ids".to_owned()]), + }) .user_token("your user token") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_payroll_income_parsing_config_update.rs b/examples/credit_payroll_income_parsing_config_update.rs index 308cbc8a..18ead807 100644 --- a/examples/credit_payroll_income_parsing_config_update.rs +++ b/examples/credit_payroll_income_parsing_config_update.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let parsing_config = &["your parsing config"]; + let parsing_config = vec![IncomeVerificationDocParsingConfig::Ocr]; let user_token = "your user token"; let response = client .credit_payroll_income_parsing_config_update(parsing_config, user_token) @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_payroll_income_precheck.rs b/examples/credit_payroll_income_precheck.rs index c22b8a04..330f9ca2 100644 --- a/examples/credit_payroll_income_precheck.rs +++ b/examples/credit_payroll_income_precheck.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -25,4 +25,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_payroll_income_refresh.rs b/examples/credit_payroll_income_refresh.rs index 4869d500..cbc82c6b 100644 --- a/examples/credit_payroll_income_refresh.rs +++ b/examples/credit_payroll_income_refresh.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -14,4 +14,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_payroll_income_risk_signals_get.rs b/examples/credit_payroll_income_risk_signals_get.rs index 2d0c7d11..5ed1fc44 100644 --- a/examples/credit_payroll_income_risk_signals_get.rs +++ b/examples/credit_payroll_income_risk_signals_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_relay_create.rs b/examples/credit_relay_create.rs index 0b1853d9..46579d71 100644 --- a/examples/credit_relay_create.rs +++ b/examples/credit_relay_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_relay_get.rs b/examples/credit_relay_get.rs index 53753b68..a48b3064 100644 --- a/examples/credit_relay_get.rs +++ b/examples/credit_relay_get.rs @@ -1,11 +1,15 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let relay_token = "your relay token"; - let report_type = "your report type"; - let response = client.credit_relay_get(relay_token, report_type).await.unwrap(); + let report_type = ReportType::Asset; + let response = client + .credit_relay_get(relay_token, report_type) + .include_insights(true) + .await + .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_relay_pdf_get.rs b/examples/credit_relay_pdf_get.rs index 5e4c7365..5c5c62e4 100644 --- a/examples/credit_relay_pdf_get.rs +++ b/examples/credit_relay_pdf_get.rs @@ -1,11 +1,11 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let relay_token = "your relay token"; - let report_type = "your report type"; + let report_type = ReportType::Asset; let response = client.credit_relay_pdf_get(relay_token, report_type).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_relay_refresh.rs b/examples/credit_relay_refresh.rs index 81a1a1a0..e75cbc39 100644 --- a/examples/credit_relay_refresh.rs +++ b/examples/credit_relay_refresh.rs @@ -1,15 +1,15 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let relay_token = "your relay token"; - let report_type = "your report type"; + let report_type = ReportType::Asset; let response = client .credit_relay_refresh(relay_token, report_type) .webhook("your webhook") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_relay_remove.rs b/examples/credit_relay_remove.rs index fb09d4b5..92ef051e 100644 --- a/examples/credit_relay_remove.rs +++ b/examples/credit_relay_remove.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let relay_token = "your relay token"; let response = client.credit_relay_remove(relay_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_report_audit_copy_remove.rs b/examples/credit_report_audit_copy_remove.rs index 37b5bb58..a06e52e7 100644 --- a/examples/credit_report_audit_copy_remove.rs +++ b/examples/credit_report_audit_copy_remove.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/credit_sessions_get.rs b/examples/credit_sessions_get.rs index 622c4fe0..5bc3ef24 100644 --- a/examples/credit_sessions_get.rs +++ b/examples/credit_sessions_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let user_token = "your user token"; let response = client.credit_sessions_get(user_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/dashboard_user_get.rs b/examples/dashboard_user_get.rs index 4a45bdc2..ebac4e92 100644 --- a/examples/dashboard_user_get.rs +++ b/examples/dashboard_user_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let dashboard_user_id = "your dashboard user id"; let response = client.dashboard_user_get(dashboard_user_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/dashboard_user_list.rs b/examples/dashboard_user_list.rs index 50060e1a..15fe9ec6 100644 --- a/examples/dashboard_user_list.rs +++ b/examples/dashboard_user_list.rs @@ -1,9 +1,9 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let response = client.dashboard_user_list().cursor("your cursor").await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/deposit_switch_alt_create.rs b/examples/deposit_switch_alt_create.rs index 036594ef..1be261b5 100644 --- a/examples/deposit_switch_alt_create.rs +++ b/examples/deposit_switch_alt_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -36,4 +36,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/deposit_switch_create.rs b/examples/deposit_switch_create.rs index 666b5861..2a9933d5 100644 --- a/examples/deposit_switch_create.rs +++ b/examples/deposit_switch_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -18,4 +18,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/deposit_switch_get.rs b/examples/deposit_switch_get.rs index f6ed7362..cdff5ac4 100644 --- a/examples/deposit_switch_get.rs +++ b/examples/deposit_switch_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let deposit_switch_id = "your deposit switch id"; let response = client.deposit_switch_get(deposit_switch_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/deposit_switch_token_create.rs b/examples/deposit_switch_token_create.rs index 83a03ea9..f9ea4ed6 100644 --- a/examples/deposit_switch_token_create.rs +++ b/examples/deposit_switch_token_create.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let deposit_switch_id = "your deposit switch id"; let response = client.deposit_switch_token_create(deposit_switch_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/employers_search.rs b/examples/employers_search.rs index 77c14157..827053d7 100644 --- a/examples/employers_search.rs +++ b/examples/employers_search.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -8,4 +8,4 @@ async fn main() { let query = "your query"; let response = client.employers_search(products, query).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/employment_verification_get.rs b/examples/employment_verification_get.rs index c6aaabb9..f8295a9a 100644 --- a/examples/employment_verification_get.rs +++ b/examples/employment_verification_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.employment_verification_get(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/fdx_notifications.rs b/examples/fdx_notifications.rs index 195bd191..bc6ca76a 100644 --- a/examples/fdx_notifications.rs +++ b/examples/fdx_notifications.rs @@ -1,55 +1,59 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::FdxNotificationsRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = FdxNotificationsRequired { - category: "your category", - notification_id: "your notification id", - notification_payload: FdxNotificationPayload { - custom_fields: Some( - vec![ - FdxFiAttribute { name : "your name".to_owned(), value : "your value" - .to_owned() } - ], - ), - id: Some("your id".to_owned()), - id_type: Some("your id type".to_owned()), - }, - sent_on: chrono::Utc::now(), - type_: "your type", + let category = FdxNotificationCategory::Security; + let notification_id = "your notification id"; + let notification_payload = FdxNotificationPayload { + custom_fields: Some( + vec![ + FdxFiAttribute { name : "your name".to_owned(), value : "your value" + .to_owned() } + ], + ), + id: Some("your id".to_owned()), + id_type: Some(FdxNotificationPayloadIdType::Account), }; + let sent_on = chrono::Utc::now(); + let type_ = FdxNotificationType::ConsentRevoked; let response = client - .fdx_notifications(args) - .priority("your priority") + .fdx_notifications(FdxNotificationsRequired { + category, + notification_id, + notification_payload, + sent_on, + type_, + }) + .priority(FdxNotificationPriority::High) .publisher(FdxParty { home_uri: Some("your home uri".to_owned()), logo_uri: Some("your logo uri".to_owned()), name: "your name".to_owned(), registered_entity_id: Some("your registered entity id".to_owned()), registered_entity_name: Some("your registered entity name".to_owned()), - registry: Some("your registry".to_owned()), - type_: "your type".to_owned(), + registry: Some(FdxPartyRegistry::Fdx), + type_: FdxPartyType::DataAccessPlatform, }) - .severity("your severity") + .severity(FdxNotificationSeverity::Emergency) .subscriber(FdxParty { home_uri: Some("your home uri".to_owned()), logo_uri: Some("your logo uri".to_owned()), name: "your name".to_owned(), registered_entity_id: Some("your registered entity id".to_owned()), registered_entity_name: Some("your registered entity name".to_owned()), - registry: Some("your registry".to_owned()), - type_: "your type".to_owned(), + registry: Some(FdxPartyRegistry::Fdx), + type_: FdxPartyType::DataAccessPlatform, }) .url(FdxHateoasLink { - action: Some("your action".to_owned()), + action: Some(FdxHateoasLinkAction::Get), href: "your href".to_owned(), rel: Some("your rel".to_owned()), - types: Some(vec!["your types".to_owned()]), + types: Some(vec![FdxContentTypes::ApplicationPdf]), }) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/get_recipient.rs b/examples/get_recipient.rs new file mode 100644 index 00000000..1e3aaa82 --- /dev/null +++ b/examples/get_recipient.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let recipient_id = "your recipient id"; + let response = client + .get_recipient(recipient_id) + .oauth_state_id("your oauth state id") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/get_recipients.rs b/examples/get_recipients.rs new file mode 100644 index 00000000..5b81ae64 --- /dev/null +++ b/examples/get_recipients.rs @@ -0,0 +1,9 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let response = client.get_recipients().await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/identity_documents_uploads_get.rs b/examples/identity_documents_uploads_get.rs new file mode 100644 index 00000000..f254c8b8 --- /dev/null +++ b/examples/identity_documents_uploads_get.rs @@ -0,0 +1,18 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let access_token = "your access token"; + let response = client + .identity_documents_uploads_get(access_token) + .client_id("your client id") + .options(IdentityDocumentsUploadsGetRequestOptions { + account_ids: Some(vec!["your account ids".to_owned()]), + }) + .secret("your secret") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/identity_get.rs b/examples/identity_get.rs index bd533200..580b9413 100644 --- a/examples/identity_get.rs +++ b/examples/identity_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/identity_match.rs b/examples/identity_match.rs index d9eedd92..d71d13e2 100644 --- a/examples/identity_match.rs +++ b/examples/identity_match.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -25,4 +25,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/identity_refresh.rs b/examples/identity_refresh.rs index aa7f8685..136c29b1 100644 --- a/examples/identity_refresh.rs +++ b/examples/identity_refresh.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.identity_refresh(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/identity_verification_autofill_create.rs b/examples/identity_verification_autofill_create.rs index 055ab9e0..f5d94425 100644 --- a/examples/identity_verification_autofill_create.rs +++ b/examples/identity_verification_autofill_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/identity_verification_create.rs b/examples/identity_verification_create.rs index 42b7bd1c..e6aebc62 100644 --- a/examples/identity_verification_create.rs +++ b/examples/identity_verification_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -24,7 +24,7 @@ async fn main() { date_of_birth: Some(chrono::Utc::now().date_naive()), email_address: Some("your email address".to_owned()), id_number: Some(UserIdNumber { - type_: "your type".to_owned(), + type_: IdNumberType::ArDni, value: "your value".to_owned(), }), name: Some(IdentityVerificationRequestUserName { @@ -36,4 +36,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/identity_verification_get.rs b/examples/identity_verification_get.rs index 14dbc3db..a018988b 100644 --- a/examples/identity_verification_get.rs +++ b/examples/identity_verification_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/identity_verification_list.rs b/examples/identity_verification_list.rs index 726be980..cf339f6c 100644 --- a/examples/identity_verification_list.rs +++ b/examples/identity_verification_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/identity_verification_retry.rs b/examples/identity_verification_retry.rs index 33a52d37..6bf5eb95 100644 --- a/examples/identity_verification_retry.rs +++ b/examples/identity_verification_retry.rs @@ -1,14 +1,15 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let client_user_id = "your client user id"; - let strategy = "your strategy"; + let strategy = Strategy::Reset; let template_id = "your template id"; let response = client .identity_verification_retry(client_user_id, strategy, template_id) + .is_shareable(true) .steps(IdentityVerificationRetryRequestStepsObject { documentary_verification: true, kyc_check: true, @@ -27,7 +28,7 @@ async fn main() { date_of_birth: Some(chrono::Utc::now().date_naive()), email_address: Some("your email address".to_owned()), id_number: Some(UserIdNumber { - type_: "your type".to_owned(), + type_: IdNumberType::ArDni, value: "your value".to_owned(), }), name: Some(IdentityVerificationRequestUserName { @@ -39,4 +40,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/income_verification_create.rs b/examples/income_verification_create.rs index 88c0314e..9757a12a 100644 --- a/examples/income_verification_create.rs +++ b/examples/income_verification_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -14,4 +14,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/income_verification_documents_download.rs b/examples/income_verification_documents_download.rs index dd67ebda..cba4154c 100644 --- a/examples/income_verification_documents_download.rs +++ b/examples/income_verification_documents_download.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/income_verification_paystubs_get.rs b/examples/income_verification_paystubs_get.rs index fd413866..7b60591b 100644 --- a/examples/income_verification_paystubs_get.rs +++ b/examples/income_verification_paystubs_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/income_verification_precheck.rs b/examples/income_verification_precheck.rs index 1e279428..b860d9f6 100644 --- a/examples/income_verification_precheck.rs +++ b/examples/income_verification_precheck.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -37,4 +37,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/income_verification_taxforms_get.rs b/examples/income_verification_taxforms_get.rs index ba407061..86d6a558 100644 --- a/examples/income_verification_taxforms_get.rs +++ b/examples/income_verification_taxforms_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/institutions_get.rs b/examples/institutions_get.rs index a2866d8b..19f7ff97 100644 --- a/examples/institutions_get.rs +++ b/examples/institutions_get.rs @@ -1,11 +1,11 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let count = 1; - let country_codes = &["your country codes"]; + let country_codes = vec![CountryCode::Us]; let offset = 1; let response = client .institutions_get(count, country_codes, offset) @@ -14,10 +14,10 @@ async fn main() { include_optional_metadata: Some(true), include_payment_initiation_metadata: Some(true), oauth: Some(true), - products: Some(vec!["your products".to_owned()]), + products: Some(vec![Products::Assets]), routing_numbers: Some(vec!["your routing numbers".to_owned()]), }) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/institutions_get_by_id.rs b/examples/institutions_get_by_id.rs index b0980e99..e8fde0a1 100644 --- a/examples/institutions_get_by_id.rs +++ b/examples/institutions_get_by_id.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let country_codes = &["your country codes"]; + let country_codes = vec![CountryCode::Us]; let institution_id = "your institution id"; let response = client .institutions_get_by_id(country_codes, institution_id) @@ -17,4 +17,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/institutions_search.rs b/examples/institutions_search.rs index c3e25312..f41b38aa 100644 --- a/examples/institutions_search.rs +++ b/examples/institutions_search.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let country_codes = &["your country codes"]; + let country_codes = vec![CountryCode::Us]; let query = "your query"; let response = client .institutions_search(country_codes, query) @@ -18,8 +18,8 @@ async fn main() { payment_id: Some("your payment id".to_owned()), }), }) - .products(&["your products"]) + .products(vec![Products::Assets]) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/investments_auth_get.rs b/examples/investments_auth_get.rs index e02e052e..9fd15d58 100644 --- a/examples/investments_auth_get.rs +++ b/examples/investments_auth_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/investments_holdings_get.rs b/examples/investments_holdings_get.rs index 955b83b0..6a6710a1 100644 --- a/examples/investments_holdings_get.rs +++ b/examples/investments_holdings_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/investments_refresh.rs b/examples/investments_refresh.rs index add8ade1..58d067f4 100644 --- a/examples/investments_refresh.rs +++ b/examples/investments_refresh.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.investments_refresh(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/investments_transactions_get.rs b/examples/investments_transactions_get.rs index 2eddffc1..f21201f7 100644 --- a/examples/investments_transactions_get.rs +++ b/examples/investments_transactions_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -18,4 +18,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/issues_get.rs b/examples/issues_get.rs new file mode 100644 index 00000000..227d0816 --- /dev/null +++ b/examples/issues_get.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let issue_id = "your issue id"; + let response = client.issues_get(issue_id).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/issues_search.rs b/examples/issues_search.rs new file mode 100644 index 00000000..4f69c39e --- /dev/null +++ b/examples/issues_search.rs @@ -0,0 +1,15 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let response = client + .issues_search() + .item_id("your item id") + .link_session_id("your link session id") + .link_session_request_id("your link session request id") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/issues_subscribe.rs b/examples/issues_subscribe.rs new file mode 100644 index 00000000..a0a8aee6 --- /dev/null +++ b/examples/issues_subscribe.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let issue_id = "your issue id"; + let response = client + .issues_subscribe(issue_id) + .webhook("your webhook") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/item_access_token_invalidate.rs b/examples/item_access_token_invalidate.rs index ad582e9b..494df421 100644 --- a/examples/item_access_token_invalidate.rs +++ b/examples/item_access_token_invalidate.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.item_access_token_invalidate(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_activity_list.rs b/examples/item_activity_list.rs index 7c69132c..d224e8af 100644 --- a/examples/item_activity_list.rs +++ b/examples/item_activity_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_application_list.rs b/examples/item_application_list.rs index 0abc1461..d372a9ef 100644 --- a/examples/item_application_list.rs +++ b/examples/item_application_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_application_scopes_update.rs b/examples/item_application_scopes_update.rs index 44719d8a..23ae5e0b 100644 --- a/examples/item_application_scopes_update.rs +++ b/examples/item_application_scopes_update.rs @@ -1,41 +1,44 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::ItemApplicationScopesUpdateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = ItemApplicationScopesUpdateRequired { - access_token: "your access token", - application_id: "your application id", - context: "your context", - scopes: Scopes { - accounts: Some( - vec![ - AccountAccess { account_product_access : Some(AccountProductAccess { - account_data : Some(true), statements : Some(true), tax_documents : - Some(true) }), authorized : Some(true), unique_id : "your unique id" - .to_owned() } - ], - ), - new_accounts: Some(true), - product_access: Some(ProductAccess { - accounts_details_transactions: Some(true), - accounts_routing_number: Some(true), - accounts_statements: Some(true), - accounts_tax_statements: Some(true), - auth: Some(true), - customers_profiles: Some(true), - identity: Some(true), - statements: Some(true), - transactions: Some(true), - }), - }, + let access_token = "your access token"; + let application_id = "your application id"; + let context = ScopesContext::Enrollment; + let scopes = Scopes { + accounts: Some( + vec![ + AccountAccess { account_product_access : Some(AccountProductAccess { + account_data : Some(true), statements : Some(true), tax_documents : + Some(true) }), authorized : Some(true), unique_id : "your unique id" + .to_owned() } + ], + ), + new_accounts: Some(true), + product_access: Some(ProductAccess { + accounts_details_transactions: Some(true), + accounts_routing_number: Some(true), + accounts_statements: Some(true), + accounts_tax_statements: Some(true), + auth: Some(true), + customers_profiles: Some(true), + identity: Some(true), + statements: Some(true), + transactions: Some(true), + }), }; let response = client - .item_application_scopes_update(args) + .item_application_scopes_update(ItemApplicationScopesUpdateRequired { + access_token, + application_id, + context, + scopes, + }) .state("your state") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_application_unlink.rs b/examples/item_application_unlink.rs index 4a138ba1..0c6280fa 100644 --- a/examples/item_application_unlink.rs +++ b/examples/item_application_unlink.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_create_public_token.rs b/examples/item_create_public_token.rs index 30ffe5a7..e034f006 100644 --- a/examples/item_create_public_token.rs +++ b/examples/item_create_public_token.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.item_create_public_token(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_get.rs b/examples/item_get.rs index b39f987a..9f25d00a 100644 --- a/examples/item_get.rs +++ b/examples/item_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.item_get(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_import.rs b/examples/item_import.rs index c5a59d87..b761a6a6 100644 --- a/examples/item_import.rs +++ b/examples/item_import.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let products = &["your products"]; + let products = vec![Products::Assets]; let user_auth = ItemImportRequestUserAuth { auth_token: "your auth token".to_owned(), user_id: "your user id".to_owned(), @@ -17,4 +17,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_public_token_exchange.rs b/examples/item_public_token_exchange.rs index 29523d02..1bcae710 100644 --- a/examples/item_public_token_exchange.rs +++ b/examples/item_public_token_exchange.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let public_token = "your public token"; let response = client.item_public_token_exchange(public_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_remove.rs b/examples/item_remove.rs index 30f5d728..e8ac4729 100644 --- a/examples/item_remove.rs +++ b/examples/item_remove.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.item_remove(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/item_webhook_update.rs b/examples/item_webhook_update.rs index 617f9c05..55031097 100644 --- a/examples/item_webhook_update.rs +++ b/examples/item_webhook_update.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/liabilities_get.rs b/examples/liabilities_get.rs index 6df1c846..b79a4567 100644 --- a/examples/liabilities_get.rs +++ b/examples/liabilities_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/link_delivery_create.rs b/examples/link_delivery_create.rs index 5b15dd48..3df40ba5 100644 --- a/examples/link_delivery_create.rs +++ b/examples/link_delivery_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,7 +12,7 @@ async fn main() { communication_methods: Some( vec![ LinkDeliveryCommunicationMethod { address : Some("your address" - .to_owned()), method : Some("your method".to_owned()) } + .to_owned()), method : Some(LinkDeliveryDeliveryMethod::Sms) } ], ), first_name: Some("your first name".to_owned()), @@ -21,4 +21,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/link_delivery_get.rs b/examples/link_delivery_get.rs index 880851e7..3381b66f 100644 --- a/examples/link_delivery_get.rs +++ b/examples/link_delivery_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let link_delivery_session_id = "your link delivery session id"; let response = client.link_delivery_get(link_delivery_session_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/link_oauth_correlation_id_exchange.rs b/examples/link_oauth_correlation_id_exchange.rs index 61a8f2bf..db60698a 100644 --- a/examples/link_oauth_correlation_id_exchange.rs +++ b/examples/link_oauth_correlation_id_exchange.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/link_profile_eligibility_check.rs b/examples/link_profile_eligibility_check.rs new file mode 100644 index 00000000..8a88decf --- /dev/null +++ b/examples/link_profile_eligibility_check.rs @@ -0,0 +1,16 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let link_session_id = "your link session id"; + let user = LinkProfileEligibilityCheckUser { + phone_number: "your phone number".to_owned(), + }; + let response = client + .link_profile_eligibility_check(link_session_id, user) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/link_token_create.rs b/examples/link_token_create.rs index 03ece767..257fb614 100644 --- a/examples/link_token_create.rs +++ b/examples/link_token_create.rs @@ -1,69 +1,106 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::LinkTokenCreateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = LinkTokenCreateRequired { - client_name: "your client name", - country_codes: &["your country codes"], - language: "your language", - user: LinkTokenCreateRequestUser { - address: Some(serde_json::json!({})), - client_user_id: "your client user id".to_owned(), - date_of_birth: Some(chrono::Utc::now().date_naive()), - email_address: Some("your email address".to_owned()), - email_address_verified_time: Some(chrono::Utc::now()), - id_number: Some(serde_json::json!({})), - legal_name: Some("your legal name".to_owned()), - name: Some(serde_json::json!({})), - phone_number: Some("your phone number".to_owned()), - phone_number_verified_time: Some(chrono::Utc::now()), - ssn: Some("your ssn".to_owned()), - }, + let client_name = "your client name"; + let country_codes = vec![CountryCode::Us]; + let language = "your language"; + let user = LinkTokenCreateRequestUser { + address: Some(serde_json::json!({})), + client_user_id: "your client user id".to_owned(), + date_of_birth: Some(chrono::Utc::now().date_naive()), + email_address: Some("your email address".to_owned()), + email_address_verified_time: Some(chrono::Utc::now()), + id_number: Some(serde_json::json!({})), + legal_name: Some("your legal name".to_owned()), + name: Some(serde_json::json!({})), + phone_number: Some("your phone number".to_owned()), + phone_number_verified_time: Some(chrono::Utc::now()), + ssn: Some("your ssn".to_owned()), }; let response = client - .link_token_create(args) + .link_token_create(LinkTokenCreateRequired { + client_name, + country_codes, + language, + user, + }) .access_token("your access token") .access_tokens(&["your access tokens"]) .account_filters(LinkTokenAccountFilters { credit: Some(CreditFilter { - account_subtypes: vec!["your account subtypes".to_owned()], + account_subtypes: CreditAccountSubtypes( + vec![CreditAccountSubtype::CreditCard], + ), }), depository: Some(DepositoryFilter { - account_subtypes: vec!["your account subtypes".to_owned()], + account_subtypes: DepositoryAccountSubtypes( + vec![DepositoryAccountSubtype::Checking], + ), }), investment: Some(InvestmentFilter { - account_subtypes: vec!["your account subtypes".to_owned()], + account_subtypes: InvestmentAccountSubtypes( + vec![InvestmentAccountSubtype::_529], + ), }), loan: Some(LoanFilter { - account_subtypes: vec!["your account subtypes".to_owned()], + account_subtypes: LoanAccountSubtypes(vec![LoanAccountSubtype::Auto]), }), other: Some(OtherFilter { - account_subtypes: vec!["your account subtypes".to_owned()], + account_subtypes: OtherAccountSubtypes(vec![OtherAccountSubtype::Other]), }), }) - .additional_consented_products(&["your additional consented products"]) + .additional_consented_products(vec![Products::Assets]) .android_package_name("your android package name") .auth(LinkTokenCreateRequestAuth { auth_type_select_enabled: Some(true), automated_microdeposits_enabled: Some(true), + database_insights_enabled: Some(true), database_match_enabled: Some(true), flow_type: Some("your flow type".to_owned()), instant_match_enabled: Some(true), instant_microdeposits_enabled: Some(true), reroute_to_credentials: Some("your reroute to credentials".to_owned()), same_day_microdeposits_enabled: Some(true), + sms_microdeposits_verification_enabled: Some(true), }) .base_report(LinkTokenCreateRequestBaseReport { + client_report_id: Some("your client report id".to_owned()), days_requested: 1, }) .card_switch(LinkTokenCreateCardSwitch { card_bin: "your card bin".to_owned(), }) - .consumer_report_permissible_purpose("your consumer report permissible purpose") + .consumer_report_permissible_purpose(serde_json::json!({})) .cra_enabled(true) + .cra_options(LinkTokenCreateRequestCraOptions { + base_report: Some(LinkTokenCreateRequestCraOptionsBaseReport { + client_report_id: Some("your client report id".to_owned()), + }), + cashflow_insights: Some(LinkTokenCreateRequestCraOptionsCashflowInsights { + attributes_version: Some(CashflowAttributesVersion::V10), + plaid_check_score_version: Some( + "your plaid check score version".to_owned(), + ), + }), + days_requested: 1, + days_required: Some(1), + partner_insights: Some(LinkTokenCreateRequestCraOptionsPartnerInsights { + prism_products: Some(vec![PrismProduct::Insights]), + prism_versions: Some(PrismVersions { + cashscore: Some(PrismCashScoreVersion(serde_json::json!({}))), + firstdetect: Some(PrismFirstDetectVersion(serde_json::json!({}))), + insights: Some(PrismInsightsVersion(serde_json::json!({}))), + }), + }), + }) + .credit_partner_insights(LinkTokenCreateRequestCreditPartnerInsights { + days_requested: Some(1), + prism_products: Some(vec![PrismProduct::Insights]), + }) .deposit_switch(LinkTokenCreateRequestDepositSwitch { deposit_switch_id: "your deposit switch id".to_owned(), }) @@ -71,18 +108,24 @@ async fn main() { bank_employment: Some(LinkTokenCreateRequestEmploymentBankIncome { days_requested: 1, }), - employment_source_types: Some( - vec!["your employment source types".to_owned()], - ), + employment_source_types: Some(vec![EmploymentSourceType::Bank]), }) + .enable_multi_item_link(true) .eu_config(LinkTokenEuConfig { headless: Some(true), }) + .financekit_supported(true) .hosted_link(LinkTokenCreateHostedLink { completion_redirect_uri: Some("your completion redirect uri".to_owned()), - delivery_method: Some("your delivery method".to_owned()), + delivery_method: Some(HostedLinkDeliveryMethod::Sms), + is_mobile_app: Some(true), url_lifetime_seconds: Some(1), }) + .identity(LinkTokenCreateIdentity { + account_ids: Some(vec!["your account ids".to_owned()]), + is_document_upload: Some(true), + parsing_configs: Some(vec![IncomeVerificationDocParsingConfig::Ocr]), + }) .identity_verification(LinkTokenCreateRequestIdentityVerification { consent: Some(true), gave_consent: Some(true), @@ -95,21 +138,24 @@ async fn main() { days_requested: 1, enable_multiple_items: Some(true), }), - income_source_types: Some(vec!["your income source types".to_owned()]), + income_source_types: Some(vec![IncomeVerificationSourceType::Bank]), income_verification_id: Some("your income verification id".to_owned()), payroll_income: Some(LinkTokenCreateRequestIncomeVerificationPayrollIncome { - flow_types: Some(vec!["your flow types".to_owned()]), + flow_types: Some( + vec![IncomeVerificationPayrollFlowType::PayrollDigitalIncome], + ), is_update_mode: Some(true), item_id_to_update: Some("your item id to update".to_owned()), - parsing_config: Some(vec!["your parsing config".to_owned()]), + parsing_config: Some(vec![IncomeVerificationDocParsingConfig::Ocr]), }), stated_income_sources: Some( vec![ LinkTokenCreateRequestUserStatedIncomeSource { category : - Some("your category".to_owned()), employer : Some("your employer" - .to_owned()), pay_annual : Some(1.0), pay_frequency : - Some("your pay frequency".to_owned()), pay_per_cycle : Some(1.0), - pay_type : Some("your pay type".to_owned()) } + Some(UserStatedIncomeSourceCategory::Other), employer : + Some("your employer".to_owned()), pay_annual : Some(1.0), + pay_frequency : Some(UserStatedIncomeSourceFrequency::Unknown), + pay_per_cycle : Some(1.0), pay_type : + Some(UserStatedIncomeSourcePayType::Unknown) } ], ), }) @@ -124,33 +170,42 @@ async fn main() { .investments_auth(LinkTokenInvestmentsAuth { manual_entry_enabled: Some(true), masked_number_match_enabled: Some(true), + stated_account_number_enabled: Some(true), }) .link_customization_name("your link customization name") - .optional_products(&["your optional products"]) + .optional_products(vec![Products::Assets]) + .payment_configuration(LinkTokenCreateRequestPaymentConfiguration { + amount: "your amount".to_owned(), + description: Some("your description".to_owned()), + }) .payment_initiation(LinkTokenCreateRequestPaymentInitiation { consent_id: Some("your consent id".to_owned()), payment_id: Some("your payment id".to_owned()), }) - .products(&["your products"]) + .products(vec![Products::Assets]) .redirect_uri("your redirect uri") - .required_if_supported_products(&["your required if supported products"]) + .required_if_supported_products(vec![Products::Assets]) .statements(LinkTokenCreateRequestStatements { - end_date: Some(chrono::Utc::now().date_naive()), - start_date: Some(chrono::Utc::now().date_naive()), + end_date: chrono::Utc::now().date_naive(), + start_date: chrono::Utc::now().date_naive(), }) .transactions(LinkTokenTransactions { days_requested: Some(1), }) .transfer(LinkTokenCreateRequestTransfer { + authorization_id: Some("your authorization id".to_owned()), intent_id: Some("your intent id".to_owned()), payment_profile_token: Some("your payment profile token".to_owned()), }) .update(LinkTokenCreateRequestUpdate { account_selection_enabled: Some(true), + item_ids: Some(vec!["your item ids".to_owned()]), + reauthorization_enabled: Some(true), + user: Some(true), }) .user_token("your user token") .webhook("your webhook") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/link_token_get.rs b/examples/link_token_get.rs index 8a8c3fd7..f926bed1 100644 --- a/examples/link_token_get.rs +++ b/examples/link_token_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let link_token = "your link token"; let response = client.link_token_get(link_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/network_insights_report_get.rs b/examples/network_insights_report_get.rs new file mode 100644 index 00000000..cf30b557 --- /dev/null +++ b/examples/network_insights_report_get.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let access_tokens = &["your access tokens"]; + let response = client.network_insights_report_get(access_tokens).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/partner_customer_create.rs b/examples/partner_customer_create.rs index c410e6d0..e98a45b5 100644 --- a/examples/partner_customer_create.rs +++ b/examples/partner_customer_create.rs @@ -1,27 +1,33 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::PartnerCustomerCreateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = PartnerCustomerCreateRequired { - address: PartnerEndCustomerAddress { - city: Some("your city".to_owned()), - country_code: Some("your country code".to_owned()), - postal_code: Some("your postal code".to_owned()), - region: Some("your region".to_owned()), - street: Some("your street".to_owned()), - }, - application_name: "your application name", - company_name: "your company name", - is_bank_addendum_completed: true, - is_diligence_attested: true, - legal_entity_name: "your legal entity name", - website: "your website", + let address = PartnerEndCustomerAddress { + city: Some("your city".to_owned()), + country_code: Some("your country code".to_owned()), + postal_code: Some("your postal code".to_owned()), + region: Some("your region".to_owned()), + street: Some("your street".to_owned()), }; + let application_name = "your application name"; + let company_name = "your company name"; + let is_bank_addendum_completed = true; + let is_diligence_attested = true; + let legal_entity_name = "your legal entity name"; + let website = "your website"; let response = client - .partner_customer_create(args) + .partner_customer_create(PartnerCustomerCreateRequired { + address, + application_name, + company_name, + is_bank_addendum_completed, + is_diligence_attested, + legal_entity_name, + website, + }) .assets_under_management(PartnerEndCustomerAssetsUnderManagement { amount: 1.0, iso_currency_code: "your iso currency code".to_owned(), @@ -40,7 +46,7 @@ async fn main() { phone_number: Some("your phone number".to_owned()), }) .logo("your logo") - .products(&["your products"]) + .products(vec![Products::Assets]) .redirect_uris(&["your redirect uris"]) .registration_number("your registration number") .secret("your secret") @@ -52,4 +58,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/partner_customer_enable.rs b/examples/partner_customer_enable.rs index 8460c377..0ac67f17 100644 --- a/examples/partner_customer_enable.rs +++ b/examples/partner_customer_enable.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/partner_customer_get.rs b/examples/partner_customer_get.rs index eb544c96..c2ec9a94 100644 --- a/examples/partner_customer_get.rs +++ b/examples/partner_customer_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/partner_customer_oauth_institutions_get.rs b/examples/partner_customer_oauth_institutions_get.rs index 18e58a0a..1d76d985 100644 --- a/examples/partner_customer_oauth_institutions_get.rs +++ b/examples/partner_customer_oauth_institutions_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/partner_customer_remove.rs b/examples/partner_customer_remove.rs index 08923923..65a6a14b 100644 --- a/examples/partner_customer_remove.rs +++ b/examples/partner_customer_remove.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_consent_create.rs b/examples/payment_initiation_consent_create.rs index f665eb99..42420d91 100644 --- a/examples/payment_initiation_consent_create.rs +++ b/examples/payment_initiation_consent_create.rs @@ -1,32 +1,29 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; -use plaid::request::PaymentInitiationConsentCreateRequired; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = PaymentInitiationConsentCreateRequired { - constraints: PaymentInitiationConsentConstraints { - max_payment_amount: PaymentAmount { - currency: "your currency".to_owned(), - value: 1.0, - }, - periodic_amounts: vec![ - PaymentConsentPeriodicAmount { alignment : "your alignment".to_owned(), - amount : PaymentAmount { currency : "your currency".to_owned(), value : - 1.0 }, interval : "your interval".to_owned() } - ], - valid_date_time: Some(PaymentConsentValidDateTime { - from: Some(chrono::Utc::now()), - to: Some(chrono::Utc::now()), - }), + let constraints = PaymentInitiationConsentConstraints { + max_payment_amount: PaymentAmount { + currency: PaymentAmountCurrency::Gbp, + value: 1.0, }, - recipient_id: "your recipient id", - reference: "your reference", - scopes: &["your scopes"], + periodic_amounts: vec![ + PaymentConsentPeriodicAmount { alignment : + PaymentConsentPeriodicAlignment::Calendar, amount : PaymentAmount { currency + : PaymentAmountCurrency::Gbp, value : 1.0 }, interval : + PaymentConsentPeriodicInterval::Day } + ], + valid_date_time: Some(PaymentConsentValidDateTime { + from: Some(chrono::Utc::now()), + to: Some(chrono::Utc::now()), + }), }; + let recipient_id = "your recipient id"; + let reference = "your reference"; let response = client - .payment_initiation_consent_create(args) + .payment_initiation_consent_create(constraints, recipient_id, reference) .options(ExternalPaymentInitiationConsentOptions { bacs: Some(RecipientBacs { account: Some("your account".to_owned()), @@ -35,7 +32,28 @@ async fn main() { iban: Some("your iban".to_owned()), request_refund_details: Some(true), }) + .payer_details(PaymentInitiationConsentPayerDetails { + address: Some(PaymentInitiationAddress { + city: "your city".to_owned(), + country: "your country".to_owned(), + postal_code: "your postal code".to_owned(), + street: vec!["your street".to_owned()], + }), + date_of_birth: Some(chrono::Utc::now().date_naive()), + emails: Some(vec!["your emails".to_owned()]), + name: "your name".to_owned(), + numbers: PaymentInitiationConsentPayerNumbers { + bacs: Some(RecipientBacs { + account: Some("your account".to_owned()), + sort_code: Some("your sort code".to_owned()), + }), + iban: Some("your iban".to_owned()), + }, + phone_numbers: Some(vec!["your phone numbers".to_owned()]), + }) + .scopes(vec![PaymentInitiationConsentScope::MeToMe]) + .type_(PaymentInitiationConsentType::Sweeping) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_consent_get.rs b/examples/payment_initiation_consent_get.rs index f7800849..c19cbc67 100644 --- a/examples/payment_initiation_consent_get.rs +++ b/examples/payment_initiation_consent_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let consent_id = "your consent id"; let response = client.payment_initiation_consent_get(consent_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_consent_payment_execute.rs b/examples/payment_initiation_consent_payment_execute.rs index 58f39d9f..f2a58794 100644 --- a/examples/payment_initiation_consent_payment_execute.rs +++ b/examples/payment_initiation_consent_payment_execute.rs @@ -1,18 +1,21 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let amount = PaymentAmount { - currency: "your currency".to_owned(), + currency: PaymentAmountCurrency::Gbp, value: 1.0, }; let consent_id = "your consent id"; let idempotency_key = "your idempotency key"; let response = client .payment_initiation_consent_payment_execute(amount, consent_id, idempotency_key) + .processing_mode(PaymentInitiationConsentProcessingMode::Async) + .reference("your reference") + .scope(serde_json::json!({})) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_consent_revoke.rs b/examples/payment_initiation_consent_revoke.rs index 30023a82..115afd7d 100644 --- a/examples/payment_initiation_consent_revoke.rs +++ b/examples/payment_initiation_consent_revoke.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let consent_id = "your consent id"; let response = client.payment_initiation_consent_revoke(consent_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_payment_create.rs b/examples/payment_initiation_payment_create.rs index 754752bb..22d9646e 100644 --- a/examples/payment_initiation_payment_create.rs +++ b/examples/payment_initiation_payment_create.rs @@ -1,11 +1,11 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let amount = PaymentAmount { - currency: "your currency".to_owned(), + currency: PaymentAmountCurrency::Gbp, value: 1.0, }; let recipient_id = "your recipient id"; @@ -24,11 +24,11 @@ async fn main() { .schedule(ExternalPaymentScheduleBase { adjusted_start_date: Some(chrono::Utc::now().date_naive()), end_date: Some(chrono::Utc::now().date_naive()), - interval: Some("your interval".to_owned()), + interval: Some(PaymentScheduleInterval::Weekly), interval_execution_day: Some(1), start_date: Some(chrono::Utc::now().date_naive()), }) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_payment_get.rs b/examples/payment_initiation_payment_get.rs index 5d65f04a..245ea205 100644 --- a/examples/payment_initiation_payment_get.rs +++ b/examples/payment_initiation_payment_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let payment_id = "your payment id"; let response = client.payment_initiation_payment_get(payment_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_payment_list.rs b/examples/payment_initiation_payment_list.rs index 92ad491c..e58e6900 100644 --- a/examples/payment_initiation_payment_list.rs +++ b/examples/payment_initiation_payment_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_payment_reverse.rs b/examples/payment_initiation_payment_reverse.rs index 06e203a4..42184afa 100644 --- a/examples/payment_initiation_payment_reverse.rs +++ b/examples/payment_initiation_payment_reverse.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,10 +10,17 @@ async fn main() { let response = client .payment_initiation_payment_reverse(idempotency_key, payment_id, reference) .amount(PaymentAmountNullable { - currency: "your currency".to_owned(), + currency: PaymentAmountCurrency::Gbp, value: 1.0, }) + .counterparty_address(PaymentInitiationAddress { + city: "your city".to_owned(), + country: "your country".to_owned(), + postal_code: "your postal code".to_owned(), + street: vec!["your street".to_owned()], + }) + .counterparty_date_of_birth(chrono::Utc::now().date_naive()) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_recipient_create.rs b/examples/payment_initiation_recipient_create.rs index 5bea3301..975a46d2 100644 --- a/examples/payment_initiation_recipient_create.rs +++ b/examples/payment_initiation_recipient_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -23,4 +23,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_recipient_get.rs b/examples/payment_initiation_recipient_get.rs index e0783c77..3cbb0108 100644 --- a/examples/payment_initiation_recipient_get.rs +++ b/examples/payment_initiation_recipient_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let recipient_id = "your recipient id"; let response = client.payment_initiation_recipient_get(recipient_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_initiation_recipient_list.rs b/examples/payment_initiation_recipient_list.rs index a9836498..a3740b75 100644 --- a/examples/payment_initiation_recipient_list.rs +++ b/examples/payment_initiation_recipient_list.rs @@ -1,9 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let response = client.payment_initiation_recipient_list().await.unwrap(); + let body = serde_json::json!({}); + let response = client.payment_initiation_recipient_list(body).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_profile_create.rs b/examples/payment_profile_create.rs index fc64c841..a437bff6 100644 --- a/examples/payment_profile_create.rs +++ b/examples/payment_profile_create.rs @@ -1,9 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let response = client.payment_profile_create().await.unwrap(); + let body = serde_json::json!({}); + let response = client.payment_profile_create(body).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_profile_get.rs b/examples/payment_profile_get.rs index 6e216830..0de5a084 100644 --- a/examples/payment_profile_get.rs +++ b/examples/payment_profile_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let payment_profile_token = "your payment profile token"; let response = client.payment_profile_get(payment_profile_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/payment_profile_remove.rs b/examples/payment_profile_remove.rs index 631dbba5..9ad20ae8 100644 --- a/examples/payment_profile_remove.rs +++ b/examples/payment_profile_remove.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let payment_profile_token = "your payment profile token"; let response = client.payment_profile_remove(payment_profile_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_account_get.rs b/examples/processor_account_get.rs index fc59a0cc..cf3798d3 100644 --- a/examples/processor_account_get.rs +++ b/examples/processor_account_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let processor_token = "your processor token"; let response = client.processor_account_get(processor_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_apex_processor_token_create.rs b/examples/processor_apex_processor_token_create.rs index 9a6439d5..ff42f35e 100644 --- a/examples/processor_apex_processor_token_create.rs +++ b/examples/processor_apex_processor_token_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_auth_get.rs b/examples/processor_auth_get.rs index 45e363ab..c092f89f 100644 --- a/examples/processor_auth_get.rs +++ b/examples/processor_auth_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let processor_token = "your processor token"; let response = client.processor_auth_get(processor_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_balance_get.rs b/examples/processor_balance_get.rs index 59b48a59..e98effbe 100644 --- a/examples/processor_balance_get.rs +++ b/examples/processor_balance_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_bank_transfer_create.rs b/examples/processor_bank_transfer_create.rs index 4c287536..5ae11487 100644 --- a/examples/processor_bank_transfer_create.rs +++ b/examples/processor_bank_transfer_create.rs @@ -1,31 +1,38 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::ProcessorBankTransferCreateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = ProcessorBankTransferCreateRequired { - amount: "your amount", - description: "your description", - idempotency_key: "your idempotency key", - iso_currency_code: "your iso currency code", - network: "your network", - processor_token: "your processor token", - type_: "your type", - user: BankTransferUser { - email_address: Some("your email address".to_owned()), - legal_name: "your legal name".to_owned(), - routing_number: Some("your routing number".to_owned()), - }, + let amount = "your amount"; + let description = "your description"; + let idempotency_key = "your idempotency key"; + let iso_currency_code = "your iso currency code"; + let network = BankTransferNetwork::Ach; + let processor_token = "your processor token"; + let type_ = BankTransferType::Debit; + let user = BankTransferUser { + email_address: Some("your email address".to_owned()), + legal_name: "your legal name".to_owned(), + routing_number: Some("your routing number".to_owned()), }; let response = client - .processor_bank_transfer_create(args) - .ach_class("your ach class") + .processor_bank_transfer_create(ProcessorBankTransferCreateRequired { + amount, + description, + idempotency_key, + iso_currency_code, + network, + processor_token, + type_, + user, + }) + .ach_class(AchClass::Ccd) .custom_tag("your custom tag") - .metadata(BankTransferMetadata {}) + .metadata("your bank transfer metadata") .origination_account_id("your origination account id") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_identity_get.rs b/examples/processor_identity_get.rs index 338b2016..41ab1059 100644 --- a/examples/processor_identity_get.rs +++ b/examples/processor_identity_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let processor_token = "your processor token"; let response = client.processor_identity_get(processor_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_identity_match.rs b/examples/processor_identity_match.rs index 34e803af..647634ce 100644 --- a/examples/processor_identity_match.rs +++ b/examples/processor_identity_match.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -22,4 +22,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_liabilities_get.rs b/examples/processor_liabilities_get.rs index 33fed58f..685372f8 100644 --- a/examples/processor_liabilities_get.rs +++ b/examples/processor_liabilities_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let processor_token = "your processor token"; let response = client.processor_liabilities_get(processor_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_signal_decision_report.rs b/examples/processor_signal_decision_report.rs index eb40a662..d72e5f02 100644 --- a/examples/processor_signal_decision_report.rs +++ b/examples/processor_signal_decision_report.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -15,9 +15,9 @@ async fn main() { ) .amount_instantly_available(1.0) .days_funds_on_hold(1) - .decision_outcome("your decision outcome") - .payment_method("your payment method") + .decision_outcome(SignalDecisionOutcome::Approve) + .payment_method(SignalPaymentMethod::SameDayAch) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_signal_evaluate.rs b/examples/processor_signal_evaluate.rs index 585ff7a4..77dc3ae4 100644 --- a/examples/processor_signal_evaluate.rs +++ b/examples/processor_signal_evaluate.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -16,6 +16,7 @@ async fn main() { user_agent: Some("your user agent".to_owned()), }) .is_recurring(true) + .ruleset_key("your ruleset key") .user(SignalUser { address: Some(SignalAddressData { city: Some("your city".to_owned()), @@ -38,4 +39,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_signal_prepare.rs b/examples/processor_signal_prepare.rs index 8829e117..5e52149c 100644 --- a/examples/processor_signal_prepare.rs +++ b/examples/processor_signal_prepare.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let processor_token = "your processor token"; let response = client.processor_signal_prepare(processor_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_signal_return_report.rs b/examples/processor_signal_return_report.rs index 673f701d..2f4c7103 100644 --- a/examples/processor_signal_return_report.rs +++ b/examples/processor_signal_return_report.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -17,4 +17,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_stripe_bank_account_token_create.rs b/examples/processor_stripe_bank_account_token_create.rs index 534bb6a8..03d06e99 100644 --- a/examples/processor_stripe_bank_account_token_create.rs +++ b/examples/processor_stripe_bank_account_token_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_token_create.rs b/examples/processor_token_create.rs index 12e1b417..1bd643fc 100644 --- a/examples/processor_token_create.rs +++ b/examples/processor_token_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_token_permissions_get.rs b/examples/processor_token_permissions_get.rs index a65fc73e..a0e422e5 100644 --- a/examples/processor_token_permissions_get.rs +++ b/examples/processor_token_permissions_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_token_permissions_set.rs b/examples/processor_token_permissions_set.rs index 16917bed..ea547731 100644 --- a/examples/processor_token_permissions_set.rs +++ b/examples/processor_token_permissions_set.rs @@ -1,14 +1,14 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let processor_token = "your processor token"; - let products = &["your products"]; + let products = vec![Products::Assets]; let response = client .processor_token_permissions_set(processor_token, products) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_token_webhook_update.rs b/examples/processor_token_webhook_update.rs index 323febda..e83d2a2a 100644 --- a/examples/processor_token_webhook_update.rs +++ b/examples/processor_token_webhook_update.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_transactions_get.rs b/examples/processor_transactions_get.rs index 725ce368..15203409 100644 --- a/examples/processor_transactions_get.rs +++ b/examples/processor_transactions_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -20,4 +20,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_transactions_recurring_get.rs b/examples/processor_transactions_recurring_get.rs index 57a79408..01e8f5e6 100644 --- a/examples/processor_transactions_recurring_get.rs +++ b/examples/processor_transactions_recurring_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_transactions_refresh.rs b/examples/processor_transactions_refresh.rs index 11925295..bf23a915 100644 --- a/examples/processor_transactions_refresh.rs +++ b/examples/processor_transactions_refresh.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let processor_token = "your processor token"; let response = client.processor_transactions_refresh(processor_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/processor_transactions_sync.rs b/examples/processor_transactions_sync.rs index 6e3234f5..6e314db5 100644 --- a/examples/processor_transactions_sync.rs +++ b/examples/processor_transactions_sync.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -18,4 +18,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/profile_get.rs b/examples/profile_get.rs new file mode 100644 index 00000000..b833e7bf --- /dev/null +++ b/examples/profile_get.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let profile_token = "your profile token"; + let response = client.profile_get(profile_token).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/profile_network_status_get.rs b/examples/profile_network_status_get.rs new file mode 100644 index 00000000..35d9a549 --- /dev/null +++ b/examples/profile_network_status_get.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let user = ProfileNetworkStatusGetUser { + phone_number: "your phone number".to_owned(), + }; + let response = client.profile_network_status_get(user).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/sandbox_bank_income_fire_webhook.rs b/examples/sandbox_bank_income_fire_webhook.rs index cddd6c9c..f0e96af3 100644 --- a/examples/sandbox_bank_income_fire_webhook.rs +++ b/examples/sandbox_bank_income_fire_webhook.rs @@ -1,13 +1,13 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let webhook_code = "your webhook code"; + let webhook_code = SandboxBankIncomeWebhookFireRequestWebhookCode::BankIncomeRefreshUpdate; let webhook_fields = SandboxBankIncomeWebhookFireRequestWebhookFields { bank_income_refresh_complete_result: Some( - "your bank income refresh complete result".to_owned(), + BankIncomeRefreshCompleteResult::Success, ), user_id: "your user id".to_owned(), }; @@ -17,4 +17,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_bank_transfer_fire_webhook.rs b/examples/sandbox_bank_transfer_fire_webhook.rs index b0a55784..474d39cc 100644 --- a/examples/sandbox_bank_transfer_fire_webhook.rs +++ b/examples/sandbox_bank_transfer_fire_webhook.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let webhook = "your webhook"; let response = client.sandbox_bank_transfer_fire_webhook(webhook).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_bank_transfer_simulate.rs b/examples/sandbox_bank_transfer_simulate.rs index c42a3d3e..9f41f52b 100644 --- a/examples/sandbox_bank_transfer_simulate.rs +++ b/examples/sandbox_bank_transfer_simulate.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -15,4 +15,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_income_fire_webhook.rs b/examples/sandbox_income_fire_webhook.rs index 8b12519e..95d395ae 100644 --- a/examples/sandbox_income_fire_webhook.rs +++ b/examples/sandbox_income_fire_webhook.rs @@ -1,12 +1,12 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let item_id = "your item id"; let webhook = "your webhook"; - let webhook_code = "your webhook code"; + let webhook_code = SandboxIncomeWebhookFireRequestWebhookCode::IncomeVerification; let response = client .sandbox_income_fire_webhook(item_id, webhook, webhook_code) .user_id("your user id") @@ -14,4 +14,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_item_fire_webhook.rs b/examples/sandbox_item_fire_webhook.rs index edfbd1f6..a7ab5670 100644 --- a/examples/sandbox_item_fire_webhook.rs +++ b/examples/sandbox_item_fire_webhook.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -8,8 +8,8 @@ async fn main() { let webhook_code = "your webhook code"; let response = client .sandbox_item_fire_webhook(access_token, webhook_code) - .webhook_type("your webhook type") + .webhook_type(WebhookType::Auth) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_item_reset_login.rs b/examples/sandbox_item_reset_login.rs index 1b761304..cf5ca27d 100644 --- a/examples/sandbox_item_reset_login.rs +++ b/examples/sandbox_item_reset_login.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.sandbox_item_reset_login(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_item_set_verification_status.rs b/examples/sandbox_item_set_verification_status.rs index 3cede0f4..21390f27 100644 --- a/examples/sandbox_item_set_verification_status.rs +++ b/examples/sandbox_item_set_verification_status.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -16,4 +16,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_oauth_select_accounts.rs b/examples/sandbox_oauth_select_accounts.rs index 74051a9b..f85bfdd6 100644 --- a/examples/sandbox_oauth_select_accounts.rs +++ b/examples/sandbox_oauth_select_accounts.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_payment_profile_reset_login.rs b/examples/sandbox_payment_profile_reset_login.rs index a74bb3f5..7ff31d5b 100644 --- a/examples/sandbox_payment_profile_reset_login.rs +++ b/examples/sandbox_payment_profile_reset_login.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_processor_token_create.rs b/examples/sandbox_processor_token_create.rs index 1c7be881..91819af7 100644 --- a/examples/sandbox_processor_token_create.rs +++ b/examples/sandbox_processor_token_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -14,4 +14,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_public_token_create.rs b/examples/sandbox_public_token_create.rs index fe731d36..ce577117 100644 --- a/examples/sandbox_public_token_create.rs +++ b/examples/sandbox_public_token_create.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let initial_products = &["your initial products"]; + let initial_products = vec![Products::Assets]; let institution_id = "your institution id"; let response = client .sandbox_public_token_create(initial_products, institution_id) @@ -13,10 +13,14 @@ async fn main() { bank_income: Some(SandboxPublicTokenCreateRequestIncomeVerificationBankIncome { days_requested: Some(1), }), - income_source_types: Some(vec!["your income source types".to_owned()]), + income_source_types: Some(vec![IncomeVerificationSourceType::Bank]), }), override_password: Some("your override password".to_owned()), override_username: Some("your override username".to_owned()), + statements: Some(SandboxPublicTokenCreateRequestOptionsStatements { + end_date: chrono::Utc::now().date_naive(), + start_date: chrono::Utc::now().date_naive(), + }), transactions: Some(SandboxPublicTokenCreateRequestOptionsTransactions { days_requested: Some(1), end_date: Some(chrono::Utc::now().date_naive()), @@ -28,4 +32,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_fire_webhook.rs b/examples/sandbox_transfer_fire_webhook.rs index 7b430aaf..41946756 100644 --- a/examples/sandbox_transfer_fire_webhook.rs +++ b/examples/sandbox_transfer_fire_webhook.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let webhook = "your webhook"; let response = client.sandbox_transfer_fire_webhook(webhook).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_ledger_deposit_simulate.rs b/examples/sandbox_transfer_ledger_deposit_simulate.rs index 80dbda4d..d0cb33ae 100644 --- a/examples/sandbox_transfer_ledger_deposit_simulate.rs +++ b/examples/sandbox_transfer_ledger_deposit_simulate.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let event_type = "your event type"; + let event_type = TransferLedgerSweepSimulateEventType::SweepPosted; let sweep_id = "your sweep id"; let response = client .sandbox_transfer_ledger_deposit_simulate(event_type, sweep_id) @@ -15,4 +15,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_ledger_simulate_available.rs b/examples/sandbox_transfer_ledger_simulate_available.rs index afdeb829..7c161f32 100644 --- a/examples/sandbox_transfer_ledger_simulate_available.rs +++ b/examples/sandbox_transfer_ledger_simulate_available.rs @@ -1,13 +1,15 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let response = client .sandbox_transfer_ledger_simulate_available() + .ledger_id("your ledger id") .test_clock_id("your test clock id") + .webhook("your webhook") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_ledger_withdraw_simulate.rs b/examples/sandbox_transfer_ledger_withdraw_simulate.rs index 84f3b8a4..530cc769 100644 --- a/examples/sandbox_transfer_ledger_withdraw_simulate.rs +++ b/examples/sandbox_transfer_ledger_withdraw_simulate.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let event_type = "your event type"; + let event_type = TransferLedgerSweepSimulateEventType::SweepPosted; let sweep_id = "your sweep id"; let response = client .sandbox_transfer_ledger_withdraw_simulate(event_type, sweep_id) @@ -15,4 +15,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_refund_simulate.rs b/examples/sandbox_transfer_refund_simulate.rs index a38e2951..efbdb8df 100644 --- a/examples/sandbox_transfer_refund_simulate.rs +++ b/examples/sandbox_transfer_refund_simulate.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,7 +13,8 @@ async fn main() { description: Some("your description".to_owned()), }) .test_clock_id("your test clock id") + .webhook("your webhook") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_repayment_simulate.rs b/examples/sandbox_transfer_repayment_simulate.rs index 868ecc02..a102cae7 100644 --- a/examples/sandbox_transfer_repayment_simulate.rs +++ b/examples/sandbox_transfer_repayment_simulate.rs @@ -1,9 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let response = client.sandbox_transfer_repayment_simulate().await.unwrap(); + let body = serde_json::json!({}); + let response = client.sandbox_transfer_repayment_simulate(body).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_simulate.rs b/examples/sandbox_transfer_simulate.rs index 7e321736..35abde51 100644 --- a/examples/sandbox_transfer_simulate.rs +++ b/examples/sandbox_transfer_simulate.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,7 +13,8 @@ async fn main() { description: Some("your description".to_owned()), }) .test_clock_id("your test clock id") + .webhook("your webhook") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_sweep_simulate.rs b/examples/sandbox_transfer_sweep_simulate.rs index 75ebe48f..65a78064 100644 --- a/examples/sandbox_transfer_sweep_simulate.rs +++ b/examples/sandbox_transfer_sweep_simulate.rs @@ -1,13 +1,14 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let response = client .sandbox_transfer_sweep_simulate() .test_clock_id("your test clock id") + .webhook("your webhook") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_test_clock_advance.rs b/examples/sandbox_transfer_test_clock_advance.rs index c3f4854f..29691269 100644 --- a/examples/sandbox_transfer_test_clock_advance.rs +++ b/examples/sandbox_transfer_test_clock_advance.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_test_clock_create.rs b/examples/sandbox_transfer_test_clock_create.rs index f60468e7..4f5d2a75 100644 --- a/examples/sandbox_transfer_test_clock_create.rs +++ b/examples/sandbox_transfer_test_clock_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_test_clock_get.rs b/examples/sandbox_transfer_test_clock_get.rs index a582236d..6030585e 100644 --- a/examples/sandbox_transfer_test_clock_get.rs +++ b/examples/sandbox_transfer_test_clock_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let test_clock_id = "your test clock id"; let response = client.sandbox_transfer_test_clock_get(test_clock_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_transfer_test_clock_list.rs b/examples/sandbox_transfer_test_clock_list.rs index 22bea284..d3976797 100644 --- a/examples/sandbox_transfer_test_clock_list.rs +++ b/examples/sandbox_transfer_test_clock_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/sandbox_user_reset_login.rs b/examples/sandbox_user_reset_login.rs new file mode 100644 index 00000000..5f48566b --- /dev/null +++ b/examples/sandbox_user_reset_login.rs @@ -0,0 +1,14 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let user_token = "your user token"; + let response = client + .sandbox_user_reset_login(user_token) + .item_ids(&["your item ids"]) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/signal_decision_report.rs b/examples/signal_decision_report.rs index 9a9610e5..cb5e4cb7 100644 --- a/examples/signal_decision_report.rs +++ b/examples/signal_decision_report.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,9 +10,9 @@ async fn main() { .signal_decision_report(client_transaction_id, initiated) .amount_instantly_available(1.0) .days_funds_on_hold(1) - .decision_outcome("your decision outcome") - .payment_method("your payment method") + .decision_outcome(SignalDecisionOutcome::Approve) + .payment_method(SignalPaymentMethod::SameDayAch) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/signal_evaluate.rs b/examples/signal_evaluate.rs index 779c7387..7783857f 100644 --- a/examples/signal_evaluate.rs +++ b/examples/signal_evaluate.rs @@ -1,18 +1,21 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::SignalEvaluateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = SignalEvaluateRequired { - access_token: "your access token", - account_id: "your account id", - amount: 1.0, - client_transaction_id: "your client transaction id", - }; + let access_token = "your access token"; + let account_id = "your account id"; + let amount = 1.0; + let client_transaction_id = "your client transaction id"; let response = client - .signal_evaluate(args) + .signal_evaluate(SignalEvaluateRequired { + access_token, + account_id, + amount, + client_transaction_id, + }) .client_user_id("your client user id") .default_payment_method("your default payment method") .device(SignalDevice { @@ -21,6 +24,7 @@ async fn main() { }) .is_recurring(true) .risk_profile_key("your risk profile key") + .ruleset_key("your ruleset key") .user(SignalUser { address: Some(SignalAddressData { city: Some("your city".to_owned()), @@ -43,4 +47,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/signal_prepare.rs b/examples/signal_prepare.rs index 2efe2c4a..ab8fc092 100644 --- a/examples/signal_prepare.rs +++ b/examples/signal_prepare.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.signal_prepare(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/signal_return_report.rs b/examples/signal_return_report.rs index 5f39ac10..10417ee8 100644 --- a/examples/signal_return_report.rs +++ b/examples/signal_return_report.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/statements_download.rs b/examples/statements_download.rs index 45ea8383..33d3bb33 100644 --- a/examples/statements_download.rs +++ b/examples/statements_download.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -8,4 +8,4 @@ async fn main() { let statement_id = "your statement id"; let response = client.statements_download(access_token, statement_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/statements_list.rs b/examples/statements_list.rs index b89a2f0f..99c28ad0 100644 --- a/examples/statements_list.rs +++ b/examples/statements_list.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.statements_list(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/statements_refresh.rs b/examples/statements_refresh.rs index dbbae89a..616565af 100644 --- a/examples/statements_refresh.rs +++ b/examples/statements_refresh.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_enhance.rs b/examples/transactions_enhance.rs index 56abb66c..dfe2870a 100644 --- a/examples/transactions_enhance.rs +++ b/examples/transactions_enhance.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -15,4 +15,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_enrich.rs b/examples/transactions_enrich.rs index a62fb753..56834d37 100644 --- a/examples/transactions_enrich.rs +++ b/examples/transactions_enrich.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,8 +11,8 @@ async fn main() { client_account_id : Some("your client account id".to_owned()), client_user_id : Some("your client user id".to_owned()), date_posted : Some(chrono::Utc::now() .date_naive()), description : "your description".to_owned(), direction : - "your direction".to_owned(), id : "your id".to_owned(), iso_currency_code : - "your iso currency code".to_owned(), location : + EnrichTransactionDirection::Inflow, id : "your id".to_owned(), iso_currency_code + : "your iso currency code".to_owned(), location : Some(ClientProvidedTransactionLocation { address : Some("your address" .to_owned()), city : Some("your city".to_owned()), country : Some("your country" .to_owned()), postal_code : Some("your postal code".to_owned()), region : @@ -26,4 +26,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_get.rs b/examples/transactions_get.rs index e5ec3c4f..b6d7a3c3 100644 --- a/examples/transactions_get.rs +++ b/examples/transactions_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -22,4 +22,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_recurring_get.rs b/examples/transactions_recurring_get.rs index 23d58b54..076427de 100644 --- a/examples/transactions_recurring_get.rs +++ b/examples/transactions_recurring_get.rs @@ -1,17 +1,17 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; - let account_ids = &["your account ids"]; let response = client - .transactions_recurring_get(access_token, account_ids) + .transactions_recurring_get(access_token) + .account_ids(&["your account ids"]) .options(TransactionsRecurringGetRequestOptions { include_personal_finance_category: Some(true), }) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_refresh.rs b/examples/transactions_refresh.rs index a8d0e7fe..f353a3af 100644 --- a/examples/transactions_refresh.rs +++ b/examples/transactions_refresh.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.transactions_refresh(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_rules_create.rs b/examples/transactions_rules_create.rs index f5374d34..1f57b593 100644 --- a/examples/transactions_rules_create.rs +++ b/examples/transactions_rules_create.rs @@ -1,19 +1,19 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let personal_finance_category = "your personal finance category"; let rule_details = TransactionsRuleDetails { - field: "your field".to_owned(), + field: TransactionsRuleField::TransactionId, query: "your query".to_owned(), - type_: "your type".to_owned(), + type_: TransactionsRuleType::ExactMatch, }; let response = client .transactions_rules_create(access_token, personal_finance_category, rule_details) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_rules_list.rs b/examples/transactions_rules_list.rs index ee455f34..65a0e328 100644 --- a/examples/transactions_rules_list.rs +++ b/examples/transactions_rules_list.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let access_token = "your access token"; let response = client.transactions_rules_list(access_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_rules_remove.rs b/examples/transactions_rules_remove.rs index a4493818..c0513514 100644 --- a/examples/transactions_rules_remove.rs +++ b/examples/transactions_rules_remove.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_sync.rs b/examples/transactions_sync.rs index 9bcf32d5..a90ffe12 100644 --- a/examples/transactions_sync.rs +++ b/examples/transactions_sync.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -18,4 +18,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transactions_user_insights_get.rs b/examples/transactions_user_insights_get.rs index fa403d2f..3d77dc0f 100644 --- a/examples/transactions_user_insights_get.rs +++ b/examples/transactions_user_insights_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let client_user_id = "your client user id"; let response = client.transactions_user_insights_get(client_user_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_authorization_cancel.rs b/examples/transfer_authorization_cancel.rs new file mode 100644 index 00000000..86b5268a --- /dev/null +++ b/examples/transfer_authorization_cancel.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let authorization_id = "your authorization id"; + let response = client.transfer_authorization_cancel(authorization_id).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/transfer_authorization_create.rs b/examples/transfer_authorization_create.rs index 2de20c3b..bbd2f72b 100644 --- a/examples/transfer_authorization_create.rs +++ b/examples/transfer_authorization_create.rs @@ -1,32 +1,37 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::TransferAuthorizationCreateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = TransferAuthorizationCreateRequired { - access_token: "your access token", - account_id: "your account id", - amount: "your amount", - network: "your network", - type_: "your type", - user: TransferAuthorizationUserInRequest { - address: Some(TransferUserAddressInRequest { - city: Some("your city".to_owned()), - country: Some("your country".to_owned()), - postal_code: Some("your postal code".to_owned()), - region: Some("your region".to_owned()), - street: Some("your street".to_owned()), - }), - email_address: Some("your email address".to_owned()), - legal_name: "your legal name".to_owned(), - phone_number: Some("your phone number".to_owned()), - }, + let access_token = "your access token"; + let account_id = "your account id"; + let amount = "your amount"; + let network = TransferNetwork::Ach; + let type_ = TransferType::Debit; + let user = TransferAuthorizationUserInRequest { + address: Some(TransferUserAddressInRequest { + city: Some("your city".to_owned()), + country: Some("your country".to_owned()), + postal_code: Some("your postal code".to_owned()), + region: Some("your region".to_owned()), + street: Some("your street".to_owned()), + }), + email_address: Some("your email address".to_owned()), + legal_name: "your legal name".to_owned(), + phone_number: Some("your phone number".to_owned()), }; let response = client - .transfer_authorization_create(args) - .ach_class("your ach class") + .transfer_authorization_create(TransferAuthorizationCreateRequired { + access_token, + account_id, + amount, + network, + type_, + user, + }) + .ach_class(AchClass::Ccd) .beacon_session_id("your beacon session id") .credit_funds_source(TransferCreditFundsSource(serde_json::json!({}))) .device(TransferAuthorizationDevice { @@ -36,13 +41,17 @@ async fn main() { .funding_account_id("your funding account id") .idempotency_key("your idempotency key") .iso_currency_code("your iso currency code") + .ledger_id("your ledger id") .origination_account_id("your origination account id") .originator_client_id("your originator client id") .payment_profile_token("your payment profile token") .test_clock_id("your test clock id") .user_present(true) + .wire_details(TransferWireDetails { + message_to_beneficiary: Some("your message to beneficiary".to_owned()), + }) .with_guarantee(true) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_balance_get.rs b/examples/transfer_balance_get.rs index e759b44c..ac7c1957 100644 --- a/examples/transfer_balance_get.rs +++ b/examples/transfer_balance_get.rs @@ -1,14 +1,14 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let response = client .transfer_balance_get() .originator_client_id("your originator client id") - .type_("your type") + .type_(TransferBalanceType::PrefundedRtpCredits) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_cancel.rs b/examples/transfer_cancel.rs index a615c82a..d77a56ce 100644 --- a/examples/transfer_cancel.rs +++ b/examples/transfer_cancel.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_capabilities_get.rs b/examples/transfer_capabilities_get.rs index c3d3851a..fe93c259 100644 --- a/examples/transfer_capabilities_get.rs +++ b/examples/transfer_capabilities_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_configuration_get.rs b/examples/transfer_configuration_get.rs index 904ef9be..8ebffc26 100644 --- a/examples/transfer_configuration_get.rs +++ b/examples/transfer_configuration_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_create.rs b/examples/transfer_create.rs index ecf2ef27..44415ef4 100644 --- a/examples/transfer_create.rs +++ b/examples/transfer_create.rs @@ -1,28 +1,31 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::TransferCreateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = TransferCreateRequired { - access_token: "your access token", - account_id: "your account id", - authorization_id: "your authorization id", - description: "your description", - }; + let access_token = "your access token"; + let account_id = "your account id"; + let authorization_id = "your authorization id"; + let description = "your description"; let response = client - .transfer_create(args) - .ach_class("your ach class") + .transfer_create(TransferCreateRequired { + access_token, + account_id, + authorization_id, + description, + }) + .ach_class(AchClass::Ccd) .amount("your amount") .facilitator_fee("your facilitator fee") .idempotency_key("your idempotency key") .iso_currency_code("your iso currency code") - .metadata(TransferMetadata {}) - .network("your network") + .metadata("your transfer metadata") + .network(TransferNetwork::Ach) .origination_account_id("your origination account id") .test_clock_id("your test clock id") - .type_("your type") + .type_(TransferType::Debit) .user(TransferUserInRequestDeprecated { address: Some(TransferUserAddressInRequest { city: Some("your city".to_owned()), @@ -38,4 +41,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_diligence_document_upload.rs b/examples/transfer_diligence_document_upload.rs index a58b969a..1b5b731c 100644 --- a/examples/transfer_diligence_document_upload.rs +++ b/examples/transfer_diligence_document_upload.rs @@ -1,15 +1,15 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let file = "your file"; let originator_client_id = "your originator client id"; - let purpose = "your purpose"; + let purpose = TransferDocumentPurpose::DueDiligence; let response = client .transfer_diligence_document_upload(file, originator_client_id, purpose) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_diligence_submit.rs b/examples/transfer_diligence_submit.rs index a41c53c0..bc1de3eb 100644 --- a/examples/transfer_diligence_submit.rs +++ b/examples/transfer_diligence_submit.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -15,18 +15,18 @@ async fn main() { }, credit_usage_configuration: Some(TransferCreditUsageConfiguration { expected_average_amount: "your expected average amount".to_owned(), - expected_frequency: "your expected frequency".to_owned(), + expected_frequency: OriginatorExpectedTransferFrequency::OncePerMonth, expected_highest_amount: "your expected highest amount".to_owned(), expected_monthly_amount: "your expected monthly amount".to_owned(), - sec_codes: vec!["your sec codes".to_owned()], + sec_codes: vec![CreditAchClass::Ccd], }), dba: "your dba".to_owned(), debit_usage_configuration: Some(TransferDebitUsageConfiguration { expected_average_amount: "your expected average amount".to_owned(), - expected_frequency: "your expected frequency".to_owned(), + expected_frequency: OriginatorExpectedTransferFrequency::OncePerMonth, expected_highest_amount: "your expected highest amount".to_owned(), expected_monthly_amount: "your expected monthly amount".to_owned(), - sec_codes: vec!["your sec codes".to_owned()], + sec_codes: vec![AchClass::Ccd], }), funding_account: TransferFundingAccount { access_token: "your access token".to_owned(), @@ -41,4 +41,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_event_list.rs b/examples/transfer_event_list.rs index 66aa05f2..fed262a0 100644 --- a/examples/transfer_event_list.rs +++ b/examples/transfer_event_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -9,7 +9,7 @@ async fn main() { .account_id("your account id") .count(1) .end_date(chrono::Utc::now()) - .event_types(&["your event types"]) + .event_types(vec![TransferEventType::Pending]) .funding_account_id("your funding account id") .offset(1) .origination_account_id("your origination account id") @@ -21,4 +21,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_event_sync.rs b/examples/transfer_event_sync.rs index deb85f55..761ccb29 100644 --- a/examples/transfer_event_sync.rs +++ b/examples/transfer_event_sync.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let after_id = 1; let response = client.transfer_event_sync(after_id).count(1).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_get.rs b/examples/transfer_get.rs index 82982041..522cd452 100644 --- a/examples/transfer_get.rs +++ b/examples/transfer_get.rs @@ -1,14 +1,15 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let transfer_id = "your transfer id"; let response = client - .transfer_get(transfer_id) + .transfer_get() + .authorization_id("your authorization id") .originator_client_id("your originator client id") + .transfer_id("your transfer id") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_intent_create.rs b/examples/transfer_intent_create.rs index 349dabcb..14549f83 100644 --- a/examples/transfer_intent_create.rs +++ b/examples/transfer_intent_create.rs @@ -1,38 +1,41 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::TransferIntentCreateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = TransferIntentCreateRequired { - amount: "your amount", - description: "your description", - mode: "your mode", - user: TransferUserInRequest { - address: Some(TransferUserAddressInRequest { - city: Some("your city".to_owned()), - country: Some("your country".to_owned()), - postal_code: Some("your postal code".to_owned()), - region: Some("your region".to_owned()), - street: Some("your street".to_owned()), - }), - email_address: Some("your email address".to_owned()), - legal_name: "your legal name".to_owned(), - phone_number: Some("your phone number".to_owned()), - }, + let amount = "your amount"; + let description = "your description"; + let mode = TransferIntentCreateMode::Payment; + let user = TransferUserInRequest { + address: Some(TransferUserAddressInRequest { + city: Some("your city".to_owned()), + country: Some("your country".to_owned()), + postal_code: Some("your postal code".to_owned()), + region: Some("your region".to_owned()), + street: Some("your street".to_owned()), + }), + email_address: Some("your email address".to_owned()), + legal_name: "your legal name".to_owned(), + phone_number: Some("your phone number".to_owned()), }; let response = client - .transfer_intent_create(args) + .transfer_intent_create(TransferIntentCreateRequired { + amount, + description, + mode, + user, + }) .account_id("your account id") - .ach_class("your ach class") + .ach_class(AchClass::Ccd) .funding_account_id("your funding account id") .iso_currency_code("your iso currency code") - .metadata(TransferMetadata {}) - .network("your network") + .metadata("your transfer metadata") + .network(TransferIntentCreateNetwork::Ach) .origination_account_id("your origination account id") .require_guarantee(true) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_intent_get.rs b/examples/transfer_intent_get.rs index 3bf42fc4..e890de26 100644 --- a/examples/transfer_intent_get.rs +++ b/examples/transfer_intent_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let transfer_intent_id = "your transfer intent id"; let response = client.transfer_intent_get(transfer_intent_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_ledger_deposit.rs b/examples/transfer_ledger_deposit.rs index 9cbd2227..8cd49456 100644 --- a/examples/transfer_ledger_deposit.rs +++ b/examples/transfer_ledger_deposit.rs @@ -1,18 +1,19 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let amount = "your amount"; let idempotency_key = "your idempotency key"; - let network = "your network"; + let network = TransferAchNetwork::Ach; let response = client .transfer_ledger_deposit(amount, idempotency_key, network) .description("your description") .funding_account_id("your funding account id") + .ledger_id("your ledger id") .originator_client_id("your originator client id") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_ledger_distribute.rs b/examples/transfer_ledger_distribute.rs index 54263cd2..3d9ce84d 100644 --- a/examples/transfer_ledger_distribute.rs +++ b/examples/transfer_ledger_distribute.rs @@ -1,20 +1,23 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::TransferLedgerDistributeRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = TransferLedgerDistributeRequired { - amount: "your amount", - from_client_id: "your from client id", - idempotency_key: "your idempotency key", - to_client_id: "your to client id", - }; + let amount = "your amount"; + let from_ledger_id = "your from ledger id"; + let idempotency_key = "your idempotency key"; + let to_ledger_id = "your to ledger id"; let response = client - .transfer_ledger_distribute(args) + .transfer_ledger_distribute(TransferLedgerDistributeRequired { + amount, + from_ledger_id, + idempotency_key, + to_ledger_id, + }) .description("your description") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_ledger_get.rs b/examples/transfer_ledger_get.rs index 4dc769d1..3ef891d1 100644 --- a/examples/transfer_ledger_get.rs +++ b/examples/transfer_ledger_get.rs @@ -1,13 +1,14 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let response = client .transfer_ledger_get() + .ledger_id("your ledger id") .originator_client_id("your originator client id") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_ledger_withdraw.rs b/examples/transfer_ledger_withdraw.rs index 40bc162b..8bcaf156 100644 --- a/examples/transfer_ledger_withdraw.rs +++ b/examples/transfer_ledger_withdraw.rs @@ -1,18 +1,19 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let amount = "your amount"; let idempotency_key = "your idempotency key"; - let network = "your network"; + let network = TransferNetwork::Ach; let response = client .transfer_ledger_withdraw(amount, idempotency_key, network) .description("your description") .funding_account_id("your funding account id") + .ledger_id("your ledger id") .originator_client_id("your originator client id") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_list.rs b/examples/transfer_list.rs index a5fdf6a5..1da99a2c 100644 --- a/examples/transfer_list.rs +++ b/examples/transfer_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -16,4 +16,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_metrics_get.rs b/examples/transfer_metrics_get.rs index cb6383f3..803d0ec0 100644 --- a/examples/transfer_metrics_get.rs +++ b/examples/transfer_metrics_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_migrate_account.rs b/examples/transfer_migrate_account.rs index 3ab66bd7..3c8b102c 100644 --- a/examples/transfer_migrate_account.rs +++ b/examples/transfer_migrate_account.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_originator_create.rs b/examples/transfer_originator_create.rs index 07f1447a..4388789e 100644 --- a/examples/transfer_originator_create.rs +++ b/examples/transfer_originator_create.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let company_name = "your company name"; let response = client.transfer_originator_create(company_name).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_originator_funding_account_update.rs b/examples/transfer_originator_funding_account_update.rs index 9600a60f..d5156b75 100644 --- a/examples/transfer_originator_funding_account_update.rs +++ b/examples/transfer_originator_funding_account_update.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -17,4 +17,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_originator_get.rs b/examples/transfer_originator_get.rs index a1445c94..cfb7705b 100644 --- a/examples/transfer_originator_get.rs +++ b/examples/transfer_originator_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let originator_client_id = "your originator client id"; let response = client.transfer_originator_get(originator_client_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_originator_list.rs b/examples/transfer_originator_list.rs index a502fcc1..e7978c40 100644 --- a/examples/transfer_originator_list.rs +++ b/examples/transfer_originator_list.rs @@ -1,9 +1,9 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let response = client.transfer_originator_list().count(1).offset(1).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_platform_originator_create.rs b/examples/transfer_platform_originator_create.rs new file mode 100644 index 00000000..867cd67f --- /dev/null +++ b/examples/transfer_platform_originator_create.rs @@ -0,0 +1,23 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let originator_client_id = "your originator client id"; + let originator_reviewed_at = chrono::Utc::now(); + let tos_acceptance_metadata = TransferPlatformTosAcceptanceMetadata { + agreement_accepted: true, + agreement_accepted_at: chrono::Utc::now(), + originator_ip_address: "your originator ip address".to_owned(), + }; + let response = client + .transfer_platform_originator_create( + originator_client_id, + originator_reviewed_at, + tos_acceptance_metadata, + ) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/transfer_platform_person_create.rs b/examples/transfer_platform_person_create.rs new file mode 100644 index 00000000..1bd79b13 --- /dev/null +++ b/examples/transfer_platform_person_create.rs @@ -0,0 +1,33 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let originator_client_id = "your originator client id"; + let response = client + .transfer_platform_person_create(originator_client_id) + .address(TransferPlatformPersonAddress { + city: "your city".to_owned(), + country: "your country".to_owned(), + postal_code: "your postal code".to_owned(), + region: "your region".to_owned(), + street: "your street".to_owned(), + street2: Some("your street 2".to_owned()), + }) + .date_of_birth(chrono::Utc::now().date_naive()) + .email_address("your email address") + .id_number(TransferPlatformPersonIdNumber { + type_: IdNumberType::ArDni, + value: "your value".to_owned(), + }) + .name(TransferPlatformPersonName { + family_name: "your family name".to_owned(), + given_name: "your given name".to_owned(), + }) + .phone_number("your phone number") + .relationship_to_originator("your relationship to originator") + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/transfer_platform_requirement_submit.rs b/examples/transfer_platform_requirement_submit.rs new file mode 100644 index 00000000..906eb6d5 --- /dev/null +++ b/examples/transfer_platform_requirement_submit.rs @@ -0,0 +1,21 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let originator_client_id = "your originator client id"; + let requirement_submissions = vec![ + TransferPlatformRequirementSubmission { person_id : Some("your person id" + .to_owned()), requirement_type : "your requirement type".to_owned(), value : + "your value".to_owned() } + ]; + let response = client + .transfer_platform_requirement_submit( + originator_client_id, + requirement_submissions, + ) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/transfer_questionnaire_create.rs b/examples/transfer_questionnaire_create.rs index 45798711..c42e983b 100644 --- a/examples/transfer_questionnaire_create.rs +++ b/examples/transfer_questionnaire_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_recurring_cancel.rs b/examples/transfer_recurring_cancel.rs index 0c5e4305..565cb739 100644 --- a/examples/transfer_recurring_cancel.rs +++ b/examples/transfer_recurring_cancel.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_recurring_create.rs b/examples/transfer_recurring_create.rs index c03805e4..db46d1f9 100644 --- a/examples/transfer_recurring_create.rs +++ b/examples/transfer_recurring_create.rs @@ -1,41 +1,49 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::TransferRecurringCreateRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = TransferRecurringCreateRequired { - access_token: "your access token", - account_id: "your account id", - amount: "your amount", - description: "your description", - idempotency_key: "your idempotency key", - network: "your network", - schedule: TransferRecurringSchedule { - end_date: Some(chrono::Utc::now().date_naive()), - interval_count: 1, - interval_execution_day: 1, - interval_unit: "your interval unit".to_owned(), - start_date: chrono::Utc::now().date_naive(), - }, - type_: "your type", - user: TransferUserInRequest { - address: Some(TransferUserAddressInRequest { - city: Some("your city".to_owned()), - country: Some("your country".to_owned()), - postal_code: Some("your postal code".to_owned()), - region: Some("your region".to_owned()), - street: Some("your street".to_owned()), - }), - email_address: Some("your email address".to_owned()), - legal_name: "your legal name".to_owned(), - phone_number: Some("your phone number".to_owned()), - }, + let access_token = "your access token"; + let account_id = "your account id"; + let amount = "your amount"; + let description = "your description"; + let idempotency_key = "your idempotency key"; + let network = TransferRecurringNetwork::Ach; + let schedule = TransferRecurringSchedule { + end_date: Some(chrono::Utc::now().date_naive()), + interval_count: 1, + interval_execution_day: 1, + interval_unit: TransferScheduleIntervalUnit::Week, + start_date: chrono::Utc::now().date_naive(), + }; + let type_ = TransferType::Debit; + let user = TransferUserInRequest { + address: Some(TransferUserAddressInRequest { + city: Some("your city".to_owned()), + country: Some("your country".to_owned()), + postal_code: Some("your postal code".to_owned()), + region: Some("your region".to_owned()), + street: Some("your street".to_owned()), + }), + email_address: Some("your email address".to_owned()), + legal_name: "your legal name".to_owned(), + phone_number: Some("your phone number".to_owned()), }; let response = client - .transfer_recurring_create(args) - .ach_class("your ach class") + .transfer_recurring_create(TransferRecurringCreateRequired { + access_token, + account_id, + amount, + description, + idempotency_key, + network, + schedule, + type_, + user, + }) + .ach_class(AchClass::Ccd) .device(TransferDevice { ip_address: "your ip address".to_owned(), user_agent: "your user agent".to_owned(), @@ -47,4 +55,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_recurring_get.rs b/examples/transfer_recurring_get.rs index 074a1ec5..426f3f0e 100644 --- a/examples/transfer_recurring_get.rs +++ b/examples/transfer_recurring_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let recurring_transfer_id = "your recurring transfer id"; let response = client.transfer_recurring_get(recurring_transfer_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_recurring_list.rs b/examples/transfer_recurring_list.rs index 70d08bd8..e7fe801e 100644 --- a/examples/transfer_recurring_list.rs +++ b/examples/transfer_recurring_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -14,4 +14,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_refund_cancel.rs b/examples/transfer_refund_cancel.rs index 45cc022f..85a126da 100644 --- a/examples/transfer_refund_cancel.rs +++ b/examples/transfer_refund_cancel.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let refund_id = "your refund id"; let response = client.transfer_refund_cancel(refund_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_refund_create.rs b/examples/transfer_refund_create.rs index d24155ca..2954f2da 100644 --- a/examples/transfer_refund_create.rs +++ b/examples/transfer_refund_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_refund_get.rs b/examples/transfer_refund_get.rs index 71099645..2af7dc48 100644 --- a/examples/transfer_refund_get.rs +++ b/examples/transfer_refund_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let refund_id = "your refund id"; let response = client.transfer_refund_get(refund_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_repayment_list.rs b/examples/transfer_repayment_list.rs index bb7d19f9..bcff004f 100644 --- a/examples/transfer_repayment_list.rs +++ b/examples/transfer_repayment_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -13,4 +13,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_repayment_return_list.rs b/examples/transfer_repayment_return_list.rs index 26fc5029..5a0914f7 100644 --- a/examples/transfer_repayment_return_list.rs +++ b/examples/transfer_repayment_return_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -12,4 +12,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_sweep_get.rs b/examples/transfer_sweep_get.rs index 2d0da04e..897e55a4 100644 --- a/examples/transfer_sweep_get.rs +++ b/examples/transfer_sweep_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let sweep_id = "your sweep id"; let response = client.transfer_sweep_get(sweep_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/transfer_sweep_list.rs b/examples/transfer_sweep_list.rs index a9639898..457e7421 100644 --- a/examples/transfer_sweep_list.rs +++ b/examples/transfer_sweep_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -15,8 +15,8 @@ async fn main() { .start_date(chrono::Utc::now()) .status(SweepStatus(serde_json::json!({}))) .transfer_id("your transfer id") - .trigger("your trigger") + .trigger(SweepTrigger::Manual) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/user_account_session_get.rs b/examples/user_account_session_get.rs new file mode 100644 index 00000000..fff7f9d9 --- /dev/null +++ b/examples/user_account_session_get.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let public_token = "your public token"; + let response = client.user_account_session_get(public_token).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/user_create.rs b/examples/user_create.rs index a4eabaf2..b2d1285c 100644 --- a/examples/user_create.rs +++ b/examples/user_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -8,6 +8,7 @@ async fn main() { let response = client .user_create(client_user_id) .consumer_report_user_identity(ConsumerReportUserIdentity { + date_of_birth: Some(chrono::Utc::now().date_naive()), emails: vec!["your emails".to_owned()], first_name: "your first name".to_owned(), last_name: "your last name".to_owned(), @@ -19,8 +20,10 @@ async fn main() { region: Some("your region".to_owned()), street: "your street".to_owned(), }, + ssn_last4: Some("your ssn last 4".to_owned()), }) + .end_customer("your end customer") .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/base_report_get.rs b/examples/user_items_get.rs similarity index 75% rename from examples/base_report_get.rs rename to examples/user_items_get.rs index cedbf90a..4e91886c 100644 --- a/examples/base_report_get.rs +++ b/examples/user_items_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let user_token = "your user token"; - let response = client.base_report_get(user_token).await.unwrap(); + let response = client.user_items_get(user_token).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/user_remove.rs b/examples/user_remove.rs new file mode 100644 index 00000000..260790f5 --- /dev/null +++ b/examples/user_remove.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let user_token = "your user token"; + let response = client.user_remove(user_token).await.unwrap(); + println!("{:#?}", response); +} diff --git a/examples/user_third_party_token_create.rs b/examples/user_third_party_token_create.rs new file mode 100644 index 00000000..bd10344a --- /dev/null +++ b/examples/user_third_party_token_create.rs @@ -0,0 +1,15 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let third_party_client_id = "your third party client id"; + let user_token = "your user token"; + let response = client + .user_third_party_token_create(third_party_client_id, user_token) + .expiration_time(chrono::Utc::now()) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/user_third_party_token_remove.rs b/examples/user_third_party_token_remove.rs new file mode 100644 index 00000000..2e82e954 --- /dev/null +++ b/examples/user_third_party_token_remove.rs @@ -0,0 +1,13 @@ +#![allow(unused_imports)] +use plaid::model::*; +use plaid::PlaidClient; +#[tokio::main] +async fn main() { + let client = PlaidClient::from_env(); + let third_party_user_token = "your third party user token"; + let response = client + .user_third_party_token_remove(third_party_user_token) + .await + .unwrap(); + println!("{:#?}", response); +} diff --git a/examples/user_update.rs b/examples/user_update.rs index 8edeeaad..78d6bd33 100644 --- a/examples/user_update.rs +++ b/examples/user_update.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -8,6 +8,7 @@ async fn main() { let response = client .user_update(user_token) .consumer_report_user_identity(ConsumerReportUserIdentity { + date_of_birth: Some(chrono::Utc::now().date_naive()), emails: vec!["your emails".to_owned()], first_name: "your first name".to_owned(), last_name: "your last name".to_owned(), @@ -19,8 +20,9 @@ async fn main() { region: Some("your region".to_owned()), street: "your street".to_owned(), }, + ssn_last4: Some("your ssn last 4".to_owned()), }) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/wallet_create.rs b/examples/wallet_create.rs index e486d37b..e32133d5 100644 --- a/examples/wallet_create.rs +++ b/examples/wallet_create.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let iso_currency_code = "your iso currency code"; + let iso_currency_code = WalletIsoCurrencyCode::Gbp; let response = client.wallet_create(iso_currency_code).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/wallet_get.rs b/examples/wallet_get.rs index b0251aa9..cb11015c 100644 --- a/examples/wallet_get.rs +++ b/examples/wallet_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let wallet_id = "your wallet id"; let response = client.wallet_get(wallet_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/wallet_list.rs b/examples/wallet_list.rs index a497ed88..591d662e 100644 --- a/examples/wallet_list.rs +++ b/examples/wallet_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -8,8 +8,8 @@ async fn main() { .wallet_list() .count(1) .cursor("your cursor") - .iso_currency_code("your iso currency code") + .iso_currency_code(WalletIsoCurrencyCode::Gbp) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/wallet_transaction_execute.rs b/examples/wallet_transaction_execute.rs index 77189fd9..38970dfe 100644 --- a/examples/wallet_transaction_execute.rs +++ b/examples/wallet_transaction_execute.rs @@ -1,38 +1,45 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; use plaid::request::WalletTransactionExecuteRequired; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); - let args = WalletTransactionExecuteRequired { - amount: WalletTransactionAmount { - iso_currency_code: "your iso currency code".to_owned(), - value: 1.0, - }, - counterparty: WalletTransactionCounterparty { - address: Some(PaymentInitiationAddress { - city: "your city".to_owned(), - country: "your country".to_owned(), - postal_code: "your postal code".to_owned(), - street: vec!["your street".to_owned()], + let amount = WalletTransactionAmount { + iso_currency_code: WalletIsoCurrencyCode::Gbp, + value: 1.0, + }; + let counterparty = WalletTransactionCounterparty { + address: Some(PaymentInitiationAddress { + city: "your city".to_owned(), + country: "your country".to_owned(), + postal_code: "your postal code".to_owned(), + street: vec!["your street".to_owned()], + }), + date_of_birth: Some(chrono::Utc::now().date_naive()), + name: "your name".to_owned(), + numbers: WalletTransactionCounterpartyNumbers { + bacs: Some(RecipientBacs { + account: Some("your account".to_owned()), + sort_code: Some("your sort code".to_owned()), + }), + international: Some(WalletTransactionCounterpartyInternational { + iban: Some("your iban".to_owned()), }), - date_of_birth: Some(chrono::Utc::now().date_naive()), - name: "your name".to_owned(), - numbers: WalletTransactionCounterpartyNumbers { - bacs: Some(RecipientBacs { - account: Some("your account".to_owned()), - sort_code: Some("your sort code".to_owned()), - }), - international: Some(WalletTransactionCounterpartyInternational { - iban: Some("your iban".to_owned()), - }), - }, }, - idempotency_key: "your idempotency key", - reference: "your reference", - wallet_id: "your wallet id", }; - let response = client.wallet_transaction_execute(args).await.unwrap(); + let idempotency_key = "your idempotency key"; + let reference = "your reference"; + let wallet_id = "your wallet id"; + let response = client + .wallet_transaction_execute(WalletTransactionExecuteRequired { + amount, + counterparty, + idempotency_key, + reference, + wallet_id, + }) + .await + .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/wallet_transaction_get.rs b/examples/wallet_transaction_get.rs index 79854d75..4cd2c436 100644 --- a/examples/wallet_transaction_get.rs +++ b/examples/wallet_transaction_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let transaction_id = "your transaction id"; let response = client.wallet_transaction_get(transaction_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/wallet_transaction_list.rs b/examples/wallet_transaction_list.rs index ffff07fc..2cf96948 100644 --- a/examples/wallet_transaction_list.rs +++ b/examples/wallet_transaction_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -16,4 +16,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_create.rs b/examples/watchlist_screening_entity_create.rs index bc9b44b6..dd86c326 100644 --- a/examples/watchlist_screening_entity_create.rs +++ b/examples/watchlist_screening_entity_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -19,4 +19,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_get.rs b/examples/watchlist_screening_entity_get.rs index 15929b0b..fd6f16a1 100644 --- a/examples/watchlist_screening_entity_get.rs +++ b/examples/watchlist_screening_entity_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_history_list.rs b/examples/watchlist_screening_entity_history_list.rs index 1f005c43..950754d8 100644 --- a/examples/watchlist_screening_entity_history_list.rs +++ b/examples/watchlist_screening_entity_history_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_hit_list.rs b/examples/watchlist_screening_entity_hit_list.rs index c66900d9..8a8c09f6 100644 --- a/examples/watchlist_screening_entity_hit_list.rs +++ b/examples/watchlist_screening_entity_hit_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_list.rs b/examples/watchlist_screening_entity_list.rs index c57fc9b7..3e82936a 100644 --- a/examples/watchlist_screening_entity_list.rs +++ b/examples/watchlist_screening_entity_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,8 +10,8 @@ async fn main() { .assignee("your assignee") .client_user_id("your client user id") .cursor("your cursor") - .status("your status") + .status(WatchlistScreeningStatus::Rejected) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_program_get.rs b/examples/watchlist_screening_entity_program_get.rs index bd527e4c..a9993622 100644 --- a/examples/watchlist_screening_entity_program_get.rs +++ b/examples/watchlist_screening_entity_program_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_program_list.rs b/examples/watchlist_screening_entity_program_list.rs index 670b2fe3..e0d682c6 100644 --- a/examples/watchlist_screening_entity_program_list.rs +++ b/examples/watchlist_screening_entity_program_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_review_create.rs b/examples/watchlist_screening_entity_review_create.rs index 7c016094..e90488c4 100644 --- a/examples/watchlist_screening_entity_review_create.rs +++ b/examples/watchlist_screening_entity_review_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -17,4 +17,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_review_list.rs b/examples/watchlist_screening_entity_review_list.rs index fcec0fe7..6ff8e55b 100644 --- a/examples/watchlist_screening_entity_review_list.rs +++ b/examples/watchlist_screening_entity_review_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_entity_update.rs b/examples/watchlist_screening_entity_update.rs index 793f16ed..9035a971 100644 --- a/examples/watchlist_screening_entity_update.rs +++ b/examples/watchlist_screening_entity_update.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -9,7 +9,11 @@ async fn main() { .watchlist_screening_entity_update(entity_watchlist_screening_id) .assignee("your assignee") .client_user_id("your client user id") - .reset_fields(&["your reset fields"]) + .reset_fields( + WatchlistScreeningEntityUpdateRequestResettableFieldList( + vec![WatchlistScreeningEntityUpdateRequestResettableField::Assignee], + ), + ) .search_terms(UpdateEntityScreeningRequestSearchTerms { country: Some("your country".to_owned()), document_number: Some("your document number".to_owned()), @@ -19,8 +23,8 @@ async fn main() { phone_number: Some("your phone number".to_owned()), url: Some("your url".to_owned()), }) - .status("your status") + .status(WatchlistScreeningStatus::Rejected) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_create.rs b/examples/watchlist_screening_individual_create.rs index 19312da4..175349ef 100644 --- a/examples/watchlist_screening_individual_create.rs +++ b/examples/watchlist_screening_individual_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -17,4 +17,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_get.rs b/examples/watchlist_screening_individual_get.rs index bb178fa4..a2341010 100644 --- a/examples/watchlist_screening_individual_get.rs +++ b/examples/watchlist_screening_individual_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_history_list.rs b/examples/watchlist_screening_individual_history_list.rs index 021f2f6a..736d8eaa 100644 --- a/examples/watchlist_screening_individual_history_list.rs +++ b/examples/watchlist_screening_individual_history_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_hit_list.rs b/examples/watchlist_screening_individual_hit_list.rs index 4dcc7017..9367ecfc 100644 --- a/examples/watchlist_screening_individual_hit_list.rs +++ b/examples/watchlist_screening_individual_hit_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_list.rs b/examples/watchlist_screening_individual_list.rs index 5e936536..3991a77d 100644 --- a/examples/watchlist_screening_individual_list.rs +++ b/examples/watchlist_screening_individual_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,8 +10,8 @@ async fn main() { .assignee("your assignee") .client_user_id("your client user id") .cursor("your cursor") - .status("your status") + .status(WatchlistScreeningStatus::Rejected) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_program_get.rs b/examples/watchlist_screening_individual_program_get.rs index b55da51d..fdc4b4b3 100644 --- a/examples/watchlist_screening_individual_program_get.rs +++ b/examples/watchlist_screening_individual_program_get.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_program_list.rs b/examples/watchlist_screening_individual_program_list.rs index 94b651b1..aad4e763 100644 --- a/examples/watchlist_screening_individual_program_list.rs +++ b/examples/watchlist_screening_individual_program_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -10,4 +10,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_review_create.rs b/examples/watchlist_screening_individual_review_create.rs index 4eeeaf9a..2be3cd5c 100644 --- a/examples/watchlist_screening_individual_review_create.rs +++ b/examples/watchlist_screening_individual_review_create.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -17,4 +17,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_review_list.rs b/examples/watchlist_screening_individual_review_list.rs index 77ea1271..5800da14 100644 --- a/examples/watchlist_screening_individual_review_list.rs +++ b/examples/watchlist_screening_individual_review_list.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -11,4 +11,4 @@ async fn main() { .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/watchlist_screening_individual_update.rs b/examples/watchlist_screening_individual_update.rs index b03d7b9a..635482ad 100644 --- a/examples/watchlist_screening_individual_update.rs +++ b/examples/watchlist_screening_individual_update.rs @@ -1,6 +1,6 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); @@ -9,7 +9,11 @@ async fn main() { .watchlist_screening_individual_update(watchlist_screening_id) .assignee("your assignee") .client_user_id("your client user id") - .reset_fields(&["your reset fields"]) + .reset_fields( + WatchlistScreeningIndividualUpdateRequestResettableFieldList( + vec![WatchlistScreeningIndividualUpdateRequestResettableField::Assignee], + ), + ) .search_terms(UpdateIndividualScreeningRequestSearchTerms { country: Some("your country".to_owned()), date_of_birth: Some(chrono::Utc::now().date_naive()), @@ -17,8 +21,8 @@ async fn main() { legal_name: Some("your legal name".to_owned()), watchlist_program_id: Some("your watchlist program id".to_owned()), }) - .status("your status") + .status(WatchlistScreeningStatus::Rejected) .await .unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/examples/webhook_verification_key_get.rs b/examples/webhook_verification_key_get.rs index 943f1c55..65775710 100644 --- a/examples/webhook_verification_key_get.rs +++ b/examples/webhook_verification_key_get.rs @@ -1,10 +1,10 @@ #![allow(unused_imports)] -use plaid::PlaidClient; use plaid::model::*; +use plaid::PlaidClient; #[tokio::main] async fn main() { let client = PlaidClient::from_env(); let key_id = "your key id"; let response = client.webhook_verification_key_get(key_id).await.unwrap(); println!("{:#?}", response); -} \ No newline at end of file +} diff --git a/src/lib.rs b/src/lib.rs index aac9acda..1bf37949 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,24 +1,19 @@ -//! [`PlaidClient`](struct.PlaidClient.html) is the main entry point for this library. -//! -//! Library created with [`libninja`](https://www.libninja.com). -#![allow(non_camel_case_types)] -#![allow(unused)] -pub mod model; -pub mod request; -pub use httpclient::{Error, Result, InMemoryResponseExt}; -use std::sync::{Arc, OnceLock}; +use std::sync::OnceLock; use std::borrow::Cow; -use crate::model::*; +use httpclient::Client; +pub mod request; +pub mod model; use base64::{Engine, engine::general_purpose::STANDARD_NO_PAD}; mod serde; -static SHARED_HTTPCLIENT: OnceLock = OnceLock::new(); -pub fn default_http_client() -> httpclient::Client { - let plaid_env = std::env::var("PLAID_ENV") - .expect("Missing environment variable PLAID_ENV"); - let url = format!("https://{plaid_env}.plaid.com"); - httpclient::Client::new() - .base_url(&url) +pub fn default_http_client() -> Client { + Client::new() + .base_url( + std::env::var("PLAID_ENV") + .expect("Missing environment variable PLAID_ENV") + .as_str(), + ) } +static SHARED_HTTPCLIENT: OnceLock = OnceLock::new(); /// Use this method if you want to add custom middleware to the httpclient. /// It must be called before any requests are made, otherwise it will have no effect. /// Example usage: @@ -28,10 +23,10 @@ pub fn default_http_client() -> httpclient::Client { /// .with_middleware(..) /// ); /// ``` -pub fn init_http_client(init: httpclient::Client) { +pub fn init_http_client(init: Client) { let _ = SHARED_HTTPCLIENT.set(init); } -fn shared_http_client() -> Cow<'static, httpclient::Client> { +fn shared_http_client() -> Cow<'static, Client> { Cow::Borrowed(SHARED_HTTPCLIENT.get_or_init(default_http_client)) } #[derive(Clone)] @@ -40,7 +35,7 @@ pub struct FluentRequest<'a, T> { pub params: T, } pub struct PlaidClient { - client: Cow<'static, httpclient::Client>, + client: Cow<'static, Client>, authentication: PlaidAuth, } impl PlaidClient { @@ -56,7 +51,7 @@ impl PlaidClient { authentication, } } - pub fn new_with(client: httpclient::Client, authentication: PlaidAuth) -> Self { + pub fn new_with(client: Client, authentication: PlaidAuth) { Self { client: Cow::Owned(client), authentication, @@ -69,4962 +64,21 @@ impl PlaidClient { mut r: httpclient::RequestBuilder<'a>, ) -> httpclient::RequestBuilder<'a> { match &self.authentication { - PlaidAuth::ClientId { client_id, secret, plaid_version } => { - r = r.header("PLAID-CLIENT-ID", client_id); - r = r.header("PLAID-SECRET", secret); - r = r.header("Plaid-Version", plaid_version); + PlaidAuth::ClientId { plaid_client_id } => { + r = r.header("PLAID-CLIENT-ID", plaid_client_id); } } r } - /**Create an Asset Report - -The `/asset_report/create` endpoint initiates the process of creating an Asset Report, which can then be retrieved by passing the `asset_report_token` return value to the `/asset_report/get` or `/asset_report/pdf/get` endpoints. - -The Asset Report takes some time to be created and is not available immediately after calling `/asset_report/create`. The exact amount of time to create the report will vary depending on how many days of history are requested and will typically range from a few seconds to about one minute. When the Asset Report is ready to be retrieved using `/asset_report/get` or `/asset_report/pdf/get`, Plaid will fire a `PRODUCT_READY` webhook. For full details of the webhook schema, see [Asset Report webhooks](https://plaid.com/docs/api/products/assets/#webhooks). - -The `/asset_report/create` endpoint creates an Asset Report at a moment in time. Asset Reports are immutable. To get an updated Asset Report, use the `/asset_report/refresh` endpoint. - -See endpoint docs at .*/ - pub fn asset_report_create( - &self, - days_requested: i64, - ) -> FluentRequest<'_, request::AssetReportCreateRequest> { - FluentRequest { - client: self, - params: request::AssetReportCreateRequest { - access_tokens: None, - days_requested, - options: None, - }, - } - } - /**Retrieve an Asset Report - -The `/asset_report/get` endpoint retrieves the Asset Report in JSON format. Before calling `/asset_report/get`, you must first create the Asset Report using `/asset_report/create` (or filter an Asset Report using `/asset_report/filter`) and then wait for the [`PRODUCT_READY`](https://plaid.com/docs/api/products/assets/#product_ready) webhook to fire, indicating that the Report is ready to be retrieved. - -By default, an Asset Report includes transaction descriptions as returned by the bank, as opposed to parsed and categorized by Plaid. You can also receive cleaned and categorized transactions, as well as additional insights like merchant name or location information. We call this an Asset Report with Insights. An Asset Report with Insights provides transaction category, location, and merchant information in addition to the transaction strings provided in a standard Asset Report. To retrieve an Asset Report with Insights, call `/asset_report/get` endpoint with `include_insights` set to `true`. - -For latency-sensitive applications, you can optionally call `/asset_report/create` with `options.add_ons` set to `["fast_assets"]`. This will cause Plaid to create two versions of the Asset Report: one with only current and available balance and identity information, and then later on the complete Asset Report. You will receive separate webhooks for each version of the Asset Report. - -See endpoint docs at .*/ - pub fn asset_report_get(&self) -> FluentRequest<'_, request::AssetReportGetRequest> { - FluentRequest { - client: self, - params: request::AssetReportGetRequest { - asset_report_token: None, - fast_report: None, - include_insights: None, - options: None, - user_token: None, - }, - } - } - /**Retrieve a PDF Asset Report - -The `/asset_report/pdf/get` endpoint retrieves the Asset Report in PDF format. Before calling `/asset_report/pdf/get`, you must first create the Asset Report using `/asset_report/create` (or filter an Asset Report using `/asset_report/filter`) and then wait for the [`PRODUCT_READY`](https://plaid.com/docs/api/products/assets/#product_ready) webhook to fire, indicating that the Report is ready to be retrieved. - -The response to `/asset_report/pdf/get` is the PDF binary data. The `request_id` is returned in the `Plaid-Request-ID` header. - -[View a sample PDF Asset Report](https://plaid.com/documents/sample-asset-report.pdf). - -See endpoint docs at .*/ - pub fn asset_report_pdf_get( - &self, - asset_report_token: &str, - ) -> FluentRequest<'_, request::AssetReportPdfGetRequest> { - FluentRequest { - client: self, - params: request::AssetReportPdfGetRequest { - asset_report_token: asset_report_token.to_owned(), - options: None, - }, - } - } - /**Refresh an Asset Report - -An Asset Report is an immutable snapshot of a user's assets. In order to "refresh" an Asset Report you created previously, you can use the `/asset_report/refresh` endpoint to create a new Asset Report based on the old one, but with the most recent data available. - -The new Asset Report will contain the same Items as the original Report, as well as the same filters applied by any call to `/asset_report/filter`. By default, the new Asset Report will also use the same parameters you submitted with your original `/asset_report/create` request, but the original `days_requested` value and the values of any parameters in the `options` object can be overridden with new values. To change these arguments, simply supply new values for them in your request to `/asset_report/refresh`. Submit an empty string ("") for any previously-populated fields you would like set as empty. - -See endpoint docs at .*/ - pub fn asset_report_refresh( - &self, - asset_report_token: &str, - ) -> FluentRequest<'_, request::AssetReportRefreshRequest> { - FluentRequest { - client: self, - params: request::AssetReportRefreshRequest { - asset_report_token: asset_report_token.to_owned(), - days_requested: None, - options: None, - }, - } - } - /**Filter Asset Report - -By default, an Asset Report will contain all of the accounts on a given Item. In some cases, you may not want the Asset Report to contain all accounts. For example, you might have the end user choose which accounts are relevant in Link using the Account Select view, which you can enable in the dashboard. Or, you might always exclude certain account types or subtypes, which you can identify by using the `/accounts/get` endpoint. To narrow an Asset Report to only a subset of accounts, use the `/asset_report/filter` endpoint. - -To exclude certain Accounts from an Asset Report, first use the `/asset_report/create` endpoint to create the report, then send the `asset_report_token` along with a list of `account_ids` to exclude to the `/asset_report/filter` endpoint, to create a new Asset Report which contains only a subset of the original Asset Report's data. - -Because Asset Reports are immutable, calling `/asset_report/filter` does not alter the original Asset Report in any way; rather, `/asset_report/filter` creates a new Asset Report with a new token and id. Asset Reports created via `/asset_report/filter` do not contain new Asset data, and are not billed. - -Plaid will fire a [`PRODUCT_READY`](https://plaid.com/docs/api/products/assets/#product_ready) webhook once generation of the filtered Asset Report has completed. - -See endpoint docs at .*/ - pub fn asset_report_filter( - &self, - account_ids_to_exclude: &[&str], - asset_report_token: &str, - ) -> FluentRequest<'_, request::AssetReportFilterRequest> { - FluentRequest { - client: self, - params: request::AssetReportFilterRequest { - account_ids_to_exclude: account_ids_to_exclude - .iter() - .map(|&x| x.to_owned()) - .collect(), - asset_report_token: asset_report_token.to_owned(), - }, - } - } - /**Delete an Asset Report - -The `/item/remove` endpoint allows you to invalidate an `access_token`, meaning you will not be able to create new Asset Reports with it. Removing an Item does not affect any Asset Reports or Audit Copies you have already created, which will remain accessible until you remove them specifically. - -The `/asset_report/remove` endpoint allows you to remove an Asset Report. Removing an Asset Report invalidates its `asset_report_token`, meaning you will no longer be able to use it to access Report data or create new Audit Copies. Removing an Asset Report does not affect the underlying Items, but does invalidate any `audit_copy_tokens` associated with the Asset Report. - -See endpoint docs at .*/ - pub fn asset_report_remove( - &self, - asset_report_token: &str, - ) -> FluentRequest<'_, request::AssetReportRemoveRequest> { - FluentRequest { - client: self, - params: request::AssetReportRemoveRequest { - asset_report_token: asset_report_token.to_owned(), - }, - } - } - /**Create Asset Report Audit Copy - -Plaid can provide an Audit Copy of any Asset Report directly to a participating third party on your behalf. For example, Plaid can supply an Audit Copy directly to Fannie Mae on your behalf if you participate in the Day 1 Certainty™ program. An Audit Copy contains the same underlying data as the Asset Report. - -To grant access to an Audit Copy, use the `/asset_report/audit_copy/create` endpoint to create an `audit_copy_token` and then pass that token to the third party who needs access. Each third party has its own `auditor_id`, for example `fannie_mae`. You’ll need to create a separate Audit Copy for each third party to whom you want to grant access to the Report. - -See endpoint docs at .*/ - pub fn asset_report_audit_copy_create( - &self, - asset_report_token: &str, - ) -> FluentRequest<'_, request::AssetReportAuditCopyCreateRequest> { - FluentRequest { - client: self, - params: request::AssetReportAuditCopyCreateRequest { - asset_report_token: asset_report_token.to_owned(), - auditor_id: None, - }, - } - } - /**Retrieve an Asset Report Audit Copy - -`/asset_report/audit_copy/get` allows auditors to get a copy of an Asset Report that was previously shared via the `/asset_report/audit_copy/create` endpoint. The caller of `/asset_report/audit_copy/create` must provide the `audit_copy_token` to the auditor. This token can then be used to call `/asset_report/audit_copy/create`. - -See endpoint docs at .*/ - pub fn asset_report_audit_copy_get( - &self, - audit_copy_token: &str, - ) -> FluentRequest<'_, request::AssetReportAuditCopyGetRequest> { - FluentRequest { - client: self, - params: request::AssetReportAuditCopyGetRequest { - audit_copy_token: audit_copy_token.to_owned(), - }, - } - } - /**Remove Asset Report Audit Copy - -The `/asset_report/audit_copy/remove` endpoint allows you to remove an Audit Copy. Removing an Audit Copy invalidates the `audit_copy_token` associated with it, meaning both you and any third parties holding the token will no longer be able to use it to access Report data. Items associated with the Asset Report, the Asset Report itself and other Audit Copies of it are not affected and will remain accessible after removing the given Audit Copy. - -See endpoint docs at .*/ - pub fn asset_report_audit_copy_remove( - &self, - audit_copy_token: &str, - ) -> FluentRequest<'_, request::AssetReportAuditCopyRemoveRequest> { - FluentRequest { - client: self, - params: request::AssetReportAuditCopyRemoveRequest { - audit_copy_token: audit_copy_token.to_owned(), - }, - } - } - /**Retrieve a Base Report - -This endpoint allows the customer to retrieve a Base Report. Customers should pass in the `user_token` created in `/link/token/create`. - -See endpoint docs at .*/ - pub fn base_report_get( - &self, - user_token: &str, - ) -> FluentRequest<'_, request::BaseReportGetRequest> { - FluentRequest { - client: self, - params: request::BaseReportGetRequest { - user_token: user_token.to_owned(), - }, - } - } - /**Update an Audit Copy Token - -The `/credit/audit_copy_token/update` endpoint updates an existing Audit Copy Token by adding the report tokens in the `report_tokens` field to the `audit_copy_token`. If the Audit Copy Token already contains a report of a certain type, it will be replaced with the token provided in the `report_tokens` field. - -See endpoint docs at .*/ - pub fn credit_audit_copy_token_update( - &self, - audit_copy_token: &str, - report_tokens: &[&str], - ) -> FluentRequest<'_, request::CreditAuditCopyTokenUpdateRequest> { - FluentRequest { - client: self, - params: request::CreditAuditCopyTokenUpdateRequest { - audit_copy_token: audit_copy_token.to_owned(), - report_tokens: report_tokens.iter().map(|&x| x.to_owned()).collect(), - }, - } - } - /**Retrieve information from the bank accounts used for income verification - -`/cra/bank_income/get` returns the bank income report(s) for a specified user. - -See endpoint docs at .*/ - pub fn cra_bank_income_get( - &self, - ) -> FluentRequest<'_, request::CraBankIncomeGetRequest> { - FluentRequest { - client: self, - params: request::CraBankIncomeGetRequest { - user_token: None, - }, - } - } - /**Retrieve a list of all statements associated with the provided item. - -The `/statements/list` endpoint retrieves a list of all statements associated with the provided item. - -See endpoint docs at .*/ - pub fn statements_list( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::StatementsListRequest> { - FluentRequest { - client: self, - params: request::StatementsListRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Retrieve a single statement. - -The `/statements/download` endpoint retrieves a single statement PDF in binary format. The response will contain a `Plaid-Content-Hash` header containing a SHA 256 checksum of the statement. This can be used to verify that the file being sent by Plaid is the same file that was downloaded to your system. - -See endpoint docs at .*/ - pub fn statements_download( - &self, - access_token: &str, - statement_id: &str, - ) -> FluentRequest<'_, request::StatementsDownloadRequest> { - FluentRequest { - client: self, - params: request::StatementsDownloadRequest { - access_token: access_token.to_owned(), - statement_id: statement_id.to_owned(), - }, - } - } - /**Refresh statements data. - -`/statements/refresh` initiates an on-demand extraction to fetch the statements for the provided dates. - -See endpoint docs at .*/ - pub fn statements_refresh( - &self, - access_token: &str, - end_date: chrono::NaiveDate, - start_date: chrono::NaiveDate, - ) -> FluentRequest<'_, request::StatementsRefreshRequest> { - FluentRequest { - client: self, - params: request::StatementsRefreshRequest { - access_token: access_token.to_owned(), - end_date, - start_date, - }, - } - } - ///List a historical log of user consent events - pub fn item_activity_list( - &self, - ) -> FluentRequest<'_, request::ItemActivityListRequest> { - FluentRequest { - client: self, - params: request::ItemActivityListRequest { - access_token: None, - count: None, - cursor: None, - }, - } - } - ///List a user’s connected applications - pub fn item_application_list( - &self, - ) -> FluentRequest<'_, request::ItemApplicationListRequest> { - FluentRequest { - client: self, - params: request::ItemApplicationListRequest { - access_token: None, - }, - } - } - /**Unlink a user’s connected application - -Unlink a user’s connected application. On an unlink request, Plaid will immediately revoke the Application’s access to the User’s data. The User will have to redo the OAuth authentication process in order to restore functionality. - -This endpoint only removes ongoing data access permissions, therefore the User will need to reach out to the Application itself in order to disable and delete their account and delete any data that the Application already received (if the Application does not do so by default). - -This endpoint should be called in real time as the User is unlinking an Application, and should not be batched in order to ensure that the change is reflected as soon as possible. - -See endpoint docs at .*/ - pub fn item_application_unlink( - &self, - access_token: &str, - application_id: &str, - ) -> FluentRequest<'_, request::ItemApplicationUnlinkRequest> { - FluentRequest { - client: self, - params: request::ItemApplicationUnlinkRequest { - access_token: access_token.to_owned(), - application_id: application_id.to_owned(), - }, - } - } - /**Update the scopes of access for a particular application - -Enable consumers to update product access on selected accounts for an application.*/ - pub fn item_application_scopes_update( - &self, - args: request::ItemApplicationScopesUpdateRequired, - ) -> FluentRequest<'_, request::ItemApplicationScopesUpdateRequest> { - FluentRequest { - client: self, - params: request::ItemApplicationScopesUpdateRequest { - access_token: args.access_token.to_owned(), - application_id: args.application_id.to_owned(), - context: args.context.to_owned(), - scopes: args.scopes, - state: None, - }, - } - } - /**Retrieve information about a Plaid application - -Allows financial institutions to retrieve information about Plaid clients for the purpose of building control-tower experiences*/ - pub fn application_get( - &self, - application_id: &str, - ) -> FluentRequest<'_, request::ApplicationGetRequest> { - FluentRequest { - client: self, - params: request::ApplicationGetRequest { - application_id: application_id.to_owned(), - }, - } - } - /**Retrieve an Item - -Returns information about the status of an Item. - -See endpoint docs at .*/ - pub fn item_get( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::ItemGetRequest> { - FluentRequest { - client: self, - params: request::ItemGetRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Retrieve auth data - -The `/auth/get` endpoint returns the bank account and bank identification numbers (such as routing numbers, for US accounts) associated with an Item's checking and savings accounts, along with high-level account data and balances when available. - -Note: This request may take some time to complete if `auth` was not specified as an initial product when creating the Item. This is because Plaid must communicate directly with the institution to retrieve the data. - -Versioning note: In API version 2017-03-08, the schema of the `numbers` object returned by this endpoint is substantially different. For details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2018-05-22). - -See endpoint docs at .*/ - pub fn auth_get( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::AuthGetRequest> { - FluentRequest { - client: self, - params: request::AuthGetRequest { - access_token: access_token.to_owned(), - options: None, - }, - } - } - /**Get transaction data - -Note: All new implementations are encouraged to use `/transactions/sync` rather than `/transactions/get`. `/transactions/sync` provides the same functionality as `/transactions/get` and improves developer ease-of-use for handling transactions updates. - -The `/transactions/get` endpoint allows developers to receive user-authorized transaction data for credit, depository, and some loan-type accounts (only those with account subtype `student`; coverage may be limited). For transaction history from investments accounts, use the [Investments endpoint](https://plaid.com/docs/api/products/investments/) instead. Transaction data is standardized across financial institutions, and in many cases transactions are linked to a clean name, entity type, location, and category. Similarly, account data is standardized and returned with a clean name, number, balance, and other meta information where available. - -Transactions are returned in reverse-chronological order, and the sequence of transaction ordering is stable and will not shift. Transactions are not immutable and can also be removed altogether by the institution; a removed transaction will no longer appear in `/transactions/get`. For more details, see [Pending and posted transactions](https://plaid.com/docs/transactions/transactions-data/#pending-and-posted-transactions). - -Due to the potentially large number of transactions associated with an Item, results are paginated. Manipulate the `count` and `offset` parameters in conjunction with the `total_transactions` response body field to fetch all available transactions. - -Data returned by `/transactions/get` will be the data available for the Item as of the most recent successful check for new transactions. Plaid typically checks for new data multiple times a day, but these checks may occur less frequently, such as once a day, depending on the institution. An Item's `status.transactions.last_successful_update` field will show the timestamp of the most recent successful update. To force Plaid to check for new transactions, you can use the `/transactions/refresh` endpoint. - -Note that data may not be immediately available to `/transactions/get`. Plaid will begin to prepare transactions data upon Item link, if Link was initialized with `transactions`, or upon the first call to `/transactions/get`, if it wasn't. To be alerted when transaction data is ready to be fetched, listen for the [`INITIAL_UPDATE`](https://plaid.com/docs/api/products/transactions/#initial_update) and [`HISTORICAL_UPDATE`](https://plaid.com/docs/api/products/transactions/#historical_update) webhooks. If no transaction history is ready when `/transactions/get` is called, it will return a `PRODUCT_NOT_READY` error. - -See endpoint docs at .*/ - pub fn transactions_get( - &self, - access_token: &str, - end_date: chrono::NaiveDate, - start_date: chrono::NaiveDate, - ) -> FluentRequest<'_, request::TransactionsGetRequest> { - FluentRequest { - client: self, - params: request::TransactionsGetRequest { - access_token: access_token.to_owned(), - end_date, - options: None, - start_date, - }, - } - } - /**Refresh transaction data - -`/transactions/refresh` is an optional endpoint for users of the Transactions product. It initiates an on-demand extraction to fetch the newest transactions for an Item. This on-demand extraction takes place in addition to the periodic extractions that automatically occur multiple times a day for any Transactions-enabled Item. If changes to transactions are discovered after calling `/transactions/refresh`, Plaid will fire a webhook: for `/transactions/sync` users, [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#sync_updates_available) will be fired if there are any transactions updated, added, or removed. For users of both `/transactions/sync` and `/transactions/get`, [`TRANSACTIONS_REMOVED`](https://plaid.com/docs/api/products/transactions/#transactions_removed) will be fired if any removed transactions are detected, and [`DEFAULT_UPDATE`](https://plaid.com/docs/api/products/transactions/#default_update) will be fired if any new transactions are detected. New transactions can be fetched by calling `/transactions/get` or `/transactions/sync`. Note that the `/transactions/refresh` endpoint is not supported for Capital One (`ins_128026`) and will result in a `PRODUCT_NOT_SUPPORTED` error if called on an Item from that institution. - -`/transactions/refresh` is offered as an add-on to Transactions and has a separate [fee model](/docs/account/billing/#per-request-flat-fee). To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. - -See endpoint docs at .*/ - pub fn transactions_refresh( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::TransactionsRefreshRequest> { - FluentRequest { - client: self, - params: request::TransactionsRefreshRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Fetch recurring transaction streams - -The `/transactions/recurring/get` endpoint allows developers to receive a summary of the recurring outflow and inflow streams (expenses and deposits) from a user’s checking, savings or credit card accounts. Additionally, Plaid provides key insights about each recurring stream including the category, merchant, last amount, and more. Developers can use these insights to build tools and experiences that help their users better manage cash flow, monitor subscriptions, reduce spend, and stay on track with bill payments. - -This endpoint is offered as an add-on to Transactions. To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. - -This endpoint can only be called on an Item that has already been initialized with Transactions (either during Link, by specifying it in `/link/token/create`; or after Link, by calling `/transactions/get` or `/transactions/sync`). For optimal results, we strongly recommend customers using Recurring Transactions to request at least 180 days of history when initializing items with Transactions (using the [`days_requested`](https://plaid.com/docs/api/tokens/#link-token-create-request-transactions-days-requested) option). Once all historical transactions have been fetched, call `/transactions/recurring/get` to receive the Recurring Transactions streams and subscribe to the [`RECURRING_TRANSACTIONS_UPDATE`](https://plaid.com/docs/api/products/transactions/#recurring_transactions_update) webhook. To know when historical transactions have been fetched, if you are using `/transactions/sync` listen for the [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#SyncUpdatesAvailableWebhook-historical-update-complete) webhook and check that the `historical_update_complete` field in the payload is `true`. If using `/transactions/get`, listen for the [`HISTORICAL_UPDATE`](https://plaid.com/docs/api/products/transactions/#historical_update) webhook. - -After the initial call, you can call `/transactions/recurring/get` endpoint at any point in the future to retrieve the latest summary of recurring streams. Listen to the [`RECURRING_TRANSACTIONS_UPDATE`](https://plaid.com/docs/api/products/transactions/#recurring_transactions_update) webhook to be notified when new updates are available. - -See endpoint docs at .*/ - pub fn transactions_recurring_get( - &self, - access_token: &str, - account_ids: &[&str], - ) -> FluentRequest<'_, request::TransactionsRecurringGetRequest> { - FluentRequest { - client: self, - params: request::TransactionsRecurringGetRequest { - access_token: access_token.to_owned(), - account_ids: account_ids.iter().map(|&x| x.to_owned()).collect(), - options: None, - }, - } - } - /**Get incremental transaction updates on an Item - -The `/transactions/sync` endpoint allows developers to subscribe to all transactions associated with an Item and get updates synchronously in a stream-like manner, using a cursor to track which updates have already been seen. - -`/transactions/sync` provides the same functionality as `/transactions/get` and can be used instead of `/transactions/get` to simplify the process of tracking transactions updates. To learn more about migrating from `/transactions/get`, see the [Transactions Sync migration guide](https://plaid.com/docs/transactions/sync-migration/). - -This endpoint provides user-authorized transaction data for `credit`, `depository`, and some loan-type accounts (only those with account subtype `student`; coverage may be limited). For transaction history from `investments` accounts, use `/investments/transactions/get` instead. - -Returned transactions data is grouped into three types of update, indicating whether the transaction was added, removed, or modified since the last call to the API. - -In the first call to `/transactions/sync` for an Item, the endpoint will return all historical transactions data associated with that Item up until the time of the API call (as "adds"), which then generates a `next_cursor` for that Item. In subsequent calls, send the `next_cursor` to receive only the changes that have occurred since the previous call. - -Due to the potentially large number of transactions associated with an Item, results are paginated. The `has_more` field specifies if additional calls are necessary to fetch all available transaction updates. Call `/transactions/sync` with the new cursor, pulling all updates, until `has_more` is `false`. - -When retrieving paginated updates, track both the `next_cursor` from the latest response and the original cursor from the first call in which `has_more` was `true`; if a call to `/transactions/sync` fails due to the [`TRANSACTIONS_SYNC_MUTATION_DURING_PAGINATION`](https://plaid.com/docs/errors/transactions/#transactions_sync_mutation_during_pagination) error, the entire pagination request loop must be restarted beginning with the cursor for the first page of the update, rather than retrying only the single request that failed. - -Whenever new or updated transaction data becomes available, `/transactions/sync` will provide these updates. Plaid typically checks for new data multiple times a day, but these checks may occur less frequently, such as once a day, depending on the institution. An Item's `status.transactions.last_successful_update` field will show the timestamp of the most recent successful update. To force Plaid to check for new transactions, use the `/transactions/refresh` endpoint. - -For newly created Items, data may not be immediately available to `/transactions/sync`. Plaid begins preparing transactions data when the Item is created, but the process can take anywhere from a few seconds to several minutes to complete, depending on the number of transactions available. - -To be alerted when new data is available, listen for the [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#sync_updates_available) webhook. - -`/transactions/sync` does not directly return balance data. To get the balance for an account, call `/accounts/get`, which is a free-to-use endpoint that will return the cached balance as of the last successful transactions update. - -See endpoint docs at .*/ - pub fn transactions_sync( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::TransactionsSyncRequest> { - FluentRequest { - client: self, - params: request::TransactionsSyncRequest { - access_token: access_token.to_owned(), - count: None, - cursor: None, - options: None, - }, - } - } - /**Enrich locally-held transaction data - -The `/transactions/enrich` endpoint enriches raw transaction data generated by your own banking products or retrieved from other non-Plaid sources. - -See endpoint docs at .*/ - pub fn transactions_enrich( - &self, - account_type: &str, - transactions: Vec, - ) -> FluentRequest<'_, request::TransactionsEnrichRequest> { - FluentRequest { - client: self, - params: request::TransactionsEnrichRequest { - account_type: account_type.to_owned(), - options: None, - transactions, - }, - } - } - /**Get details of all supported institutions - -Returns a JSON response containing details on all financial institutions currently supported by Plaid. Because Plaid supports thousands of institutions, results are paginated. - -If there is no overlap between an institution’s enabled products and a client’s enabled products, then the institution will be filtered out from the response. As a result, the number of institutions returned may not match the count specified in the call. - -See endpoint docs at .*/ - pub fn institutions_get( - &self, - count: i64, - country_codes: &[&str], - offset: i64, - ) -> FluentRequest<'_, request::InstitutionsGetRequest> { - FluentRequest { - client: self, - params: request::InstitutionsGetRequest { - count, - country_codes: country_codes.iter().map(|&x| x.to_owned()).collect(), - offset, - options: None, - }, - } - } - /**Search institutions - -Returns a JSON response containing details for institutions that match the query parameters, up to a maximum of ten institutions per query. - -Versioning note: API versions 2019-05-29 and earlier allow use of the `public_key` parameter instead of the `client_id` and `secret` parameters to authenticate to this endpoint. The `public_key` parameter has since been deprecated; all customers are encouraged to use `client_id` and `secret` instead. - - -See endpoint docs at .*/ - pub fn institutions_search( - &self, - country_codes: &[&str], - query: &str, - ) -> FluentRequest<'_, request::InstitutionsSearchRequest> { - FluentRequest { - client: self, - params: request::InstitutionsSearchRequest { - country_codes: country_codes.iter().map(|&x| x.to_owned()).collect(), - options: None, - products: None, - query: query.to_owned(), - }, - } - } - /**Get details of an institution - -Returns a JSON response containing details on a specified financial institution currently supported by Plaid. - -Versioning note: API versions 2019-05-29 and earlier allow use of the `public_key` parameter instead of the `client_id` and `secret` to authenticate to this endpoint. The `public_key` has been deprecated; all customers are encouraged to use `client_id` and `secret` instead. - - -See endpoint docs at .*/ - pub fn institutions_get_by_id( - &self, - country_codes: &[&str], - institution_id: &str, - ) -> FluentRequest<'_, request::InstitutionsGetByIdRequest> { - FluentRequest { - client: self, - params: request::InstitutionsGetByIdRequest { - country_codes: country_codes.iter().map(|&x| x.to_owned()).collect(), - institution_id: institution_id.to_owned(), - options: None, - }, - } - } - /**Remove an Item - -The `/item/remove` endpoint allows you to remove an Item. Once removed, the `access_token`, as well as any processor tokens or bank account tokens associated with the Item, is no longer valid and cannot be used to access any data that was associated with the Item. - -Note that in the Development environment, issuing an `/item/remove` request will not decrement your live credential count. To increase your credential account in Development, contact Support. - -Also note that for certain OAuth-based institutions, an Item removed via `/item/remove` may still show as an active connection in the institution's OAuth permission manager. - -API versions 2019-05-29 and earlier return a `removed` boolean as part of the response. - -See endpoint docs at .*/ - pub fn item_remove( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::ItemRemoveRequest> { - FluentRequest { - client: self, - params: request::ItemRemoveRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Retrieve accounts - -The `/accounts/get` endpoint can be used to retrieve a list of accounts associated with any linked Item. Plaid will only return active bank accounts — that is, accounts that are not closed and are capable of carrying a balance. -For items that went through the updated account selection pane, this endpoint only returns accounts that were permissioned by the user when they initially created the Item. If a user creates a new account after the initial link, you can capture this event through the [`NEW_ACCOUNTS_AVAILABLE`](https://plaid.com/docs/api/items/#new_accounts_available) webhook and then use Link's [update mode](https://plaid.com/docs/link/update-mode/) to request that the user share this new account with you. - -`/accounts/get` is free to use and retrieves cached information, rather than extracting fresh information from the institution. The balance returned will reflect the balance at the time of the last successful Item update. If the Item is enabled for a regularly updating product, such as Transactions, Investments, or Liabilities, the balance will typically update about once a day, as long as the Item is healthy. If the Item is enabled only for products that do not frequently update, such as Auth or Identity, balance data may be much older. - -For realtime balance information, use the paid endpoint `/accounts/balance/get` instead. - -See endpoint docs at .*/ - pub fn accounts_get( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::AccountsGetRequest> { - FluentRequest { - client: self, - params: request::AccountsGetRequest { - access_token: access_token.to_owned(), - options: None, - }, - } - } - /**Get categories - -Send a request to the `/categories/get` endpoint to get detailed information on categories returned by Plaid. This endpoint does not require authentication. - -All implementations are recommended to use the newer `personal_finance_category` taxonomy instead of the older `category` taxonomy supported by this endpoint. The [`personal_finance_category taxonomy` CSV file](https://plaid.com/documents/transactions-personal-finance-category-taxonomy.csv) is available for download and is not accessible via API. - -See endpoint docs at .*/ - pub fn categories_get(&self) -> FluentRequest<'_, request::CategoriesGetRequest> { - FluentRequest { - client: self, - params: request::CategoriesGetRequest {}, - } - } - /**Create a test Item and processor token - -Use the `/sandbox/processor_token/create` endpoint to create a valid `processor_token` for an arbitrary institution ID and test credentials. The created `processor_token` corresponds to a new Sandbox Item. You can then use this `processor_token` with the `/processor/` API endpoints in Sandbox. You can also use `/sandbox/processor_token/create` with the [`user_custom` test username](https://plaid.com/docs/sandbox/user-custom) to generate a test account with custom data. - -See endpoint docs at .*/ - pub fn sandbox_processor_token_create( - &self, - institution_id: &str, - ) -> FluentRequest<'_, request::SandboxProcessorTokenCreateRequest> { - FluentRequest { - client: self, - params: request::SandboxProcessorTokenCreateRequest { - institution_id: institution_id.to_owned(), - options: None, - }, - } - } - /**Create a test Item - -Use the `/sandbox/public_token/create` endpoint to create a valid `public_token` for an arbitrary institution ID, initial products, and test credentials. The created `public_token` maps to a new Sandbox Item. You can then call `/item/public_token/exchange` to exchange the `public_token` for an `access_token` and perform all API actions. `/sandbox/public_token/create` can also be used with the [`user_custom` test username](https://plaid.com/docs/sandbox/user-custom) to generate a test account with custom data. `/sandbox/public_token/create` cannot be used with OAuth institutions. - -See endpoint docs at .*/ - pub fn sandbox_public_token_create( - &self, - initial_products: &[&str], - institution_id: &str, - ) -> FluentRequest<'_, request::SandboxPublicTokenCreateRequest> { - FluentRequest { - client: self, - params: request::SandboxPublicTokenCreateRequest { - initial_products: initial_products - .iter() - .map(|&x| x.to_owned()) - .collect(), - institution_id: institution_id.to_owned(), - options: None, - user_token: None, - }, - } - } - /**Fire a test webhook - -The `/sandbox/item/fire_webhook` endpoint is used to test that code correctly handles webhooks. This endpoint can trigger the following webhooks: - -`DEFAULT_UPDATE`: Transactions update webhook to be fired for a given Sandbox Item. If the Item does not support Transactions, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. - -`NEW_ACCOUNTS_AVAILABLE`: Webhook to be fired for a given Sandbox Item created with Account Select v2. - -`AUTH_DATA_UPDATE`: Webhook to be fired for a given Sandbox Item created with Auth as an enabled product. - -`LOGIN_REPAIRED`: Fired when an Item recovers from the `ITEM_LOGIN_REQUIRED` without the user going through update mode in your app. - -`RECURRING_TRANSACTIONS_UPDATE`: Recurring Transactions webhook to be fired for a given Sandbox Item. If the Item does not support Recurring Transactions, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. - -`SYNC_UPDATES_AVAILABLE`: Transactions webhook to be fired for a given Sandbox Item. If the Item does not support Transactions, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. - -`PRODUCT_READY`: Assets webhook to be fired when a given asset report has been successfully generated. If the Item does not support Assets, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. - -`ERROR`: Assets webhook to be fired when asset report generation has failed. If the Item does not support Assets, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. - -Note that this endpoint is provided for developer ease-of-use and is not required for testing webhooks; webhooks will also fire in Sandbox under the same conditions that they would in Production or Development (except for webhooks of type `TRANSFER`). - -See endpoint docs at .*/ - pub fn sandbox_item_fire_webhook( - &self, - access_token: &str, - webhook_code: &str, - ) -> FluentRequest<'_, request::SandboxItemFireWebhookRequest> { - FluentRequest { - client: self, - params: request::SandboxItemFireWebhookRequest { - access_token: access_token.to_owned(), - webhook_code: webhook_code.to_owned(), - webhook_type: None, - }, - } - } - /**Retrieve real-time balance data - -The `/accounts/balance/get` endpoint returns the real-time balance for each of an Item's accounts. While other endpoints, such as `/accounts/get`, return a balance object, only `/accounts/balance/get` forces the available and current balance fields to be refreshed rather than cached. This endpoint can be used for existing Items that were added via any of Plaid’s other products. This endpoint can be used as long as Link has been initialized with any other product, `balance` itself is not a product that can be used to initialize Link. As this endpoint triggers a synchronous request for fresh data, latency may be higher than for other Plaid endpoints (typically less than 10 seconds, but occasionally up to 30 seconds or more); if you encounter errors, you may find it necessary to adjust your timeout period when making requests. - -See endpoint docs at .*/ - pub fn accounts_balance_get( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::AccountsBalanceGetRequest> { - FluentRequest { - client: self, - params: request::AccountsBalanceGetRequest { - access_token: access_token.to_owned(), - options: None, - payment_details: None, - }, - } - } - /**Retrieve identity data - -The `/identity/get` endpoint allows you to retrieve various account holder information on file with the financial institution, including names, emails, phone numbers, and addresses. Only name data is guaranteed to be returned; other fields will be empty arrays if not provided by the institution. - -This request may take some time to complete if identity was not specified as an initial product when creating the Item. This is because Plaid must communicate directly with the institution to retrieve the data. - -Note: In API versions 2018-05-22 and earlier, the `owners` object is not returned, and instead identity information is returned in the top level `identity` object. For more details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2019-05-29). - -See endpoint docs at .*/ - pub fn identity_get( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::IdentityGetRequest> { - FluentRequest { - client: self, - params: request::IdentityGetRequest { - access_token: access_token.to_owned(), - options: None, - }, - } - } - /**Retrieve identity match score - -The `/identity/match` endpoint generates a match score, which indicates how well the provided identity data matches the identity information on file with the account holder's financial institution. - -Fields within the `balances` object will always be null when retrieved by `/identity/match`. Instead, use the free `/accounts/get` endpoint to request balance cached data, or `/accounts/balance/get` for real-time data. - -This request may take some time to complete if Identity was not specified as an initial product when creating the Item. This is because Plaid must communicate directly with the institution to retrieve the data. - -See endpoint docs at .*/ - pub fn identity_match( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::IdentityMatchRequest> { - FluentRequest { - client: self, - params: request::IdentityMatchRequest { - access_token: access_token.to_owned(), - options: None, - user: None, - }, - } - } - /**Refresh identity data - -`/identity/refresh` is an optional endpoint for users of the Identity product. It initiates an on-demand extraction to fetch the most up to date Identity information from the Financial Institution. This on-demand extraction takes place in addition to the periodic extractions that automatically occur any Identity-enabled Item. If changes to Identity are discovered after calling `/identity/refresh`, Plaid will fire a webhook [`DEFAULT_UPDATE`](https://plaid.com/docs/api/products/identity/#default_update). -`/identity/refresh` is offered as an add-on to Identity and has a separate [fee model](/docs/account/billing/#per-request-flat-fee). To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. - -See endpoint docs at .*/ - pub fn identity_refresh( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::IdentityRefreshRequest> { - FluentRequest { - client: self, - params: request::IdentityRefreshRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Retrieve a dashboard user - -Retrieve information about a dashboard user. - -See endpoint docs at .*/ - pub fn dashboard_user_get( - &self, - dashboard_user_id: &str, - ) -> FluentRequest<'_, request::DashboardUserGetRequest> { - FluentRequest { - client: self, - params: request::DashboardUserGetRequest { - dashboard_user_id: dashboard_user_id.to_owned(), - }, - } - } - /**List dashboard users - -List all dashboard users associated with your account. - -See endpoint docs at .*/ - pub fn dashboard_user_list( - &self, - ) -> FluentRequest<'_, request::DashboardUserListRequest> { - FluentRequest { - client: self, - params: request::DashboardUserListRequest { - cursor: None, - }, - } - } - /**Create a new Identity Verification - -Create a new Identity Verification for the user specified by the `client_user_id` field. The requirements and behavior of the verification are determined by the `template_id` provided. -If you don't know whether the associated user already has an active Identity Verification, you can specify `"is_idempotent": true` in the request body. With idempotency enabled, a new Identity Verification will only be created if one does not already exist for the associated `client_user_id` and `template_id`. If an Identity Verification is found, it will be returned unmodified with an `200 OK` HTTP status code. - -You can also use this endpoint to supply information you already have collected about the user; if any of these fields are specified, the screens prompting the user to enter them will be skipped during the Link flow. - - -See endpoint docs at .*/ - pub fn identity_verification_create( - &self, - gave_consent: bool, - is_shareable: bool, - template_id: &str, - ) -> FluentRequest<'_, request::IdentityVerificationCreateRequest> { - FluentRequest { - client: self, - params: request::IdentityVerificationCreateRequest { - client_user_id: None, - gave_consent, - is_idempotent: None, - is_shareable, - template_id: template_id.to_owned(), - user: None, - }, - } - } - /**Retrieve Identity Verification - -Retrieve a previously created Identity Verification. - -See endpoint docs at .*/ - pub fn identity_verification_get( - &self, - identity_verification_id: &str, - ) -> FluentRequest<'_, request::IdentityVerificationGetRequest> { - FluentRequest { - client: self, - params: request::IdentityVerificationGetRequest { - identity_verification_id: identity_verification_id.to_owned(), - }, - } - } - /**List Identity Verifications - -Filter and list Identity Verifications created by your account - -See endpoint docs at .*/ - pub fn identity_verification_list( - &self, - client_user_id: &str, - template_id: &str, - ) -> FluentRequest<'_, request::IdentityVerificationListRequest> { - FluentRequest { - client: self, - params: request::IdentityVerificationListRequest { - client_user_id: client_user_id.to_owned(), - cursor: None, - template_id: template_id.to_owned(), - }, - } - } - /**Retry an Identity Verification - -Allow a customer to retry their Identity Verification - -See endpoint docs at .*/ - pub fn identity_verification_retry( - &self, - client_user_id: &str, - strategy: &str, - template_id: &str, - ) -> FluentRequest<'_, request::IdentityVerificationRetryRequest> { - FluentRequest { - client: self, - params: request::IdentityVerificationRetryRequest { - client_user_id: client_user_id.to_owned(), - steps: None, - strategy: strategy.to_owned(), - template_id: template_id.to_owned(), - user: None, - }, - } - } - /**Create a watchlist screening for an entity - -Create a new entity watchlist screening to check your customer against watchlists defined in the associated entity watchlist program. If your associated program has ongoing screening enabled, this is the profile information that will be used to monitor your customer over time. - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_create( - &self, - search_terms: EntityWatchlistSearchTerms, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityCreateRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityCreateRequest { - client_user_id: None, - search_terms, - }, - } - } - /**Get an entity screening - -Retrieve an entity watchlist screening. - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_get( - &self, - entity_watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityGetRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityGetRequest { - entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), - }, - } - } - /**List history for entity watchlist screenings - -List all changes to the entity watchlist screening in reverse-chronological order. If the watchlist screening has not been edited, no history will be returned. - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_history_list( - &self, - entity_watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityHistoryListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityHistoryListRequest { - cursor: None, - entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), - }, - } - } - /**List hits for entity watchlist screenings - -List all hits for the entity watchlist screening. - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_hit_list( - &self, - entity_watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityHitListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityHitListRequest { - cursor: None, - entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), - }, - } - } - /**List entity watchlist screenings - -List all entity screenings. - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_list( - &self, - entity_watchlist_program_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityListRequest { - assignee: None, - client_user_id: None, - cursor: None, - entity_watchlist_program_id: entity_watchlist_program_id.to_owned(), - status: None, - }, - } - } - /**Get entity watchlist screening program - -Get an entity watchlist screening program - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_program_get( - &self, - entity_watchlist_program_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityProgramGetRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityProgramGetRequest { - entity_watchlist_program_id: entity_watchlist_program_id.to_owned(), - }, - } - } - /**List entity watchlist screening programs - -List all entity watchlist screening programs - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_program_list( - &self, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityProgramListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityProgramListRequest { - cursor: None, - }, - } - } - /**Create a review for an entity watchlist screening - -Create a review for an entity watchlist screening. Reviews are compliance reports created by users in your organization regarding the relevance of potential hits found by Plaid. - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_review_create( - &self, - confirmed_hits: &[&str], - dismissed_hits: &[&str], - entity_watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityReviewCreateRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityReviewCreateRequest { - comment: None, - confirmed_hits: confirmed_hits.iter().map(|&x| x.to_owned()).collect(), - dismissed_hits: dismissed_hits.iter().map(|&x| x.to_owned()).collect(), - entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), - }, - } - } - /**List reviews for entity watchlist screenings - -List all reviews for a particular entity watchlist screening. Reviews are compliance reports created by users in your organization regarding the relevance of potential hits found by Plaid. - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_review_list( - &self, - entity_watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityReviewListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityReviewListRequest { - cursor: None, - entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), - }, - } - } - /**Update an entity screening - -Update an entity watchlist screening. - -See endpoint docs at .*/ - pub fn watchlist_screening_entity_update( - &self, - entity_watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningEntityUpdateRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningEntityUpdateRequest { - assignee: None, - client_user_id: None, - entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), - reset_fields: None, - search_terms: None, - status: None, - }, - } - } - /**Create a watchlist screening for a person - -Create a new Watchlist Screening to check your customer against watchlists defined in the associated Watchlist Program. If your associated program has ongoing screening enabled, this is the profile information that will be used to monitor your customer over time. - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_create( - &self, - search_terms: WatchlistScreeningRequestSearchTerms, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualCreateRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualCreateRequest { - client_user_id: None, - search_terms, - }, - } - } - /**Retrieve an individual watchlist screening - -Retrieve a previously created individual watchlist screening - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_get( - &self, - watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualGetRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualGetRequest { - watchlist_screening_id: watchlist_screening_id.to_owned(), - }, - } - } - /**List history for individual watchlist screenings - -List all changes to the individual watchlist screening in reverse-chronological order. If the watchlist screening has not been edited, no history will be returned. - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_history_list( - &self, - watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualHistoryListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualHistoryListRequest { - cursor: None, - watchlist_screening_id: watchlist_screening_id.to_owned(), - }, - } - } - /**List hits for individual watchlist screening - -List all hits found by Plaid for a particular individual watchlist screening. - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_hit_list( - &self, - watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualHitListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualHitListRequest { - cursor: None, - watchlist_screening_id: watchlist_screening_id.to_owned(), - }, - } - } - /**List Individual Watchlist Screenings - -List previously created watchlist screenings for individuals - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_list( - &self, - watchlist_program_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualListRequest { - assignee: None, - client_user_id: None, - cursor: None, - status: None, - watchlist_program_id: watchlist_program_id.to_owned(), - }, - } - } - /**Get individual watchlist screening program - -Get an individual watchlist screening program - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_program_get( - &self, - watchlist_program_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualProgramGetRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualProgramGetRequest { - watchlist_program_id: watchlist_program_id.to_owned(), - }, - } - } - /**List individual watchlist screening programs - -List all individual watchlist screening programs - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_program_list( - &self, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualProgramListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualProgramListRequest { - cursor: None, - }, - } - } - /**Create a review for an individual watchlist screening - -Create a review for the individual watchlist screening. Reviews are compliance reports created by users in your organization regarding the relevance of potential hits found by Plaid. - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_review_create( - &self, - confirmed_hits: &[&str], - dismissed_hits: &[&str], - watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualReviewCreateRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualReviewCreateRequest { - comment: None, - confirmed_hits: confirmed_hits.iter().map(|&x| x.to_owned()).collect(), - dismissed_hits: dismissed_hits.iter().map(|&x| x.to_owned()).collect(), - watchlist_screening_id: watchlist_screening_id.to_owned(), - }, - } - } - /**List reviews for individual watchlist screenings - -List all reviews for the individual watchlist screening. - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_review_list( - &self, - watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualReviewListRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualReviewListRequest { - cursor: None, - watchlist_screening_id: watchlist_screening_id.to_owned(), - }, - } - } - /**Update individual watchlist screening - -Update a specific individual watchlist screening. This endpoint can be used to add additional customer information, correct outdated information, add a reference id, assign the individual to a reviewer, and update which program it is associated with. Please note that you may not update `search_terms` and `status` at the same time since editing `search_terms` may trigger an automatic `status` change. - -See endpoint docs at .*/ - pub fn watchlist_screening_individual_update( - &self, - watchlist_screening_id: &str, - ) -> FluentRequest<'_, request::WatchlistScreeningIndividualUpdateRequest> { - FluentRequest { - client: self, - params: request::WatchlistScreeningIndividualUpdateRequest { - assignee: None, - client_user_id: None, - reset_fields: None, - search_terms: None, - status: None, - watchlist_screening_id: watchlist_screening_id.to_owned(), - }, - } - } - /**Create a Beacon User - -Create and scan a Beacon User against your Beacon Program, according to your program's settings. - -When you submit a new user to `/beacon/user/create`, several checks are performed immediately: - - - The user's PII (provided within the `user` object) is searched against all other users within the Beacon Program you specified. If a match is found that violates your program's "Duplicate Information Filtering" settings, the user will be returned with a status of `pending_review`. - - - The user's PII is also searched against all fraud reports created by your organization across all of your Beacon Programs. If the user's data matches a fraud report that your team created, the user will be returned with a status of `rejected`. - - - Finally, the user's PII is searched against all fraud report shared with the Beacon Network by other companies. If a matching fraud report is found, the user will be returned with a `pending_review` status if your program has enabled automatic flagging based on network fraud. - -See endpoint docs at .*/ - pub fn beacon_user_create( - &self, - client_user_id: &str, - program_id: &str, - user: BeaconUserRequestData, - ) -> FluentRequest<'_, request::BeaconUserCreateRequest> { - FluentRequest { - client: self, - params: request::BeaconUserCreateRequest { - client_user_id: client_user_id.to_owned(), - program_id: program_id.to_owned(), - user, - }, - } - } - /**Get a Beacon User - -Fetch a Beacon User. - -The Beacon User is returned with all of their associated information and a `status` based on the Beacon Network duplicate record and fraud checks. - - -See endpoint docs at .*/ - pub fn beacon_user_get( - &self, - beacon_user_id: &str, - ) -> FluentRequest<'_, request::BeaconUserGetRequest> { - FluentRequest { - client: self, - params: request::BeaconUserGetRequest { - beacon_user_id: beacon_user_id.to_owned(), - }, - } - } - /**Review a Beacon User - -Update the status of a Beacon User. - -When updating a Beacon User's status via this endpoint, Plaid validates that the status change is consistent with the related state for this Beacon User. Specifically, we will check: - -1. Whether there are any associated Beacon Reports connected to the Beacon User, and -2. Whether there are any confirmed Beacon Report Syndications connected to the Beacon User. - -When updating a Beacon User's status to "rejected", we enforce that either a Beacon Report has been created for the Beacon User or a Beacon Report Syndication has been confirmed. -When updating a Beacon User's status to "cleared", we enforce that there are no active Beacon Reports or confirmed Beacon Report Syndications associated with the user. If you previously created a Beacon Report for this user, you must delete it before updating the Beacon User's status to "cleared". -There are no restrictions on updating a Beacon User's status to "pending_review". - -If these conditions are not met, the request will be rejected with an error explaining the issue. - -See endpoint docs at .*/ - pub fn beacon_user_review( - &self, - beacon_user_id: &str, - status: &str, - ) -> FluentRequest<'_, request::BeaconUserReviewRequest> { - FluentRequest { - client: self, - params: request::BeaconUserReviewRequest { - beacon_user_id: beacon_user_id.to_owned(), - status: status.to_owned(), - }, - } - } - /**Create a Beacon Report - -Create a fraud report for a given Beacon User. - -Note: If you are creating users with the express purpose of providing historical fraud data, you should use the `/beacon/user/create` endpoint instead and embed the fraud report in the request. This will ensure that the Beacon User you create will not be subject to any billing costs. - -See endpoint docs at .*/ - pub fn beacon_report_create( - &self, - beacon_user_id: &str, - fraud_date: chrono::NaiveDate, - type_: &str, - ) -> FluentRequest<'_, request::BeaconReportCreateRequest> { - FluentRequest { - client: self, - params: request::BeaconReportCreateRequest { - beacon_user_id: beacon_user_id.to_owned(), - fraud_amount: None, - fraud_date, - type_: type_.to_owned(), - }, - } - } - /**List Beacon Reports for a Beacon User - -Use the `/beacon/report/list` endpoint to view all Beacon Reports you created for a specific Beacon User. The reports returned by this endpoint are exclusively reports you created for a specific user. A Beacon User can only have one active report at a time, but a new report can be created if a previous report has been deleted. The results from this endpoint are paginated; the `next_cursor` field will be populated if there is another page of results that can be retrieved. To fetch the next page, pass the `next_cursor` value as the `cursor` parameter in the next request. - -See endpoint docs at .*/ - pub fn beacon_report_list( - &self, - beacon_user_id: &str, - ) -> FluentRequest<'_, request::BeaconReportListRequest> { - FluentRequest { - client: self, - params: request::BeaconReportListRequest { - beacon_user_id: beacon_user_id.to_owned(), - cursor: None, - }, - } - } - /**List Beacon Report Syndications for a Beacon User - -Use the `/beacon/report_syndication/list` endpoint to view all Beacon Reports that have been syndicated to a specific Beacon User. This endpoint returns Beacon Report Syndications which are references to Beacon Reports created either by you, or another Beacon customer, that matched the specified Beacon User. A Beacon User can have multiple active Beacon Report Syndications at once. The results from this endpoint are paginated; the `next_cursor` field will be populated if there is another page of results that can be retrieved. To fetch the next page, pass the `next_cursor` value as the `cursor` parameter in the next request. - -See endpoint docs at .*/ - pub fn beacon_report_syndication_list( - &self, - beacon_user_id: &str, - ) -> FluentRequest<'_, request::BeaconReportSyndicationListRequest> { - FluentRequest { - client: self, - params: request::BeaconReportSyndicationListRequest { - beacon_user_id: beacon_user_id.to_owned(), - cursor: None, - }, - } - } - /**Get a Beacon Report - -Returns a Beacon report for a given Beacon report id. - -See endpoint docs at .*/ - pub fn beacon_report_get( - &self, - beacon_report_id: &str, - ) -> FluentRequest<'_, request::BeaconReportGetRequest> { - FluentRequest { - client: self, - params: request::BeaconReportGetRequest { - beacon_report_id: beacon_report_id.to_owned(), - }, - } - } - /**Get a Beacon Report Syndication - -Returns a Beacon Report Syndication for a given Beacon Report Syndication id. - -See endpoint docs at .*/ - pub fn beacon_report_syndication_get( - &self, - beacon_report_syndication_id: &str, - ) -> FluentRequest<'_, request::BeaconReportSyndicationGetRequest> { - FluentRequest { - client: self, - params: request::BeaconReportSyndicationGetRequest { - beacon_report_syndication_id: beacon_report_syndication_id.to_owned(), - }, - } - } - /**Update the identity data of a Beacon User - -Update the identity data for a Beacon User in your Beacon Program. - -Similar to `/beacon/user/create`, several checks are performed immediately when you submit a change to `/beacon/user/update`: - - - The user's updated PII is searched against all other users within the Beacon Program you specified. If a match is found that violates your program's "Duplicate Information Filtering" settings, the user will be returned with a status of `pending_review`. - - - The user's updated PII is also searched against all fraud reports created by your organization across all of your Beacon Programs. If the user's data matches a fraud report that your team created, the user will be returned with a status of `rejected`. - - - Finally, the user's PII is searched against all fraud report shared with the Beacon Network by other companies. If a matching fraud report is found, the user will be returned with a `pending_review` status if your program has enabled automatic flagging based on network fraud. - -Plaid maintains a version history for each Beacon User, so the Beacon User's identity data before and after the update is retained as separate versions. - -See endpoint docs at .*/ - pub fn beacon_user_update( - &self, - beacon_user_id: &str, - user: BeaconUserUpdateRequestData, - ) -> FluentRequest<'_, request::BeaconUserUpdateRequest> { - FluentRequest { - client: self, - params: request::BeaconUserUpdateRequest { - beacon_user_id: beacon_user_id.to_owned(), - user, - }, - } - } - /**Get a Beacon Duplicate - -Returns a Beacon Duplicate for a given Beacon Duplicate id. - -A Beacon Duplicate represents a pair of similar Beacon Users within your organization. - -Two Beacon User revisions are returned for each Duplicate record in either the `beacon_user1` or `beacon_user2` response fields. - -The `analysis` field in the response indicates which fields matched between `beacon_user1` and `beacon_user2`. - - -See endpoint docs at .*/ - pub fn beacon_duplicate_get( - &self, - beacon_duplicate_id: &str, - ) -> FluentRequest<'_, request::BeaconDuplicateGetRequest> { - FluentRequest { - client: self, - params: request::BeaconDuplicateGetRequest { - beacon_duplicate_id: beacon_duplicate_id.to_owned(), - }, - } - } - /**Create autofill for an Identity Verification - -Try to autofill an Identity Verification based of the provided phone number, date of birth and country of residence. - -See endpoint docs at .*/ - pub fn identity_verification_autofill_create( - &self, - identity_verification_id: &str, - ) -> FluentRequest<'_, request::IdentityVerificationAutofillCreateRequest> { - FluentRequest { - client: self, - params: request::IdentityVerificationAutofillCreateRequest { - identity_verification_id: identity_verification_id.to_owned(), - }, - } - } - /**Retrieve Auth data - -The `/processor/auth/get` endpoint returns the bank account and bank identification number (such as the routing number, for US accounts), for a checking or savings account that''s associated with a given `processor_token`. The endpoint also returns high-level account data and balances when available. - -Versioning note: API versions 2019-05-29 and earlier use a different schema for the `numbers` object returned by this endpoint. For details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2020-09-14). - - -See endpoint docs at .*/ - pub fn processor_auth_get( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorAuthGetRequest> { - FluentRequest { - client: self, - params: request::ProcessorAuthGetRequest { - processor_token: processor_token.to_owned(), - }, - } - } - /**Retrieve the account associated with a processor token - -This endpoint returns the account associated with a given processor token. - -This endpoint retrieves cached information, rather than extracting fresh information from the institution. As a result, the account balance returned may not be up-to-date; for realtime balance information, use `/processor/balance/get` instead. Note that some information is nullable. - - -See endpoint docs at .*/ - pub fn processor_account_get( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorAccountGetRequest> { - FluentRequest { - client: self, - params: request::ProcessorAccountGetRequest { - processor_token: processor_token.to_owned(), - }, - } - } - /**Get transaction data - -The `/processor/transactions/get` endpoint allows developers to receive user-authorized transaction data for credit, depository, and some loan-type accounts (only those with account subtype `student`; coverage may be limited). Transaction data is standardized across financial institutions, and in many cases transactions are linked to a clean name, entity type, location, and category. Similarly, account data is standardized and returned with a clean name, number, balance, and other meta information where available. - -Transactions are returned in reverse-chronological order, and the sequence of transaction ordering is stable and will not shift. Transactions are not immutable and can also be removed altogether by the institution; a removed transaction will no longer appear in `/processor/transactions/get`. For more details, see [Pending and posted transactions](https://plaid.com/docs/transactions/transactions-data/#pending-and-posted-transactions). - -Due to the potentially large number of transactions associated with a processor token, results are paginated. Manipulate the `count` and `offset` parameters in conjunction with the `total_transactions` response body field to fetch all available transactions. - -Data returned by `/processor/transactions/get` will be the data available for the processor token as of the most recent successful check for new transactions. Plaid typically checks for new data multiple times a day, but these checks may occur less frequently, such as once a day, depending on the institution. To force Plaid to check for new transactions, you can use the `/processor/transactions/refresh` endpoint. - -Note that data may not be immediately available to `/processor/transactions/get`. Plaid will begin to prepare transactions data upon Item link, if Link was initialized with `transactions`, or upon the first call to `/processor/transactions/get`, if it wasn't. If no transaction history is ready when `/processor/transactions/get` is called, it will return a `PRODUCT_NOT_READY` error. - -To receive Transactions webhooks for a processor token, set its webhook URL via the [`/processor/token/webhook/update`](https://plaid.com/docs/api/processors/#processortokenwebhookupdate) endpoint. - -See endpoint docs at .*/ - pub fn processor_transactions_get( - &self, - end_date: chrono::NaiveDate, - processor_token: &str, - start_date: chrono::NaiveDate, - ) -> FluentRequest<'_, request::ProcessorTransactionsGetRequest> { - FluentRequest { - client: self, - params: request::ProcessorTransactionsGetRequest { - end_date, - options: None, - processor_token: processor_token.to_owned(), - start_date, - }, - } - } - /**Get incremental transaction updates on a processor token - -This endpoint replaces `/processor/transactions/get` and its associated webhooks for most common use-cases. - -The `/processor/transactions/sync` endpoint allows developers to subscribe to all transactions associated with a processor token and get updates synchronously in a stream-like manner, using a cursor to track which updates have already been seen. `/processor/transactions/sync` provides the same functionality as `/processor/transactions/get` and can be used instead of `/processor/transactions/get` to simplify the process of tracking transactions updates. - -This endpoint provides user-authorized transaction data for `credit`, `depository`, and some loan-type accounts (only those with account subtype `student`; coverage may be limited). For transaction history from `investments` accounts, use `/investments/transactions/get` instead. - -Returned transactions data is grouped into three types of update, indicating whether the transaction was added, removed, or modified since the last call to the API. - -In the first call to `/processor/transactions/sync` for a processor token, the endpoint will return all historical transactions data associated with that processor token up until the time of the API call (as "adds"), which then generates a `next_cursor` for that processor token. In subsequent calls, send the `next_cursor` to receive only the changes that have occurred since the previous call. - -Due to the potentially large number of transactions associated with a processor token, results are paginated. The `has_more` field specifies if additional calls are necessary to fetch all available transaction updates. Call `/processor/transactions/sync` with the new cursor, pulling all updates, until `has_more` is `false`. - -When retrieving paginated updates, track both the `next_cursor` from the latest response and the original cursor from the first call in which `has_more` was `true`; if a call to `/processor/transactions/sync` fails when retrieving a paginated update, which can occur as a result of the [`TRANSACTIONS_SYNC_MUTATION_DURING_PAGINATION`](https://plaid.com/docs/errors/transactions/#transactions_sync_mutation_during_pagination) error, the entire pagination request loop must be restarted beginning with the cursor for the first page of the update, rather than retrying only the single request that failed. - -Whenever new or updated transaction data becomes available, `/processor/transactions/sync` will provide these updates. Plaid typically checks for new data multiple times a day, but these checks may occur less frequently, such as once a day, depending on the institution. To force Plaid to check for new transactions, use the `/processor/transactions/refresh` endpoint. - -Note that for newly created processor tokens, data may not be immediately available to `/processor/transactions/sync`. Plaid begins preparing transactions data when the corresponding Item is created, but the process can take anywhere from a few seconds to several minutes to complete, depending on the number of transactions available. - -To receive Transactions webhooks for a processor token, set its webhook URL via the [`/processor/token/webhook/update`](https://plaid.com/docs/api/processors/#processortokenwebhookupdate) endpoint. - -See endpoint docs at .*/ - pub fn processor_transactions_sync( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorTransactionsSyncRequest> { - FluentRequest { - client: self, - params: request::ProcessorTransactionsSyncRequest { - count: None, - cursor: None, - options: None, - processor_token: processor_token.to_owned(), - }, - } - } - /**Refresh transaction data - -`/processor/transactions/refresh` is an optional endpoint for users of the Transactions product. It initiates an on-demand extraction to fetch the newest transactions for a processor token. This on-demand extraction takes place in addition to the periodic extractions that automatically occur multiple times a day for any Transactions-enabled processor token. If changes to transactions are discovered after calling `/processor/transactions/refresh`, Plaid will fire a webhook: for `/transactions/sync` users, [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#sync_updates_available) will be fired if there are any transactions updated, added, or removed. For users of both `/processor/transactions/sync` and `/processor/transactions/get`, [`TRANSACTIONS_REMOVED`](https://plaid.com/docs/api/products/transactions/#transactions_removed) will be fired if any removed transactions are detected, and [`DEFAULT_UPDATE`](https://plaid.com/docs/api/products/transactions/#default_update) will be fired if any new transactions are detected. New transactions can be fetched by calling `/processor/transactions/get` or `/processor/transactions/sync`. Note that the `/processor/transactions/refresh` endpoint is not supported for Capital One (`ins_128026`) and will result in a `PRODUCT_NOT_SUPPORTED` error if called on a processor token from that institution. - -`/processor/transactions/refresh` is offered as an add-on to Transactions and has a separate [fee model](/docs/account/billing/#per-request-flat-fee). To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. - -See endpoint docs at .*/ - pub fn processor_transactions_refresh( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorTransactionsRefreshRequest> { - FluentRequest { - client: self, - params: request::ProcessorTransactionsRefreshRequest { - processor_token: processor_token.to_owned(), - }, - } - } - /**Fetch recurring transaction streams - -The `/processor/transactions/recurring/get` endpoint allows developers to receive a summary of the recurring outflow and inflow streams (expenses and deposits) from a user’s checking, savings or credit card accounts. Additionally, Plaid provides key insights about each recurring stream including the category, merchant, last amount, and more. Developers can use these insights to build tools and experiences that help their users better manage cash flow, monitor subscriptions, reduce spend, and stay on track with bill payments. - -This endpoint is offered as an add-on to Transactions. To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. - -This endpoint can only be called on a processor token that has already been initialized with Transactions (either during Link, by specifying it in `/link/token/create`; or after Link, by calling `/processor/transactions/get` or `/processor/transactions/sync`). Once all historical transactions have been fetched, call `/processor/transactions/recurring/get` to receive the Recurring Transactions streams and subscribe to the [`RECURRING_TRANSACTIONS_UPDATE`](https://plaid.com/docs/api/products/transactions/#recurring_transactions_update) webhook. To know when historical transactions have been fetched, if you are using `/processor/transactions/sync` listen for the [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#SyncUpdatesAvailableWebhook-historical-update-complete) webhook and check that the `historical_update_complete` field in the payload is `true`. If using `/processor/transactions/get`, listen for the [`HISTORICAL_UPDATE`](https://plaid.com/docs/api/products/transactions/#historical_update) webhook. - -After the initial call, you can call `/processor/transactions/recurring/get` endpoint at any point in the future to retrieve the latest summary of recurring streams. Listen to the [`RECURRING_TRANSACTIONS_UPDATE`](https://plaid.com/docs/api/products/transactions/#recurring_transactions_update) webhook to be notified when new updates are available. - -To receive Transactions webhooks for a processor token, set its webhook URL via the [`/processor/token/webhook/update`](https://plaid.com/docs/api/processors/#processortokenwebhookupdate) endpoint. - -See endpoint docs at .*/ - pub fn processor_transactions_recurring_get( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorTransactionsRecurringGetRequest> { - FluentRequest { - client: self, - params: request::ProcessorTransactionsRecurringGetRequest { - options: None, - processor_token: processor_token.to_owned(), - }, - } - } - /**Evaluate a planned ACH transaction - -Use `/processor/signal/evaluate` to evaluate a planned ACH transaction as a processor to get a return risk assessment (such as a risk score and risk tier) and additional risk signals. - -In order to obtain a valid score for an ACH transaction, Plaid must have an access token for the account, and the Item must be healthy (receiving product updates) or have recently been in a healthy state. If the transaction does not meet eligibility requirements, an error will be returned corresponding to the underlying cause. If `/processor/signal/evaluate` is called on the same transaction multiple times within a 24-hour period, cached results may be returned. For more information please refer to our error documentation on [item errors](/docs/errors/item/) and [Link in Update Mode](/docs/link/update-mode/). - -Note: This request may take some time to complete if Signal is being added to an existing Item. This is because Plaid must communicate directly with the institution when retrieving the data for the first time. To reduce this latency, you can call `/signal/prepare` on the Item before you need to request Signal data. - -See endpoint docs at .*/ - pub fn processor_signal_evaluate( - &self, - amount: f64, - client_transaction_id: &str, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorSignalEvaluateRequest> { - FluentRequest { - client: self, - params: request::ProcessorSignalEvaluateRequest { - amount, - client_transaction_id: client_transaction_id.to_owned(), - client_user_id: None, - default_payment_method: None, - device: None, - is_recurring: None, - processor_token: processor_token.to_owned(), - user: None, - user_present: None, - }, - } - } - /**Report whether you initiated an ACH transaction - -After calling `/processor/signal/evaluate`, call `/processor/signal/decision/report` to report whether the transaction was initiated. - -See endpoint docs at .*/ - pub fn processor_signal_decision_report( - &self, - client_transaction_id: &str, - initiated: bool, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorSignalDecisionReportRequest> { - FluentRequest { - client: self, - params: request::ProcessorSignalDecisionReportRequest { - amount_instantly_available: None, - client_transaction_id: client_transaction_id.to_owned(), - days_funds_on_hold: None, - decision_outcome: None, - initiated, - payment_method: None, - processor_token: processor_token.to_owned(), - }, - } - } - /**Report a return for an ACH transaction - -Call the `/processor/signal/return/report` endpoint to report a returned transaction that was previously sent to the `/processor/signal/evaluate` endpoint. Your feedback will be used by the model to incorporate the latest risk trend in your portfolio. - -See endpoint docs at .*/ - pub fn processor_signal_return_report( - &self, - client_transaction_id: &str, - processor_token: &str, - return_code: &str, - ) -> FluentRequest<'_, request::ProcessorSignalReturnReportRequest> { - FluentRequest { - client: self, - params: request::ProcessorSignalReturnReportRequest { - client_transaction_id: client_transaction_id.to_owned(), - processor_token: processor_token.to_owned(), - return_code: return_code.to_owned(), - returned_at: None, - }, - } - } - /**Opt-in a processor token to Signal - -When a processor token is not initialized with Signal, call `/processor/signal/prepare` to opt-in that processor token to the Signal data collection process, which will improve the accuracy of the Signal score. - -If this endpoint is called with a processor token that is already initialized with Signal, it will return a 200 response and will not modify the processor token. - -See endpoint docs at .*/ - pub fn processor_signal_prepare( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorSignalPrepareRequest> { - FluentRequest { - client: self, - params: request::ProcessorSignalPrepareRequest { - processor_token: processor_token.to_owned(), - }, - } - } - /**Create a bank transfer as a processor - -Use the `/processor/bank_transfer/create` endpoint to initiate a new bank transfer as a processor - -See endpoint docs at .*/ - pub fn processor_bank_transfer_create( - &self, - args: request::ProcessorBankTransferCreateRequired, - ) -> FluentRequest<'_, request::ProcessorBankTransferCreateRequest> { - FluentRequest { - client: self, - params: request::ProcessorBankTransferCreateRequest { - ach_class: None, - amount: args.amount.to_owned(), - custom_tag: None, - description: args.description.to_owned(), - idempotency_key: args.idempotency_key.to_owned(), - iso_currency_code: args.iso_currency_code.to_owned(), - metadata: None, - network: args.network.to_owned(), - origination_account_id: None, - processor_token: args.processor_token.to_owned(), - type_: args.type_.to_owned(), - user: args.user, - }, - } - } - /**Retrieve Liabilities data - -The `/processor/liabilities/get` endpoint returns various details about a loan or credit account. Liabilities data is available primarily for US financial institutions, with some limited coverage of Canadian institutions. Currently supported account types are account type `credit` with account subtype `credit card` or `paypal`, and account type `loan` with account subtype `student` or `mortgage`. - -The types of information returned by Liabilities can include balances and due dates, loan terms, and account details such as original loan amount and guarantor. Data is refreshed approximately once per day; the latest data can be retrieved by calling `/processor/liabilities/get`. - -Note: This request may take some time to complete if `liabilities` was not specified as an initial product when creating the processor token. This is because Plaid must communicate directly with the institution to retrieve the additional data. - -See endpoint docs at .*/ - pub fn processor_liabilities_get( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorLiabilitiesGetRequest> { - FluentRequest { - client: self, - params: request::ProcessorLiabilitiesGetRequest { - processor_token: processor_token.to_owned(), - }, - } - } - /**Retrieve Identity data - -The `/processor/identity/get` endpoint allows you to retrieve various account holder information on file with the financial institution, including names, emails, phone numbers, and addresses. - -See endpoint docs at .*/ - pub fn processor_identity_get( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorIdentityGetRequest> { - FluentRequest { - client: self, - params: request::ProcessorIdentityGetRequest { - processor_token: processor_token.to_owned(), - }, - } - } - /**Retrieve identity match score - -The `/processor/identity/match` endpoint generates a match score, which indicates how well the provided identity data matches the identity information on file with the account holder's financial institution. - -Fields within the `balances` object will always be null when retrieved by `/identity/match`. Instead, use the free `/accounts/get` endpoint to request balance cached data, or `/accounts/balance/get` for real-time data. - -This request may take some time to complete if Identity was not specified as an initial product when creating the Item. This is because Plaid must communicate directly with the institution to retrieve the data. - -See endpoint docs at .*/ - pub fn processor_identity_match( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorIdentityMatchRequest> { - FluentRequest { - client: self, - params: request::ProcessorIdentityMatchRequest { - processor_token: processor_token.to_owned(), - user: None, - }, - } - } - /**Retrieve Balance data - -The `/processor/balance/get` endpoint returns the real-time balance for each of an Item's accounts. While other endpoints may return a balance object, only `/processor/balance/get` forces the available and current balance fields to be refreshed rather than cached. - -See endpoint docs at .*/ - pub fn processor_balance_get( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorBalanceGetRequest> { - FluentRequest { - client: self, - params: request::ProcessorBalanceGetRequest { - options: None, - processor_token: processor_token.to_owned(), - }, - } - } - /**Update Webhook URL - -The POST `/item/webhook/update` allows you to update the webhook URL associated with an Item. This request triggers a [`WEBHOOK_UPDATE_ACKNOWLEDGED`](https://plaid.com/docs/api/items/#webhook_update_acknowledged) webhook to the newly specified webhook URL. - -See endpoint docs at .*/ - pub fn item_webhook_update( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::ItemWebhookUpdateRequest> { - FluentRequest { - client: self, - params: request::ItemWebhookUpdateRequest { - access_token: access_token.to_owned(), - webhook: None, - }, - } - } - /**Invalidate access_token - -By default, the `access_token` associated with an Item does not expire and should be stored in a persistent, secure manner. - -You can use the `/item/access_token/invalidate` endpoint to rotate the `access_token` associated with an Item. The endpoint returns a new `access_token` and immediately invalidates the previous `access_token`. - - -See endpoint docs at .*/ - pub fn item_access_token_invalidate( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::ItemAccessTokenInvalidateRequest> { - FluentRequest { - client: self, - params: request::ItemAccessTokenInvalidateRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Get webhook verification key - -Plaid signs all outgoing webhooks and provides JSON Web Tokens (JWTs) so that you can verify the authenticity of any incoming webhooks to your application. A message signature is included in the `Plaid-Verification` header. - -The `/webhook_verification_key/get` endpoint provides a JSON Web Key (JWK) that can be used to verify a JWT. - -See endpoint docs at .*/ - pub fn webhook_verification_key_get( - &self, - key_id: &str, - ) -> FluentRequest<'_, request::WebhookVerificationKeyGetRequest> { - FluentRequest { - client: self, - params: request::WebhookVerificationKeyGetRequest { - key_id: key_id.to_owned(), - }, - } - } - /**Retrieve Liabilities data - -The `/liabilities/get` endpoint returns various details about an Item with loan or credit accounts. Liabilities data is available primarily for US financial institutions, with some limited coverage of Canadian institutions. Currently supported account types are account type `credit` with account subtype `credit card` or `paypal`, and account type `loan` with account subtype `student` or `mortgage`. To limit accounts listed in Link to types and subtypes supported by Liabilities, you can use the `account_filters` parameter when [creating a Link token](https://plaid.com/docs/api/tokens/#linktokencreate). - -The types of information returned by Liabilities can include balances and due dates, loan terms, and account details such as original loan amount and guarantor. Data is refreshed approximately once per day; the latest data can be retrieved by calling `/liabilities/get`. - -Note: This request may take some time to complete if `liabilities` was not specified as an initial product when creating the Item. This is because Plaid must communicate directly with the institution to retrieve the additional data. - -See endpoint docs at .*/ - pub fn liabilities_get( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::LiabilitiesGetRequest> { - FluentRequest { - client: self, - params: request::LiabilitiesGetRequest { - access_token: access_token.to_owned(), - options: None, - }, - } - } - /**Create payment recipient - -Create a payment recipient for payment initiation. The recipient must be in Europe, within a country that is a member of the Single Euro Payment Area (SEPA) or a non-Eurozone country [supported](https://plaid.com/global) by Plaid. For a standing order (recurring) payment, the recipient must be in the UK. - -It is recommended to use `bacs` in the UK and `iban` in EU. - -The endpoint is idempotent: if a developer has already made a request with the same payment details, Plaid will return the same `recipient_id`. - - -See endpoint docs at .*/ - pub fn payment_initiation_recipient_create( - &self, - name: &str, - ) -> FluentRequest<'_, request::PaymentInitiationRecipientCreateRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationRecipientCreateRequest { - address: None, - bacs: None, - iban: None, - name: name.to_owned(), - }, - } - } - /**Reverse an existing payment - -Reverse a settled payment from a Plaid virtual account. - -The original payment must be in a settled state to be refunded. -To refund partially, specify the amount as part of the request. -If the amount is not specified, the refund amount will be equal to all -of the remaining payment amount that has not been refunded yet. - -The refund will go back to the source account that initiated the payment. -The original payment must have been initiated to a Plaid virtual account -so that this account can be used to initiate the refund. - - -See endpoint docs at .*/ - pub fn payment_initiation_payment_reverse( - &self, - idempotency_key: &str, - payment_id: &str, - reference: &str, - ) -> FluentRequest<'_, request::PaymentInitiationPaymentReverseRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationPaymentReverseRequest { - amount: None, - idempotency_key: idempotency_key.to_owned(), - payment_id: payment_id.to_owned(), - reference: reference.to_owned(), - }, - } - } - /**Get payment recipient - -Get details about a payment recipient you have previously created. - -See endpoint docs at .*/ - pub fn payment_initiation_recipient_get( - &self, - recipient_id: &str, - ) -> FluentRequest<'_, request::PaymentInitiationRecipientGetRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationRecipientGetRequest { - recipient_id: recipient_id.to_owned(), - }, - } - } - /**List payment recipients - -The `/payment_initiation/recipient/list` endpoint list the payment recipients that you have previously created. - -See endpoint docs at .*/ - pub fn payment_initiation_recipient_list( - &self, - ) -> FluentRequest<'_, request::PaymentInitiationRecipientListRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationRecipientListRequest { - }, - } - } - /**Create a payment - -After creating a payment recipient, you can use the `/payment_initiation/payment/create` endpoint to create a payment to that recipient. Payments can be one-time or standing order (recurring) and can be denominated in either EUR, GBP or other chosen [currency](https://plaid.com/docs/api/products/payment-initiation/#payment_initiation-payment-create-request-amount-currency). If making domestic GBP-denominated payments, your recipient must have been created with BACS numbers. In general, EUR-denominated payments will be sent via SEPA Credit Transfer, GBP-denominated payments will be sent via the Faster Payments network and for non-Eurozone markets typically via the local payment scheme, but the payment network used will be determined by the institution. Payments sent via Faster Payments will typically arrive immediately, while payments sent via SEPA Credit Transfer or other local payment schemes will typically arrive in one business day. - -Standing orders (recurring payments) must be denominated in GBP and can only be sent to recipients in the UK. Once created, standing order payments cannot be modified or canceled via the API. An end user can cancel or modify a standing order directly on their banking application or website, or by contacting the bank. Standing orders will follow the payment rules of the underlying rails (Faster Payments in UK). Payments can be sent Monday to Friday, excluding bank holidays. If the pre-arranged date falls on a weekend or bank holiday, the payment is made on the next working day. It is not possible to guarantee the exact time the payment will reach the recipient’s account, although at least 90% of standing order payments are sent by 6am. - -In the Development environment, payments must be below 5 GBP or other chosen [currency](https://plaid.com/docs/api/products/payment-initiation/#payment_initiation-payment-create-request-amount-currency). For details on any payment limits in Production, contact your Plaid Account Manager. - -See endpoint docs at .*/ - pub fn payment_initiation_payment_create( - &self, - amount: PaymentAmount, - recipient_id: &str, - reference: &str, - ) -> FluentRequest<'_, request::PaymentInitiationPaymentCreateRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationPaymentCreateRequest { - amount, - options: None, - recipient_id: recipient_id.to_owned(), - reference: reference.to_owned(), - schedule: None, - }, - } - } - /**Create payment token - -The `/payment_initiation/payment/token/create` endpoint has been deprecated. New Plaid customers will be unable to use this endpoint, and existing customers are encouraged to migrate to the newer, `link_token`-based flow. The recommended flow is to provide the `payment_id` to `/link/token/create`, which returns a `link_token` used to initialize Link. - -The `/payment_initiation/payment/token/create` is used to create a `payment_token`, which can then be used in Link initialization to enter a payment initiation flow. You can only use a `payment_token` once. If this attempt fails, the end user aborts the flow, or the token expires, you will need to create a new payment token. Creating a new payment token does not require end user input. - -See endpoint docs at .*/ - pub fn create_payment_token( - &self, - payment_id: &str, - ) -> FluentRequest<'_, request::CreatePaymentTokenRequest> { - FluentRequest { - client: self, - params: request::CreatePaymentTokenRequest { - payment_id: payment_id.to_owned(), - }, - } - } - /**Create payment consent - -The `/payment_initiation/consent/create` endpoint is used to create a payment consent, which can be used to initiate payments on behalf of the user. Payment consents are created with `UNAUTHORISED` status by default and must be authorised by the user before payments can be initiated. - -Consents can be limited in time and scope, and have constraints that describe limitations for payments. - -See endpoint docs at .*/ - pub fn payment_initiation_consent_create( - &self, - args: request::PaymentInitiationConsentCreateRequired, - ) -> FluentRequest<'_, request::PaymentInitiationConsentCreateRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationConsentCreateRequest { - constraints: args.constraints, - options: None, - recipient_id: args.recipient_id.to_owned(), - reference: args.reference.to_owned(), - scopes: args.scopes.iter().map(|&x| x.to_owned()).collect(), - }, - } - } - /**Get payment consent - -The `/payment_initiation/consent/get` endpoint can be used to check the status of a payment consent, as well as to receive basic information such as recipient and constraints. - -See endpoint docs at .*/ - pub fn payment_initiation_consent_get( - &self, - consent_id: &str, - ) -> FluentRequest<'_, request::PaymentInitiationConsentGetRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationConsentGetRequest { - consent_id: consent_id.to_owned(), - }, - } - } - /**Revoke payment consent - -The `/payment_initiation/consent/revoke` endpoint can be used to revoke the payment consent. Once the consent is revoked, it is not possible to initiate payments using it. - -See endpoint docs at .*/ - pub fn payment_initiation_consent_revoke( - &self, - consent_id: &str, - ) -> FluentRequest<'_, request::PaymentInitiationConsentRevokeRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationConsentRevokeRequest { - consent_id: consent_id.to_owned(), - }, - } - } - /**Execute a single payment using consent - -The `/payment_initiation/consent/payment/execute` endpoint can be used to execute payments using payment consent. - -See endpoint docs at .*/ - pub fn payment_initiation_consent_payment_execute( - &self, - amount: PaymentAmount, - consent_id: &str, - idempotency_key: &str, - ) -> FluentRequest<'_, request::PaymentInitiationConsentPaymentExecuteRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationConsentPaymentExecuteRequest { - amount, - consent_id: consent_id.to_owned(), - idempotency_key: idempotency_key.to_owned(), - }, - } - } - /**Force a Sandbox Item into an error state - -`/sandbox/item/reset_login/` forces an Item into an `ITEM_LOGIN_REQUIRED` state in order to simulate an Item whose login is no longer valid. This makes it easy to test Link's [update mode](https://plaid.com/docs/link/update-mode) flow in the Sandbox environment. After calling `/sandbox/item/reset_login`, You can then use Plaid Link update mode to restore the Item to a good state. An `ITEM_LOGIN_REQUIRED` webhook will also be fired after a call to this endpoint, if one is associated with the Item. - - -In the Sandbox, Items will transition to an `ITEM_LOGIN_REQUIRED` error state automatically after 30 days, even if this endpoint is not called. - -See endpoint docs at .*/ - pub fn sandbox_item_reset_login( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::SandboxItemResetLoginRequest> { - FluentRequest { - client: self, - params: request::SandboxItemResetLoginRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Set verification status for Sandbox account - -The `/sandbox/item/set_verification_status` endpoint can be used to change the verification status of an Item in in the Sandbox in order to simulate the Automated Micro-deposit flow. - -For more information on testing Automated Micro-deposits in Sandbox, see [Auth full coverage testing](https://plaid.com/docs/auth/coverage/testing#). - -See endpoint docs at .*/ - pub fn sandbox_item_set_verification_status( - &self, - access_token: &str, - account_id: &str, - verification_status: &str, - ) -> FluentRequest<'_, request::SandboxItemSetVerificationStatusRequest> { - FluentRequest { - client: self, - params: request::SandboxItemSetVerificationStatusRequest { - access_token: access_token.to_owned(), - account_id: account_id.to_owned(), - verification_status: verification_status.to_owned(), - }, - } - } - /**Exchange public token for an access token - -Exchange a Link `public_token` for an API `access_token`. Link hands off the `public_token` client-side via the `onSuccess` callback once a user has successfully created an Item. The `public_token` is ephemeral and expires after 30 minutes. An `access_token` does not expire, but can be revoked by calling `/item/remove`. - -The response also includes an `item_id` that should be stored with the `access_token`. The `item_id` is used to identify an Item in a webhook. The `item_id` can also be retrieved by making an `/item/get` request. - -See endpoint docs at .*/ - pub fn item_public_token_exchange( - &self, - public_token: &str, - ) -> FluentRequest<'_, request::ItemPublicTokenExchangeRequest> { - FluentRequest { - client: self, - params: request::ItemPublicTokenExchangeRequest { - public_token: public_token.to_owned(), - }, - } - } - /**Create public token - -Note: As of July 2020, the `/item/public_token/create` endpoint is deprecated. Instead, use `/link/token/create` with an `access_token` to create a Link token for use with [update mode](https://plaid.com/docs/link/update-mode). - -If you need your user to take action to restore or resolve an error associated with an Item, generate a public token with the `/item/public_token/create` endpoint and then initialize Link with that `public_token`. - -A `public_token` is one-time use and expires after 30 minutes. You use a `public_token` to initialize Link in [update mode](https://plaid.com/docs/link/update-mode) for a particular Item. You can generate a `public_token` for an Item even if you did not use Link to create the Item originally. - -The `/item/public_token/create` endpoint is **not** used to create your initial `public_token`. If you have not already received an `access_token` for a specific Item, use Link to obtain your `public_token` instead. See the [Quickstart](https://plaid.com/docs/quickstart) for more information. - -See endpoint docs at .*/ - pub fn item_create_public_token( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::ItemCreatePublicTokenRequest> { - FluentRequest { - client: self, - params: request::ItemCreatePublicTokenRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Create user - -This endpoint should be called for each of your end users before they begin a Plaid income flow. This provides you a single token to access all income data associated with the user. You should only create one per end user. - -If you call the endpoint multiple times with the same `client_user_id`, the first creation call will succeed and the rest will fail with an error message indicating that the user has been created for the given `client_user_id`. - -Ensure that you store the `user_token` along with your user's identifier in your database, as it is not possible to retrieve a previously created `user_token`. - -See endpoint docs at .*/ - pub fn user_create( - &self, - client_user_id: &str, - ) -> FluentRequest<'_, request::UserCreateRequest> { - FluentRequest { - client: self, - params: request::UserCreateRequest { - client_user_id: client_user_id.to_owned(), - consumer_report_user_identity: None, - }, - } - } - /**Update user information - -This endpoint is used to update user information associated with an existing `user_token`. The `user_token` should be in the response of `/user/create` call - -If you call the endpoint with a non-exist `user_token`, the call will fail with an error message indicating that the user token is not found. - -See endpoint docs at .*/ - pub fn user_update( - &self, - user_token: &str, - ) -> FluentRequest<'_, request::UserUpdateRequest> { - FluentRequest { - client: self, - params: request::UserUpdateRequest { - consumer_report_user_identity: None, - user_token: user_token.to_owned(), - }, - } - } - /**Retrieve Link sessions for your user - -This endpoint can be used for your end users after they complete the Link flow. This endpoint returns a list of Link sessions that your user completed, where each session includes the results from the Link flow. - -These results include details about the Item that was created and some product related metadata (showing, for example, whether the user finished the bank income verification step). - -See endpoint docs at .*/ - pub fn credit_sessions_get( - &self, - user_token: &str, - ) -> FluentRequest<'_, request::CreditSessionsGetRequest> { - FluentRequest { - client: self, - params: request::CreditSessionsGetRequest { - user_token: user_token.to_owned(), - }, - } - } - /**Get payment details - -The `/payment_initiation/payment/get` endpoint can be used to check the status of a payment, as well as to receive basic information such as recipient and payment amount. In the case of standing orders, the `/payment_initiation/payment/get` endpoint will provide information about the status of the overall standing order itself; the API cannot be used to retrieve payment status for individual payments within a standing order. - -See endpoint docs at .*/ - pub fn payment_initiation_payment_get( - &self, - payment_id: &str, - ) -> FluentRequest<'_, request::PaymentInitiationPaymentGetRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationPaymentGetRequest { - payment_id: payment_id.to_owned(), - }, - } - } - /**List payments - -The `/payment_initiation/payment/list` endpoint can be used to retrieve all created payments. By default, the 10 most recent payments are returned. You can request more payments and paginate through the results using the optional `count` and `cursor` parameters. - -See endpoint docs at .*/ - pub fn payment_initiation_payment_list( - &self, - ) -> FluentRequest<'_, request::PaymentInitiationPaymentListRequest> { - FluentRequest { - client: self, - params: request::PaymentInitiationPaymentListRequest { - consent_id: None, - count: None, - cursor: None, - }, - } - } - /**Get Investment holdings - -The `/investments/holdings/get` endpoint allows developers to receive user-authorized stock position data for `investment`-type accounts. - -See endpoint docs at .*/ - pub fn investments_holdings_get( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::InvestmentsHoldingsGetRequest> { - FluentRequest { - client: self, - params: request::InvestmentsHoldingsGetRequest { - access_token: access_token.to_owned(), - options: None, - }, - } - } - /**Get investment transactions - -The `/investments/transactions/get` endpoint allows developers to retrieve up to 24 months of user-authorized transaction data for investment accounts. - -Transactions are returned in reverse-chronological order, and the sequence of transaction ordering is stable and will not shift. - -Due to the potentially large number of investment transactions associated with an Item, results are paginated. Manipulate the count and offset parameters in conjunction with the `total_investment_transactions` response body field to fetch all available investment transactions. - -Note that Investments does not have a webhook to indicate when initial transaction data has loaded (unless you use the `async_update` option). Instead, if transactions data is not ready when `/investments/transactions/get` is first called, Plaid will wait for the data. For this reason, calling `/investments/transactions/get` immediately after Link may take up to one to two minutes to return. - -Data returned by the asynchronous investments extraction flow (when `async_update` is set to true) may not be immediately available to `/investments/transactions/get`. To be alerted when the data is ready to be fetched, listen for the `HISTORICAL_UPDATE` webhook. If no investments history is ready when `/investments/transactions/get` is called, it will return a `PRODUCT_NOT_READY` error. - -See endpoint docs at .*/ - pub fn investments_transactions_get( - &self, - access_token: &str, - end_date: chrono::NaiveDate, - start_date: chrono::NaiveDate, - ) -> FluentRequest<'_, request::InvestmentsTransactionsGetRequest> { - FluentRequest { - client: self, - params: request::InvestmentsTransactionsGetRequest { - access_token: access_token.to_owned(), - end_date, - options: None, - start_date, - }, - } - } - /**Refresh investment data - -`/investments/refresh` is an optional endpoint for users of the Investments product. It initiates an on-demand extraction to fetch the newest investments, holdings and investment transactions for an Item. This on-demand extraction takes place in addition to the periodic extractions that automatically occur multiple times a day for any Investments-enabled Item. If changes to investments are discovered after calling `/investments/refresh`, Plaid will fire webhooks: [`HOLDINGS: DEFAULT_UPDATE`](https://plaid.com/docs/api/products/investments/#holdings-default_update) if any new holdings are detected, and [INVESTMENTS_TRANSACTIONS: DEFAULT_UPDATE](https://plaid.com/docs/api/products/investments/#investments_transactions-default_update) if any new investment transactions are detected. Updated holdings and investment transactions can be fetched by calling `/investments/holdings/get` and `/investments/transactions/get`. "Note that the `/investments/refresh` endpoint is not supported by all institutions. If called on an Item from an institution that does not support this functionality, it will return a `PRODUCT_NOT_SUPPORTED` error. -`/investments/refresh` is offered as an add-on to Investments and has a separate [fee model](/docs/account/billing/#per-request-flat-fee). To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. - -See endpoint docs at .*/ - pub fn investments_refresh( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::InvestmentsRefreshRequest> { - FluentRequest { - client: self, - params: request::InvestmentsRefreshRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Get data needed to authorize an investments transfer - -The `/investments/auth/get` endpoint allows developers to receive user-authorized data to facilitate the transfer of holdings - -See endpoint docs at .*/ - pub fn investments_auth_get( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::InvestmentsAuthGetRequest> { - FluentRequest { - client: self, - params: request::InvestmentsAuthGetRequest { - access_token: access_token.to_owned(), - options: None, - }, - } - } - /**Create processor token - -Used to create a token suitable for sending to one of Plaid's partners to enable integrations. Note that Stripe partnerships use bank account tokens instead; see `/processor/stripe/bank_account_token/create` for creating tokens for use with Stripe integrations. Once created, a processor token for a given Item cannot be modified or updated. If the account must be linked to a new or different partner resource, create a new Item by having the user go through the Link flow again; a new processor token can then be created from the new `access_token`. Processor tokens can also be revoked, using `/item/remove`. - -See endpoint docs at .*/ - pub fn processor_token_create( - &self, - access_token: &str, - account_id: &str, - processor: &str, - ) -> FluentRequest<'_, request::ProcessorTokenCreateRequest> { - FluentRequest { - client: self, - params: request::ProcessorTokenCreateRequest { - access_token: access_token.to_owned(), - account_id: account_id.to_owned(), - processor: processor.to_owned(), - }, - } - } - /**Control a processor's access to products - -Used to control a processor's access to products on the given processor token. By default, a processor will have access to all available products on the corresponding item. To restrict access to a particular set of products, call this endpoint with the desired products. To restore access to all available products, call this endpoint with an empty list. This endpoint can be called multiple times as your needs and your processor's needs change. - -See endpoint docs at .*/ - pub fn processor_token_permissions_set( - &self, - processor_token: &str, - products: &[&str], - ) -> FluentRequest<'_, request::ProcessorTokenPermissionsSetRequest> { - FluentRequest { - client: self, - params: request::ProcessorTokenPermissionsSetRequest { - processor_token: processor_token.to_owned(), - products: products.iter().map(|&x| x.to_owned()).collect(), - }, - } - } - /**Get a processor token's product permissions - -Used to get a processor token's product permissions. The `products` field will be an empty list if the processor can access all available products. - -See endpoint docs at .*/ - pub fn processor_token_permissions_get( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorTokenPermissionsGetRequest> { - FluentRequest { - client: self, - params: request::ProcessorTokenPermissionsGetRequest { - processor_token: processor_token.to_owned(), - }, - } - } - /**Update a processor token's webhook URL - -This endpoint allows you, the processor, to update the webhook URL associated with a processor token. This request triggers a `WEBHOOK_UPDATE_ACKNOWLEDGED` webhook to the newly specified webhook URL. - -See endpoint docs at .*/ - pub fn processor_token_webhook_update( - &self, - processor_token: &str, - ) -> FluentRequest<'_, request::ProcessorTokenWebhookUpdateRequest> { - FluentRequest { - client: self, - params: request::ProcessorTokenWebhookUpdateRequest { - processor_token: processor_token.to_owned(), - webhook: None, - }, - } - } - /**Create Stripe bank account token - - -Used to create a token suitable for sending to Stripe to enable Plaid-Stripe integrations. For a detailed guide on integrating Stripe, see [Add Stripe to your app](https://plaid.com/docs/auth/partnerships/stripe/). - -Note that the Stripe bank account token is a one-time use token. To store bank account information for later use, you can use a Stripe customer object and create an associated bank account from the token, or you can use a Stripe Custom account and create an associated external bank account from the token. This bank account information should work indefinitely, unless the user's bank account information changes or they revoke Plaid's permissions to access their account. Stripe bank account information cannot be modified once the bank account token has been created. If you ever need to change the bank account details used by Stripe for a specific customer, have the user go through Link again and create a new bank account token from the new `access_token`. - -Bank account tokens can also be revoked, using `/item/remove`. - -See endpoint docs at .*/ - pub fn processor_stripe_bank_account_token_create( - &self, - access_token: &str, - account_id: &str, - ) -> FluentRequest<'_, request::ProcessorStripeBankAccountTokenCreateRequest> { - FluentRequest { - client: self, - params: request::ProcessorStripeBankAccountTokenCreateRequest { - access_token: access_token.to_owned(), - account_id: account_id.to_owned(), - }, - } - } - /**Create Apex bank account token - -Used to create a token suitable for sending to Apex to enable Plaid-Apex integrations. - -See endpoint docs at .*/ - pub fn processor_apex_processor_token_create( - &self, - access_token: &str, - account_id: &str, - ) -> FluentRequest<'_, request::ProcessorApexProcessorTokenCreateRequest> { - FluentRequest { - client: self, - params: request::ProcessorApexProcessorTokenCreateRequest { - access_token: access_token.to_owned(), - account_id: account_id.to_owned(), - }, - } - } - /**Create a deposit switch - -This endpoint creates a deposit switch entity that will be persisted throughout the lifecycle of the switch. - -See endpoint docs at .*/ - pub fn deposit_switch_create( - &self, - target_access_token: &str, - target_account_id: &str, - ) -> FluentRequest<'_, request::DepositSwitchCreateRequest> { - FluentRequest { - client: self, - params: request::DepositSwitchCreateRequest { - country_code: None, - options: None, - target_access_token: target_access_token.to_owned(), - target_account_id: target_account_id.to_owned(), - }, - } - } - /**Import Item - -`/item/import` creates an Item via your Plaid Exchange Integration and returns an `access_token`. As part of an `/item/import` request, you will include a User ID (`user_auth.user_id`) and Authentication Token (`user_auth.auth_token`) that enable data aggregation through your Plaid Exchange API endpoints. These authentication principals are to be chosen by you. - -Upon creating an Item via `/item/import`, Plaid will automatically begin an extraction of that Item through the Plaid Exchange infrastructure you have already integrated.*/ - pub fn item_import( - &self, - products: &[&str], - user_auth: ItemImportRequestUserAuth, - ) -> FluentRequest<'_, request::ItemImportRequest> { - FluentRequest { - client: self, - params: request::ItemImportRequest { - options: None, - products: products.iter().map(|&x| x.to_owned()).collect(), - user_auth, - }, - } - } - /**Create a deposit switch token - -In order for the end user to take action, you will need to create a public token representing the deposit switch. This token is used to initialize Link. It can be used one time and expires after 30 minutes. - - -See endpoint docs at .*/ - pub fn deposit_switch_token_create( - &self, - deposit_switch_id: &str, - ) -> FluentRequest<'_, request::DepositSwitchTokenCreateRequest> { - FluentRequest { - client: self, - params: request::DepositSwitchTokenCreateRequest { - deposit_switch_id: deposit_switch_id.to_owned(), - }, - } - } - /**Create Link Token - -The `/link/token/create` endpoint creates a `link_token`, which is required as a parameter when initializing Link. Once Link has been initialized, it returns a `public_token`, which can then be exchanged for an `access_token` via `/item/public_token/exchange` as part of the main Link flow. - -A `link_token` generated by `/link/token/create` is also used to initialize other Link flows, such as the update mode flow for tokens with expired credentials, or the Payment Initiation (Europe) flow. - -See endpoint docs at .*/ - pub fn link_token_create( - &self, - args: request::LinkTokenCreateRequired, - ) -> FluentRequest<'_, request::LinkTokenCreateRequest> { - FluentRequest { - client: self, - params: request::LinkTokenCreateRequest { - access_token: None, - access_tokens: None, - account_filters: None, - additional_consented_products: None, - android_package_name: None, - auth: None, - base_report: None, - card_switch: None, - client_name: args.client_name.to_owned(), - consumer_report_permissible_purpose: None, - country_codes: args - .country_codes - .iter() - .map(|&x| x.to_owned()) - .collect(), - cra_enabled: None, - deposit_switch: None, - employment: None, - eu_config: None, - hosted_link: None, - identity_verification: None, - income_verification: None, - institution_data: None, - institution_id: None, - investments: None, - investments_auth: None, - language: args.language.to_owned(), - link_customization_name: None, - optional_products: None, - payment_initiation: None, - products: None, - redirect_uri: None, - required_if_supported_products: None, - statements: None, - transactions: None, - transfer: None, - update: None, - user: args.user, - user_token: None, - webhook: None, - }, - } - } - /**Get Link Token - -The `/link/token/get` endpoint gets information about a previously-created `link_token` using the -`/link/token/create` endpoint. It can be useful for debugging purposes. - -See endpoint docs at .*/ - pub fn link_token_get( - &self, - link_token: &str, - ) -> FluentRequest<'_, request::LinkTokenGetRequest> { - FluentRequest { - client: self, - params: request::LinkTokenGetRequest { - link_token: link_token.to_owned(), - }, - } - } - /**Exchange the Link Correlation Id for a Link Token - -Exchange an OAuth `link_correlation_id` for the corresponding `link_token`. The `link_correlation_id` is only available for 'payment_initiation' products and is provided to the client via the OAuth `redirect_uri` as a query parameter. -The `link_correlation_id` is ephemeral and expires in a brief period, after which it can no longer be exchanged for the 'link_token'. - -See endpoint docs at .*/ - pub fn link_oauth_correlation_id_exchange( - &self, - link_correlation_id: &str, - ) -> FluentRequest<'_, request::LinkOauthCorrelationIdExchangeRequest> { - FluentRequest { - client: self, - params: request::LinkOauthCorrelationIdExchangeRequest { - link_correlation_id: link_correlation_id.to_owned(), - }, - } - } - /**Retrieve a deposit switch - -This endpoint returns information related to how the user has configured their payroll allocation and the state of the switch. You can use this information to build logic related to the user's direct deposit allocation preferences. - -See endpoint docs at .*/ - pub fn deposit_switch_get( - &self, - deposit_switch_id: &str, - ) -> FluentRequest<'_, request::DepositSwitchGetRequest> { - FluentRequest { - client: self, - params: request::DepositSwitchGetRequest { - deposit_switch_id: deposit_switch_id.to_owned(), - }, - } - } - /**Retrieve a transfer - -The `/transfer/get` endpoint fetches information about the transfer corresponding to the given `transfer_id`. - -See endpoint docs at .*/ - pub fn transfer_get( - &self, - transfer_id: &str, - ) -> FluentRequest<'_, request::TransferGetRequest> { - FluentRequest { - client: self, - params: request::TransferGetRequest { - originator_client_id: None, - transfer_id: transfer_id.to_owned(), - }, - } - } - /**Retrieve a recurring transfer - -The `/transfer/recurring/get` fetches information about the recurring transfer corresponding to the given `recurring_transfer_id`. - -See endpoint docs at .*/ - pub fn transfer_recurring_get( - &self, - recurring_transfer_id: &str, - ) -> FluentRequest<'_, request::TransferRecurringGetRequest> { - FluentRequest { - client: self, - params: request::TransferRecurringGetRequest { - recurring_transfer_id: recurring_transfer_id.to_owned(), - }, - } - } - /**Retrieve a bank transfer - -The `/bank_transfer/get` fetches information about the bank transfer corresponding to the given `bank_transfer_id`. - -See endpoint docs at .*/ - pub fn bank_transfer_get( - &self, - bank_transfer_id: &str, - ) -> FluentRequest<'_, request::BankTransferGetRequest> { - FluentRequest { - client: self, - params: request::BankTransferGetRequest { - bank_transfer_id: bank_transfer_id.to_owned(), - }, - } - } - /**Create a transfer authorization - -Use the `/transfer/authorization/create` endpoint to authorize a transfer. This endpoint must be called prior to calling `/transfer/create`. - -There are three possible outcomes to calling this endpoint: If the `authorization.decision` in the response is `declined`, the proposed transfer has failed the risk check and you cannot proceed with the transfer. If the `authorization.decision` is `approved`, and the `authorization.rationale_code` is `null`, the transfer has passed the risk check and you can proceed to call `/transfer/create`. If the `authorization.decision` is `approved` and the `authorization.rationale_code` is non-`null`, the risk check could not be run: you may proceed with the transfer, but should perform your own risk evaluation. For more details, see the response schema. - -In Plaid's Sandbox environment the decisions will be returned as follows: - - - To approve a transfer with `null` rationale code, make an authorization request with an `amount` less than the available balance in the account. - - - To approve a transfer with the rationale code `MANUALLY_VERIFIED_ITEM`, create an Item in Link through the [Same Day Micro-deposits flow](https://plaid.com/docs/auth/coverage/testing/#testing-same-day-micro-deposits). - - - To approve a transfer with the rationale code `ITEM_LOGIN_REQUIRED`, [reset the login for an Item](https://plaid.com/docs/sandbox/#item_login_required). - - - To decline a transfer with the rationale code `NSF`, the available balance on the account must be less than the authorization `amount`. See [Create Sandbox test data](https://plaid.com/docs/sandbox/user-custom/) for details on how to customize data in Sandbox. - - - To decline a transfer with the rationale code `RISK`, the available balance on the account must be exactly $0. See [Create Sandbox test data](https://plaid.com/docs/sandbox/user-custom/) for details on how to customize data in Sandbox. - -See endpoint docs at .*/ - pub fn transfer_authorization_create( - &self, - args: request::TransferAuthorizationCreateRequired, - ) -> FluentRequest<'_, request::TransferAuthorizationCreateRequest> { - FluentRequest { - client: self, - params: request::TransferAuthorizationCreateRequest { - access_token: args.access_token.to_owned(), - account_id: args.account_id.to_owned(), - ach_class: None, - amount: args.amount.to_owned(), - beacon_session_id: None, - credit_funds_source: None, - device: None, - funding_account_id: None, - idempotency_key: None, - iso_currency_code: None, - network: args.network.to_owned(), - origination_account_id: None, - originator_client_id: None, - payment_profile_token: None, - test_clock_id: None, - type_: args.type_.to_owned(), - user: args.user, - user_present: None, - with_guarantee: None, - }, - } - } - /**Retrieve a balance held with Plaid - -Use the `/transfer/balance/get` endpoint to view a balance held with Plaid. - -See endpoint docs at .*/ - pub fn transfer_balance_get( - &self, - ) -> FluentRequest<'_, request::TransferBalanceGetRequest> { - FluentRequest { - client: self, - params: request::TransferBalanceGetRequest { - originator_client_id: None, - type_: None, - }, - } - } - /**Get RTP eligibility information of a transfer - -Use the `/transfer/capabilities/get` endpoint to determine the RTP eligibility information of a transfer. To simulate RTP eligibility in Sandbox, log in using the username `user_good` and password `pass_good` and use the first two checking and savings accounts in the "First Platypus Bank" institution (ending in 0000 or 1111), which will return `true`. Any other account will return `false`. - -See endpoint docs at .*/ - pub fn transfer_capabilities_get( - &self, - access_token: &str, - account_id: &str, - ) -> FluentRequest<'_, request::TransferCapabilitiesGetRequest> { - FluentRequest { - client: self, - params: request::TransferCapabilitiesGetRequest { - access_token: access_token.to_owned(), - account_id: account_id.to_owned(), - payment_profile_token: None, - }, - } - } - /**Get transfer product configuration - -Use the `/transfer/configuration/get` endpoint to view your transfer product configurations. - -See endpoint docs at .*/ - pub fn transfer_configuration_get( - &self, - ) -> FluentRequest<'_, request::TransferConfigurationGetRequest> { - FluentRequest { - client: self, - params: request::TransferConfigurationGetRequest { - originator_client_id: None, - }, - } - } - /**Retrieve Plaid Ledger balance - -Use the `/transfer/ledger/get` endpoint to view a balance on the ledger held with Plaid. - -See endpoint docs at .*/ - pub fn transfer_ledger_get( - &self, - ) -> FluentRequest<'_, request::TransferLedgerGetRequest> { - FluentRequest { - client: self, - params: request::TransferLedgerGetRequest { - originator_client_id: None, - }, - } - } - /**Move available balance between the ledgers of the platform and one of its originators - -Use the `/transfer/ledger/distribute` endpoint to move available balance between the ledgers of the platform and one of its originators. - -See endpoint docs at .*/ - pub fn transfer_ledger_distribute( - &self, - args: request::TransferLedgerDistributeRequired, - ) -> FluentRequest<'_, request::TransferLedgerDistributeRequest> { - FluentRequest { - client: self, - params: request::TransferLedgerDistributeRequest { - amount: args.amount.to_owned(), - description: None, - from_client_id: args.from_client_id.to_owned(), - idempotency_key: args.idempotency_key.to_owned(), - to_client_id: args.to_client_id.to_owned(), - }, - } - } - /**Deposit funds into a Plaid Ledger balance - -Use the `/transfer/ledger/deposit` endpoint to deposit funds into Plaid Ledger. - -See endpoint docs at .*/ - pub fn transfer_ledger_deposit( - &self, - amount: &str, - idempotency_key: &str, - network: &str, - ) -> FluentRequest<'_, request::TransferLedgerDepositRequest> { - FluentRequest { - client: self, - params: request::TransferLedgerDepositRequest { - amount: amount.to_owned(), - description: None, - funding_account_id: None, - idempotency_key: idempotency_key.to_owned(), - network: network.to_owned(), - originator_client_id: None, - }, - } - } - /**Withdraw funds from a Plaid Ledger balance - -Use the `/transfer/ledger/withdraw` endpoint to withdraw funds from a Plaid Ledger balance. - -See endpoint docs at .*/ - pub fn transfer_ledger_withdraw( - &self, - amount: &str, - idempotency_key: &str, - network: &str, - ) -> FluentRequest<'_, request::TransferLedgerWithdrawRequest> { - FluentRequest { - client: self, - params: request::TransferLedgerWithdrawRequest { - amount: amount.to_owned(), - description: None, - funding_account_id: None, - idempotency_key: idempotency_key.to_owned(), - network: network.to_owned(), - originator_client_id: None, - }, - } - } - /**Update the funding account associated with the originator - -Use the `/transfer/originator/funding_account/update` endpoint to update the funding account associated with the originator. - -See endpoint docs at .*/ - pub fn transfer_originator_funding_account_update( - &self, - funding_account: TransferFundingAccount, - originator_client_id: &str, - ) -> FluentRequest<'_, request::TransferOriginatorFundingAccountUpdateRequest> { - FluentRequest { - client: self, - params: request::TransferOriginatorFundingAccountUpdateRequest { - funding_account, - originator_client_id: originator_client_id.to_owned(), - }, - } - } - /**Get transfer product usage metrics - -Use the `/transfer/metrics/get` endpoint to view your transfer product usage metrics. - -See endpoint docs at .*/ - pub fn transfer_metrics_get( - &self, - ) -> FluentRequest<'_, request::TransferMetricsGetRequest> { - FluentRequest { - client: self, - params: request::TransferMetricsGetRequest { - originator_client_id: None, - }, - } - } - /**Create a transfer - -Use the `/transfer/create` endpoint to initiate a new transfer. - -See endpoint docs at .*/ - pub fn transfer_create( - &self, - args: request::TransferCreateRequired, - ) -> FluentRequest<'_, request::TransferCreateRequest> { - FluentRequest { - client: self, - params: request::TransferCreateRequest { - access_token: args.access_token.to_owned(), - account_id: args.account_id.to_owned(), - ach_class: None, - amount: None, - authorization_id: args.authorization_id.to_owned(), - description: args.description.to_owned(), - facilitator_fee: None, - idempotency_key: None, - iso_currency_code: None, - metadata: None, - network: None, - origination_account_id: None, - test_clock_id: None, - type_: None, - user: None, - }, - } - } - /**Create a recurring transfer - -Use the `/transfer/recurring/create` endpoint to initiate a new recurring transfer. This capability is not currently supported for Transfer UI or Platform Payments (beta) customers. - -See endpoint docs at .*/ - pub fn transfer_recurring_create( - &self, - args: request::TransferRecurringCreateRequired, - ) -> FluentRequest<'_, request::TransferRecurringCreateRequest> { - FluentRequest { - client: self, - params: request::TransferRecurringCreateRequest { - access_token: args.access_token.to_owned(), - account_id: args.account_id.to_owned(), - ach_class: None, - amount: args.amount.to_owned(), - description: args.description.to_owned(), - device: None, - funding_account_id: None, - idempotency_key: args.idempotency_key.to_owned(), - iso_currency_code: None, - network: args.network.to_owned(), - schedule: args.schedule, - test_clock_id: None, - type_: args.type_.to_owned(), - user: args.user, - user_present: None, - }, - } - } - /**Create a bank transfer - -Use the `/bank_transfer/create` endpoint to initiate a new bank transfer. - -See endpoint docs at .*/ - pub fn bank_transfer_create( - &self, - args: request::BankTransferCreateRequired, - ) -> FluentRequest<'_, request::BankTransferCreateRequest> { - FluentRequest { - client: self, - params: request::BankTransferCreateRequest { - access_token: args.access_token.to_owned(), - account_id: args.account_id.to_owned(), - ach_class: None, - amount: args.amount.to_owned(), - custom_tag: None, - description: args.description.to_owned(), - idempotency_key: args.idempotency_key.to_owned(), - iso_currency_code: args.iso_currency_code.to_owned(), - metadata: None, - network: args.network.to_owned(), - origination_account_id: None, - type_: args.type_.to_owned(), - user: args.user, - }, - } - } - /**List transfers - -Use the `/transfer/list` endpoint to see a list of all your transfers and their statuses. Results are paginated; use the `count` and `offset` query parameters to retrieve the desired transfers. - - -See endpoint docs at .*/ - pub fn transfer_list(&self) -> FluentRequest<'_, request::TransferListRequest> { - FluentRequest { - client: self, - params: request::TransferListRequest { - count: None, - end_date: None, - funding_account_id: None, - offset: None, - origination_account_id: None, - originator_client_id: None, - start_date: None, - }, - } - } - /**List recurring transfers - -Use the `/transfer/recurring/list` endpoint to see a list of all your recurring transfers and their statuses. Results are paginated; use the `count` and `offset` query parameters to retrieve the desired recurring transfers. - - -See endpoint docs at .*/ - pub fn transfer_recurring_list( - &self, - ) -> FluentRequest<'_, request::TransferRecurringListRequest> { - FluentRequest { - client: self, - params: request::TransferRecurringListRequest { - count: None, - end_time: None, - funding_account_id: None, - offset: None, - start_time: None, - }, - } - } - /**List bank transfers - -Use the `/bank_transfer/list` endpoint to see a list of all your bank transfers and their statuses. Results are paginated; use the `count` and `offset` query parameters to retrieve the desired bank transfers. - - -See endpoint docs at .*/ - pub fn bank_transfer_list( - &self, - ) -> FluentRequest<'_, request::BankTransferListRequest> { - FluentRequest { - client: self, - params: request::BankTransferListRequest { - count: None, - direction: None, - end_date: None, - offset: None, - origination_account_id: None, - start_date: None, - }, - } - } - /**Cancel a transfer - -Use the `/transfer/cancel` endpoint to cancel a transfer. A transfer is eligible for cancellation if the `cancellable` property returned by `/transfer/get` is `true`. - -See endpoint docs at .*/ - pub fn transfer_cancel( - &self, - transfer_id: &str, - ) -> FluentRequest<'_, request::TransferCancelRequest> { - FluentRequest { - client: self, - params: request::TransferCancelRequest { - originator_client_id: None, - transfer_id: transfer_id.to_owned(), - }, - } - } - /**Cancel a recurring transfer. - -Use the `/transfer/recurring/cancel` endpoint to cancel a recurring transfer. Scheduled transfer that hasn't been submitted to bank will be cancelled. - -See endpoint docs at .*/ - pub fn transfer_recurring_cancel( - &self, - recurring_transfer_id: &str, - ) -> FluentRequest<'_, request::TransferRecurringCancelRequest> { - FluentRequest { - client: self, - params: request::TransferRecurringCancelRequest { - recurring_transfer_id: recurring_transfer_id.to_owned(), - }, - } - } - /**Cancel a bank transfer - -Use the `/bank_transfer/cancel` endpoint to cancel a bank transfer. A transfer is eligible for cancelation if the `cancellable` property returned by `/bank_transfer/get` is `true`. - -See endpoint docs at .*/ - pub fn bank_transfer_cancel( - &self, - bank_transfer_id: &str, - ) -> FluentRequest<'_, request::BankTransferCancelRequest> { - FluentRequest { - client: self, - params: request::BankTransferCancelRequest { - bank_transfer_id: bank_transfer_id.to_owned(), - }, - } - } - /**List transfer events - -Use the `/transfer/event/list` endpoint to get a list of transfer events based on specified filter criteria. - -See endpoint docs at .*/ - pub fn transfer_event_list( - &self, - ) -> FluentRequest<'_, request::TransferEventListRequest> { - FluentRequest { - client: self, - params: request::TransferEventListRequest { - account_id: None, - count: None, - end_date: None, - event_types: None, - funding_account_id: None, - offset: None, - origination_account_id: None, - originator_client_id: None, - start_date: None, - sweep_id: None, - transfer_id: None, - transfer_type: None, - }, - } - } - /**List bank transfer events - -Use the `/bank_transfer/event/list` endpoint to get a list of Plaid-initiated ACH or bank transfer events based on specified filter criteria. When using Auth with micro-deposit verification enabled, this endpoint can be used to fetch status updates on ACH micro-deposits. For more details, see [micro-deposit events](https://plaid.com/docs/auth/coverage/microdeposit-events/). - -See endpoint docs at .*/ - pub fn bank_transfer_event_list( - &self, - ) -> FluentRequest<'_, request::BankTransferEventListRequest> { - FluentRequest { - client: self, - params: request::BankTransferEventListRequest { - account_id: None, - bank_transfer_id: None, - bank_transfer_type: None, - count: None, - direction: None, - end_date: None, - event_types: None, - offset: None, - origination_account_id: None, - start_date: None, - }, - } - } - /**Sync transfer events - -`/transfer/event/sync` allows you to request up to the next 25 transfer events that happened after a specific `event_id`. Use the `/transfer/event/sync` endpoint to guarantee you have seen all transfer events. - -See endpoint docs at .*/ - pub fn transfer_event_sync( - &self, - after_id: i64, - ) -> FluentRequest<'_, request::TransferEventSyncRequest> { - FluentRequest { - client: self, - params: request::TransferEventSyncRequest { - after_id, - count: None, - }, - } - } - /**Sync bank transfer events - -`/bank_transfer/event/sync` allows you to request up to the next 25 Plaid-initiated bank transfer events that happened after a specific `event_id`. When using Auth with micro-deposit verification enabled, this endpoint can be used to fetch status updates on ACH micro-deposits. For more details, see [micro-deposit events](https://www.plaid.com/docs/auth/coverage/microdeposit-events/). - -See endpoint docs at .*/ - pub fn bank_transfer_event_sync( - &self, - after_id: i64, - ) -> FluentRequest<'_, request::BankTransferEventSyncRequest> { - FluentRequest { - client: self, - params: request::BankTransferEventSyncRequest { - after_id, - count: None, - }, - } - } - /**Retrieve a sweep - -The `/transfer/sweep/get` endpoint fetches a sweep corresponding to the given `sweep_id`. - -See endpoint docs at .*/ - pub fn transfer_sweep_get( - &self, - sweep_id: &str, - ) -> FluentRequest<'_, request::TransferSweepGetRequest> { - FluentRequest { - client: self, - params: request::TransferSweepGetRequest { - sweep_id: sweep_id.to_owned(), - }, - } - } - /**Retrieve a sweep - -The `/bank_transfer/sweep/get` endpoint fetches information about the sweep corresponding to the given `sweep_id`. - -See endpoint docs at .*/ - pub fn bank_transfer_sweep_get( - &self, - sweep_id: &str, - ) -> FluentRequest<'_, request::BankTransferSweepGetRequest> { - FluentRequest { - client: self, - params: request::BankTransferSweepGetRequest { - sweep_id: sweep_id.to_owned(), - }, - } - } - /**List sweeps - -The `/transfer/sweep/list` endpoint fetches sweeps matching the given filters. - -See endpoint docs at .*/ - pub fn transfer_sweep_list( - &self, - ) -> FluentRequest<'_, request::TransferSweepListRequest> { - FluentRequest { - client: self, - params: request::TransferSweepListRequest { - amount: None, - count: None, - end_date: None, - funding_account_id: None, - offset: None, - originator_client_id: None, - start_date: None, - status: None, - transfer_id: None, - trigger: None, - }, - } - } - /**List sweeps - -The `/bank_transfer/sweep/list` endpoint fetches information about the sweeps matching the given filters. - -See endpoint docs at .*/ - pub fn bank_transfer_sweep_list( - &self, - ) -> FluentRequest<'_, request::BankTransferSweepListRequest> { - FluentRequest { - client: self, - params: request::BankTransferSweepListRequest { - count: None, - end_time: None, - origination_account_id: None, - start_time: None, - }, - } - } - /**Get balance of your Bank Transfer account - -Use the `/bank_transfer/balance/get` endpoint to see the available balance in your bank transfer account. Debit transfers increase this balance once their status is posted. Credit transfers decrease this balance when they are created. - -The transactable balance shows the amount in your account that you are able to use for transfers, and is essentially your available balance minus your minimum balance. - -Note that this endpoint can only be used with FBO accounts, when using Bank Transfers in the Full Service configuration. It cannot be used on your own account when using Bank Transfers in the BTS Platform configuration. - -See endpoint docs at .*/ - pub fn bank_transfer_balance_get( - &self, - ) -> FluentRequest<'_, request::BankTransferBalanceGetRequest> { - FluentRequest { - client: self, - params: request::BankTransferBalanceGetRequest { - origination_account_id: None, - }, - } - } - /**Migrate account into Bank Transfers - -As an alternative to adding Items via Link, you can also use the `/bank_transfer/migrate_account` endpoint to migrate known account and routing numbers to Plaid Items. Note that Items created in this way are not compatible with endpoints for other products, such as `/accounts/balance/get`, and can only be used with Bank Transfer endpoints. If you require access to other endpoints, create the Item through Link instead. Access to `/bank_transfer/migrate_account` is not enabled by default; to obtain access, contact your Plaid Account Manager. - -See endpoint docs at .*/ - pub fn bank_transfer_migrate_account( - &self, - account_number: &str, - account_type: &str, - routing_number: &str, - ) -> FluentRequest<'_, request::BankTransferMigrateAccountRequest> { - FluentRequest { - client: self, - params: request::BankTransferMigrateAccountRequest { - account_number: account_number.to_owned(), - account_type: account_type.to_owned(), - routing_number: routing_number.to_owned(), - wire_routing_number: None, - }, - } - } - /**Migrate account into Transfers - -As an alternative to adding Items via Link, you can also use the `/transfer/migrate_account` endpoint to migrate known account and routing numbers to Plaid Items. Note that Items created in this way are not compatible with endpoints for other products, such as `/accounts/balance/get`, and can only be used with Transfer endpoints. If you require access to other endpoints, create the Item through Link instead. Access to `/transfer/migrate_account` is not enabled by default; to obtain access, contact your Plaid Account Manager. - -See endpoint docs at .*/ - pub fn transfer_migrate_account( - &self, - account_number: &str, - account_type: &str, - routing_number: &str, - ) -> FluentRequest<'_, request::TransferMigrateAccountRequest> { - FluentRequest { - client: self, - params: request::TransferMigrateAccountRequest { - account_number: account_number.to_owned(), - account_type: account_type.to_owned(), - routing_number: routing_number.to_owned(), - wire_routing_number: None, - }, - } - } - /**Create a transfer intent object to invoke the Transfer UI - -Use the `/transfer/intent/create` endpoint to generate a transfer intent object and invoke the Transfer UI. - -See endpoint docs at .*/ - pub fn transfer_intent_create( - &self, - args: request::TransferIntentCreateRequired, - ) -> FluentRequest<'_, request::TransferIntentCreateRequest> { - FluentRequest { - client: self, - params: request::TransferIntentCreateRequest { - account_id: None, - ach_class: None, - amount: args.amount.to_owned(), - description: args.description.to_owned(), - funding_account_id: None, - iso_currency_code: None, - metadata: None, - mode: args.mode.to_owned(), - network: None, - origination_account_id: None, - require_guarantee: None, - user: args.user, - }, - } - } - /**Retrieve more information about a transfer intent - -Use the `/transfer/intent/get` endpoint to retrieve more information about a transfer intent. - -See endpoint docs at .*/ - pub fn transfer_intent_get( - &self, - transfer_intent_id: &str, - ) -> FluentRequest<'_, request::TransferIntentGetRequest> { - FluentRequest { - client: self, - params: request::TransferIntentGetRequest { - transfer_intent_id: transfer_intent_id.to_owned(), - }, - } - } - /**Lists historical repayments - -The `/transfer/repayment/list` endpoint fetches repayments matching the given filters. Repayments are returned in reverse-chronological order (most recent first) starting at the given `start_time`. - -See endpoint docs at .*/ - pub fn transfer_repayment_list( - &self, - ) -> FluentRequest<'_, request::TransferRepaymentListRequest> { - FluentRequest { - client: self, - params: request::TransferRepaymentListRequest { - count: None, - end_date: None, - offset: None, - start_date: None, - }, - } - } - /**List the returns included in a repayment - -The `/transfer/repayment/return/list` endpoint retrieves the set of returns that were batched together into the specified repayment. The sum of amounts of returns retrieved by this request equals the amount of the repayment. - -See endpoint docs at .*/ - pub fn transfer_repayment_return_list( - &self, - repayment_id: &str, - ) -> FluentRequest<'_, request::TransferRepaymentReturnListRequest> { - FluentRequest { - client: self, - params: request::TransferRepaymentReturnListRequest { - count: None, - offset: None, - repayment_id: repayment_id.to_owned(), - }, - } - } - /**Create a new originator - -Use the `/transfer/originator/create` endpoint to create a new originator and return an `originator_client_id`. - -See endpoint docs at .*/ - pub fn transfer_originator_create( - &self, - company_name: &str, - ) -> FluentRequest<'_, request::TransferOriginatorCreateRequest> { - FluentRequest { - client: self, - params: request::TransferOriginatorCreateRequest { - company_name: company_name.to_owned(), - }, - } - } - /**Generate a Plaid-hosted onboarding UI URL. - -The `/transfer/questionnaire/create` endpoint generates a Plaid-hosted onboarding UI URL. Redirect the originator to this URL to provide their due diligence information and agree to Plaid’s terms for ACH money movement. - -See endpoint docs at .*/ - pub fn transfer_questionnaire_create( - &self, - originator_client_id: &str, - redirect_uri: &str, - ) -> FluentRequest<'_, request::TransferQuestionnaireCreateRequest> { - FluentRequest { - client: self, - params: request::TransferQuestionnaireCreateRequest { - originator_client_id: originator_client_id.to_owned(), - redirect_uri: redirect_uri.to_owned(), - }, - } - } - /**Submit transfer diligence on behalf of the originator - -Use the `/transfer/diligence/submit` endpoint to submit transfer diligence on behalf of the originator (i.e., the end customer). - -See endpoint docs at .*/ - pub fn transfer_diligence_submit( - &self, - originator_client_id: &str, - originator_diligence: TransferOriginatorDiligence, - ) -> FluentRequest<'_, request::TransferDiligenceSubmitRequest> { - FluentRequest { - client: self, - params: request::TransferDiligenceSubmitRequest { - originator_client_id: originator_client_id.to_owned(), - originator_diligence, - }, - } - } - /**Upload transfer diligence document on behalf of the originator - -Third-party sender customers can use `/transfer/diligence/document/upload` endpoint to upload a document on behalf of its end customer (i.e. originator) to Plaid. You’ll need to send a request of type multipart/form-data. -You must provide the `client_id` in the `PLAID-CLIENT-ID` header and `secret` in the `PLAID-SECRET` header. - -See endpoint docs at .*/ - pub fn transfer_diligence_document_upload( - &self, - file: &str, - originator_client_id: &str, - purpose: &str, - ) -> FluentRequest<'_, request::TransferDiligenceDocumentUploadRequest> { - FluentRequest { - client: self, - params: request::TransferDiligenceDocumentUploadRequest { - file: file.to_owned(), - originator_client_id: originator_client_id.to_owned(), - purpose: purpose.to_owned(), - }, - } - } - /**Get status of an originator's onboarding - -The `/transfer/originator/get` endpoint gets status updates for an originator's onboarding process. This information is also available via the Transfer page on the Plaid dashboard. - -See endpoint docs at .*/ - pub fn transfer_originator_get( - &self, - originator_client_id: &str, - ) -> FluentRequest<'_, request::TransferOriginatorGetRequest> { - FluentRequest { - client: self, - params: request::TransferOriginatorGetRequest { - originator_client_id: originator_client_id.to_owned(), - }, - } - } - /**Get status of all originators' onboarding - -The `/transfer/originator/list` endpoint gets status updates for all of your originators' onboarding. This information is also available via the Plaid dashboard. - -See endpoint docs at .*/ - pub fn transfer_originator_list( - &self, - ) -> FluentRequest<'_, request::TransferOriginatorListRequest> { - FluentRequest { - client: self, - params: request::TransferOriginatorListRequest { - count: None, - offset: None, - }, - } - } - /**Create a refund - -Use the `/transfer/refund/create` endpoint to create a refund for a transfer. A transfer can be refunded if the transfer was initiated in the past 180 days. - -Processing of the refund will not occur until at least 4 business days following the transfer's settlement date, plus any hold/settlement delays. This 3-day window helps better protect your business from regular ACH returns. Consumer initiated returns (unauthorized returns) could still happen for about 60 days from the settlement date. If the original transfer is canceled, returned or failed, all pending refunds will automatically be canceled. Processed refunds cannot be revoked. - -See endpoint docs at .*/ - pub fn transfer_refund_create( - &self, - amount: &str, - idempotency_key: &str, - transfer_id: &str, - ) -> FluentRequest<'_, request::TransferRefundCreateRequest> { - FluentRequest { - client: self, - params: request::TransferRefundCreateRequest { - amount: amount.to_owned(), - idempotency_key: idempotency_key.to_owned(), - transfer_id: transfer_id.to_owned(), - }, - } - } - /**Retrieve a refund - -The `/transfer/refund/get` endpoint fetches information about the refund corresponding to the given `refund_id`. - -See endpoint docs at .*/ - pub fn transfer_refund_get( - &self, - refund_id: &str, - ) -> FluentRequest<'_, request::TransferRefundGetRequest> { - FluentRequest { - client: self, - params: request::TransferRefundGetRequest { - refund_id: refund_id.to_owned(), - }, - } - } - /**Cancel a refund - -Use the `/transfer/refund/cancel` endpoint to cancel a refund. A refund is eligible for cancellation if it has not yet been submitted to the payment network. - -See endpoint docs at .*/ - pub fn transfer_refund_cancel( - &self, - refund_id: &str, - ) -> FluentRequest<'_, request::TransferRefundCancelRequest> { - FluentRequest { - client: self, - params: request::TransferRefundCancelRequest { - refund_id: refund_id.to_owned(), - }, - } - } - /**Simulate a bank transfer event in Sandbox - -Use the `/sandbox/bank_transfer/simulate` endpoint to simulate a bank transfer event in the Sandbox environment. Note that while an event will be simulated and will appear when using endpoints such as `/bank_transfer/event/sync` or `/bank_transfer/event/list`, no transactions will actually take place and funds will not move between accounts, even within the Sandbox. - -See endpoint docs at .*/ - pub fn sandbox_bank_transfer_simulate( - &self, - bank_transfer_id: &str, - event_type: &str, - ) -> FluentRequest<'_, request::SandboxBankTransferSimulateRequest> { - FluentRequest { - client: self, - params: request::SandboxBankTransferSimulateRequest { - bank_transfer_id: bank_transfer_id.to_owned(), - event_type: event_type.to_owned(), - failure_reason: None, - }, - } - } - /**Simulate creating a sweep - -Use the `/sandbox/transfer/sweep/simulate` endpoint to create a sweep and associated events in the Sandbox environment. Upon calling this endpoint, all transfers with a sweep status of `swept` will become `swept_settled`, all `posted` or `pending` transfers with a sweep status of `unswept` will become `swept`, and all `returned` transfers with a sweep status of `swept` will become `return_swept`. - -See endpoint docs at .*/ - pub fn sandbox_transfer_sweep_simulate( - &self, - ) -> FluentRequest<'_, request::SandboxTransferSweepSimulateRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferSweepSimulateRequest { - test_clock_id: None, - }, - } - } - /**Simulate a transfer event in Sandbox - -Use the `/sandbox/transfer/simulate` endpoint to simulate a transfer event in the Sandbox environment. Note that while an event will be simulated and will appear when using endpoints such as `/transfer/event/sync` or `/transfer/event/list`, no transactions will actually take place and funds will not move between accounts, even within the Sandbox. - -See endpoint docs at .*/ - pub fn sandbox_transfer_simulate( - &self, - event_type: &str, - transfer_id: &str, - ) -> FluentRequest<'_, request::SandboxTransferSimulateRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferSimulateRequest { - event_type: event_type.to_owned(), - failure_reason: None, - test_clock_id: None, - transfer_id: transfer_id.to_owned(), - }, - } - } - /**Simulate a refund event in Sandbox - -Use the `/sandbox/transfer/refund/simulate` endpoint to simulate a refund event in the Sandbox environment. Note that while an event will be simulated and will appear when using endpoints such as `/transfer/event/sync` or `/transfer/event/list`, no transactions will actually take place and funds will not move between accounts, even within the Sandbox. - -See endpoint docs at .*/ - pub fn sandbox_transfer_refund_simulate( - &self, - event_type: &str, - refund_id: &str, - ) -> FluentRequest<'_, request::SandboxTransferRefundSimulateRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferRefundSimulateRequest { - event_type: event_type.to_owned(), - failure_reason: None, - refund_id: refund_id.to_owned(), - test_clock_id: None, - }, - } - } - /**Simulate converting pending balance to available balance - -Use the `/sandbox/transfer/ledger/simulate_available` endpoint to simulate converting pending balance to available balance for all originators in the Sandbox environment. - -See endpoint docs at .*/ - pub fn sandbox_transfer_ledger_simulate_available( - &self, - ) -> FluentRequest<'_, request::SandboxTransferLedgerSimulateAvailableRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferLedgerSimulateAvailableRequest { - test_clock_id: None, - }, - } - } - /**Simulate a ledger deposit event in Sandbox - -Use the `/sandbox/transfer/ledger/deposit/simulate` endpoint to simulate a ledger deposit event in the Sandbox environment. - -See endpoint docs at .*/ - pub fn sandbox_transfer_ledger_deposit_simulate( - &self, - event_type: &str, - sweep_id: &str, - ) -> FluentRequest<'_, request::SandboxTransferLedgerDepositSimulateRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferLedgerDepositSimulateRequest { - event_type: event_type.to_owned(), - failure_reason: None, - sweep_id: sweep_id.to_owned(), - }, - } - } - /**Simulate a ledger withdraw event in Sandbox - -Use the `/sandbox/transfer/ledger/withdraw/simulate` endpoint to simulate a ledger withdraw event in the Sandbox environment. - -See endpoint docs at .*/ - pub fn sandbox_transfer_ledger_withdraw_simulate( - &self, - event_type: &str, - sweep_id: &str, - ) -> FluentRequest<'_, request::SandboxTransferLedgerWithdrawSimulateRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferLedgerWithdrawSimulateRequest { - event_type: event_type.to_owned(), - failure_reason: None, - sweep_id: sweep_id.to_owned(), - }, - } - } - /**Trigger the creation of a repayment - -Use the `/sandbox/transfer/repayment/simulate` endpoint to trigger the creation of a repayment. As a side effect of calling this route, a repayment is created that includes all unreimbursed returns of guaranteed transfers. If there are no such returns, an 400 error is returned. - -See endpoint docs at .*/ - pub fn sandbox_transfer_repayment_simulate( - &self, - ) -> FluentRequest<'_, request::SandboxTransferRepaymentSimulateRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferRepaymentSimulateRequest { - }, - } - } - /**Manually fire a Transfer webhook - -Use the `/sandbox/transfer/fire_webhook` endpoint to manually trigger a `TRANSFER_EVENTS_UPDATE` webhook in the Sandbox environment. - -See endpoint docs at .*/ - pub fn sandbox_transfer_fire_webhook( - &self, - webhook: &str, - ) -> FluentRequest<'_, request::SandboxTransferFireWebhookRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferFireWebhookRequest { - webhook: webhook.to_owned(), - }, - } - } - /**Create a test clock - -Use the `/sandbox/transfer/test_clock/create` endpoint to create a `test_clock` in the Sandbox environment. - -A test clock object represents an independent timeline and has a `virtual_time` field indicating the current timestamp of the timeline. Test clocks are used for testing recurring transfers in Sandbox. - -A test clock can be associated with up to 5 recurring transfers. - -See endpoint docs at .*/ - pub fn sandbox_transfer_test_clock_create( - &self, - ) -> FluentRequest<'_, request::SandboxTransferTestClockCreateRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferTestClockCreateRequest { - virtual_time: None, - }, - } - } - /**Advance a test clock - -Use the `/sandbox/transfer/test_clock/advance` endpoint to advance a `test_clock` in the Sandbox environment. - -A test clock object represents an independent timeline and has a `virtual_time` field indicating the current timestamp of the timeline. A test clock can be advanced by incrementing `virtual_time`, but may never go back to a lower `virtual_time`. - -If a test clock is advanced, we will simulate the changes that ought to occur during the time that elapsed. - -For example, a client creates a weekly recurring transfer with a test clock set at t. When the client advances the test clock by setting `virtual_time` = t + 15 days, 2 new originations should be created, along with the webhook events. - -The advancement of the test clock from its current `virtual_time` should be limited such that there are no more than 20 originations resulting from the advance operation on each `recurring_transfer` associated with the `test_clock`. - -For example, if the recurring transfer associated with this test clock originates once every 4 weeks, you can advance the `virtual_time` up to 80 weeks on each API call. - -See endpoint docs at .*/ - pub fn sandbox_transfer_test_clock_advance( - &self, - new_virtual_time: chrono::DateTime, - test_clock_id: &str, - ) -> FluentRequest<'_, request::SandboxTransferTestClockAdvanceRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferTestClockAdvanceRequest { - new_virtual_time, - test_clock_id: test_clock_id.to_owned(), - }, - } - } - /**Get a test clock - -Use the `/sandbox/transfer/test_clock/get` endpoint to get a `test_clock` in the Sandbox environment. - -See endpoint docs at .*/ - pub fn sandbox_transfer_test_clock_get( - &self, - test_clock_id: &str, - ) -> FluentRequest<'_, request::SandboxTransferTestClockGetRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferTestClockGetRequest { - test_clock_id: test_clock_id.to_owned(), - }, - } - } - /**List test clocks - -Use the `/sandbox/transfer/test_clock/list` endpoint to see a list of all your test clocks in the Sandbox environment, by ascending `virtual_time`. Results are paginated; use the `count` and `offset` query parameters to retrieve the desired test clocks. - -See endpoint docs at .*/ - pub fn sandbox_transfer_test_clock_list( - &self, - ) -> FluentRequest<'_, request::SandboxTransferTestClockListRequest> { - FluentRequest { - client: self, - params: request::SandboxTransferTestClockListRequest { - count: None, - end_virtual_time: None, - offset: None, - start_virtual_time: None, - }, - } - } - /**Reset the login of a Payment Profile - -`/sandbox/payment_profile/reset_login/` forces a Payment Profile into a state where the login is no longer valid. This makes it easy to test update mode for Payment Profile in the Sandbox environment. - - After calling `/sandbox/payment_profile/reset_login`, calls to the `/transfer/authorization/create` with the Payment Profile will result in a `decision_rationale` `PAYMENT_PROFILE_LOGIN_REQUIRED`. You can then use update mode for Payment Profile to restore it into a good state. - - In order to invoke this endpoint, you must first [create a Payment Profile](https://plaid.com/docs/transfer/add-to-app/#create-a-payment-profile-optional) and [go through the Link flow](https://plaid.com/docs/transfer/add-to-app/#create-a-link-token). - -See endpoint docs at .*/ - pub fn sandbox_payment_profile_reset_login( - &self, - payment_profile_token: &str, - ) -> FluentRequest<'_, request::SandboxPaymentProfileResetLoginRequest> { - FluentRequest { - client: self, - params: request::SandboxPaymentProfileResetLoginRequest { - payment_profile_token: payment_profile_token.to_owned(), - }, - } - } - /**Search employer database - -`/employers/search` allows you the ability to search Plaid’s database of known employers, for use with Deposit Switch. You can use this endpoint to look up a user's employer in order to confirm that they are supported. Users with non-supported employers can then be routed out of the Deposit Switch flow. - -The data in the employer database is currently limited. As the Deposit Switch and Income products progress through their respective beta periods, more employers are being regularly added. Because the employer database is frequently updated, we recommend that you do not cache or store data from this endpoint for more than a day. - -See endpoint docs at .*/ - pub fn employers_search( - &self, - products: &[&str], - query: &str, - ) -> FluentRequest<'_, request::EmployersSearchRequest> { - FluentRequest { - client: self, - params: request::EmployersSearchRequest { - products: products.iter().map(|&x| x.to_owned()).collect(), - query: query.to_owned(), - }, - } - } - /**(Deprecated) Create an income verification instance - -`/income/verification/create` begins the income verification process by returning an `income_verification_id`. You can then provide the `income_verification_id` to `/link/token/create` under the `income_verification` parameter in order to create a Link instance that will prompt the user to go through the income verification flow. Plaid will fire an `INCOME` webhook once the user completes the Payroll Income flow, or when the uploaded documents in the Document Income flow have finished processing. - -See endpoint docs at .*/ - pub fn income_verification_create( - &self, - webhook: &str, - ) -> FluentRequest<'_, request::IncomeVerificationCreateRequest> { - FluentRequest { - client: self, - params: request::IncomeVerificationCreateRequest { - options: None, - precheck_id: None, - webhook: webhook.to_owned(), - }, - } - } - /**(Deprecated) Retrieve information from the paystubs used for income verification - -`/income/verification/paystubs/get` returns the information collected from the paystubs that were used to verify an end user's income. It can be called once the status of the verification has been set to `VERIFICATION_STATUS_PROCESSING_COMPLETE`, as reported by the `INCOME: verification_status` webhook. Attempting to call the endpoint before verification has been completed will result in an error. - -This endpoint has been deprecated; new integrations should use `/credit/payroll_income/get` instead. - -See endpoint docs at .*/ - pub fn income_verification_paystubs_get( - &self, - ) -> FluentRequest<'_, request::IncomeVerificationPaystubsGetRequest> { - FluentRequest { - client: self, - params: request::IncomeVerificationPaystubsGetRequest { - access_token: None, - income_verification_id: None, - }, - } - } - /**(Deprecated) Download the original documents used for income verification - -`/income/verification/documents/download` provides the ability to download the source documents associated with the verification. - -If Document Income was used, the documents will be those the user provided in Link. For Payroll Income, the most recent files available -for download from the payroll provider will be available from this endpoint. - -The response to `/income/verification/documents/download` is a ZIP file in binary data. If a `document_id` is passed, a single document will be contained in this file. -If not, the response will contain all documents associated with the verification. - -The `request_id` is returned in the `Plaid-Request-ID` header. - -See endpoint docs at .*/ - pub fn income_verification_documents_download( - &self, - ) -> FluentRequest<'_, request::IncomeVerificationDocumentsDownloadRequest> { - FluentRequest { - client: self, - params: request::IncomeVerificationDocumentsDownloadRequest { - access_token: None, - document_id: None, - income_verification_id: None, - }, - } - } - /**(Deprecated) Retrieve information from the tax documents used for income verification - -`/income/verification/taxforms/get` returns the information collected from forms that were used to verify an end user''s income. It can be called once the status of the verification has been set to `VERIFICATION_STATUS_PROCESSING_COMPLETE`, as reported by the `INCOME: verification_status` webhook. Attempting to call the endpoint before verification has been completed will result in an error. - -This endpoint has been deprecated; new integrations should use `/credit/payroll_income/get` instead. - -See endpoint docs at .*/ - pub fn income_verification_taxforms_get( - &self, - ) -> FluentRequest<'_, request::IncomeVerificationTaxformsGetRequest> { - FluentRequest { - client: self, - params: request::IncomeVerificationTaxformsGetRequest { - access_token: None, - income_verification_id: None, - }, - } - } - /**(Deprecated) Check digital income verification eligibility and optimize conversion - -`/income/verification/precheck` is an optional endpoint that can be called before initializing a Link session for income verification. It evaluates whether a given user is supportable by digital income verification and returns a `precheck_id` that can be provided to `/link/token/create`. If the user is eligible for digital verification, providing the `precheck_id` in this way will generate a Link UI optimized for the end user and their specific employer. If the user cannot be confirmed as eligible, the `precheck_id` can still be provided to `/link/token/create` and the user can still use the income verification flow, but they may be required to manually upload a paystub to verify their income. - -While all request fields are optional, providing either `employer` or `transactions_access_tokens` data will increase the chance of receiving a useful result. - -This endpoint has been deprecated; new integrations should use `/credit/payroll_income/precheck` instead. - -See endpoint docs at .*/ - pub fn income_verification_precheck( - &self, - ) -> FluentRequest<'_, request::IncomeVerificationPrecheckRequest> { - FluentRequest { - client: self, - params: request::IncomeVerificationPrecheckRequest { - employer: None, - payroll_institution: None, - transactions_access_token: None, - transactions_access_tokens: None, - us_military_info: None, - user: None, - }, - } - } - /**(Deprecated) Retrieve a summary of an individual's employment information - -`/employment/verification/get` returns a list of employments through a user payroll that was verified by an end user. - -This endpoint has been deprecated; new integrations should use `/credit/employment/get` instead. - -See endpoint docs at .*/ - pub fn employment_verification_get( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::EmploymentVerificationGetRequest> { - FluentRequest { - client: self, - params: request::EmploymentVerificationGetRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Create a deposit switch without using Plaid Exchange - -This endpoint provides an alternative to `/deposit_switch/create` for customers who have not yet fully integrated with Plaid Exchange. Like `/deposit_switch/create`, it creates a deposit switch entity that will be persisted throughout the lifecycle of the switch. - -See endpoint docs at .*/ - pub fn deposit_switch_alt_create( - &self, - target_account: DepositSwitchTargetAccount, - target_user: DepositSwitchTargetUser, - ) -> FluentRequest<'_, request::DepositSwitchAltCreateRequest> { - FluentRequest { - client: self, - params: request::DepositSwitchAltCreateRequest { - country_code: None, - options: None, - target_account, - target_user, - }, - } - } - /**Create Asset or Income Report Audit Copy Token - -Plaid can create an Audit Copy token of an Asset Report and/or Income Report to share with participating Government Sponsored Entity (GSE). If you participate in the Day 1 Certainty™ program, Plaid can supply an Audit Copy token directly to Fannie Mae on your behalf. An Audit Copy token contains the same underlying data as the Asset Report and/or Income Report (result of /credit/payroll_income/get). - -Use the `/credit/audit_copy_token/create` endpoint to create an `audit_copy_token` and then pass that token to the GSE who needs access. - -See endpoint docs at .*/ - pub fn credit_audit_copy_token_create( - &self, - report_tokens: &[&str], - ) -> FluentRequest<'_, request::CreditAuditCopyTokenCreateRequest> { - FluentRequest { - client: self, - params: request::CreditAuditCopyTokenCreateRequest { - report_tokens: report_tokens.iter().map(|&x| x.to_owned()).collect(), - }, - } - } - /**Remove an Audit Copy token - -The `/credit/audit_copy_token/remove` endpoint allows you to remove an Audit Copy. Removing an Audit Copy invalidates the `audit_copy_token` associated with it, meaning both you and any third parties holding the token will no longer be able to use it to access Report data. Items associated with the Report data and other Audit Copies of it are not affected and will remain accessible after removing the given Audit Copy. - -See endpoint docs at .*/ - pub fn credit_report_audit_copy_remove( - &self, - audit_copy_token: &str, - ) -> FluentRequest<'_, request::CreditReportAuditCopyRemoveRequest> { - FluentRequest { - client: self, - params: request::CreditReportAuditCopyRemoveRequest { - audit_copy_token: audit_copy_token.to_owned(), - }, - } - } - /**Retrieve an Asset Report with Freddie Mac format. Only Freddie Mac can use this endpoint. - -The `credit/asset_report/freddie_mac/get` endpoint retrieves the Asset Report in Freddie Mac's JSON format. - -See endpoint docs at .*/ - pub fn credit_asset_report_freddie_mac_get( - &self, - audit_copy_token: &str, - ) -> FluentRequest<'_, request::CreditAssetReportFreddieMacGetRequest> { - FluentRequest { - client: self, - params: request::CreditAssetReportFreddieMacGetRequest { - audit_copy_token: audit_copy_token.to_owned(), - }, - } - } - /**Retrieve an Asset Report with Freddie Mac format (aka VOA - Verification Of Assets), and a Verification Of Employment (VOE) report if this one is available. Only Freddie Mac can use this endpoint. - -The `credit/asset_report/freddie_mac/get` endpoint retrieves the Verification of Assets and Verification of Employment reports. - -See endpoint docs at .*/ - pub fn credit_freddie_mac_reports_get( - &self, - audit_copy_token: &str, - ) -> FluentRequest<'_, request::CreditFreddieMacReportsGetRequest> { - FluentRequest { - client: self, - params: request::CreditFreddieMacReportsGetRequest { - audit_copy_token: audit_copy_token.to_owned(), - }, - } - } - /**Retrieve information from the bank accounts used for employment verification - -`/credit/bank_employment/get` returns the employment report(s) derived from bank transaction data for a specified user. - -See endpoint docs at .*/ - pub fn credit_bank_employment_get( - &self, - user_token: &str, - ) -> FluentRequest<'_, request::CreditBankEmploymentGetRequest> { - FluentRequest { - client: self, - params: request::CreditBankEmploymentGetRequest { - user_token: user_token.to_owned(), - }, - } - } - /**Retrieve information from the bank accounts used for income verification - -`/credit/bank_income/get` returns the bank income report(s) for a specified user. - -See endpoint docs at .*/ - pub fn credit_bank_income_get( - &self, - ) -> FluentRequest<'_, request::CreditBankIncomeGetRequest> { - FluentRequest { - client: self, - params: request::CreditBankIncomeGetRequest { - options: None, - user_token: None, - }, - } - } - /**Retrieve information from the bank accounts used for income verification in PDF format - -`/credit/bank_income/pdf/get` returns the most recent bank income report for a specified user in PDF format. - -See endpoint docs at .*/ - pub fn credit_bank_income_pdf_get( - &self, - user_token: &str, - ) -> FluentRequest<'_, request::CreditBankIncomePdfGetRequest> { - FluentRequest { - client: self, - params: request::CreditBankIncomePdfGetRequest { - user_token: user_token.to_owned(), - }, - } - } - /**Refresh a user's bank income information - -`/credit/bank_income/refresh` refreshes the bank income report data for a specific user. - -See endpoint docs at .*/ - pub fn credit_bank_income_refresh( - &self, - user_token: &str, - ) -> FluentRequest<'_, request::CreditBankIncomeRefreshRequest> { - FluentRequest { - client: self, - params: request::CreditBankIncomeRefreshRequest { - options: None, - user_token: user_token.to_owned(), - }, - } - } - /**Subscribe and unsubscribe to proactive notifications for a user's income profile - -`/credit/bank_income/webhook/update` allows you to subscribe or unsubscribe a user for income webhook notifications. By default, all users start out unsubscribed. - -If a user is subscribed, on significant changes to the user's income profile, you will receive a `BANK_INCOME_REFRESH_UPDATE` webhook, prompting you to refresh bank income data for the user. - -See endpoint docs at .*/ - pub fn credit_bank_income_webhook_update( - &self, - enable_webhooks: bool, - user_token: &str, - ) -> FluentRequest<'_, request::CreditBankIncomeWebhookUpdateRequest> { - FluentRequest { - client: self, - params: request::CreditBankIncomeWebhookUpdateRequest { - enable_webhooks, - user_token: user_token.to_owned(), - }, - } - } - /**Update the parsing configuration for a document income verification - -`/credit/payroll_income/parsing_config/update` updates the parsing configuration for a document income verification. - -See endpoint docs at .*/ - pub fn credit_payroll_income_parsing_config_update( - &self, - parsing_config: &[&str], - user_token: &str, - ) -> FluentRequest<'_, request::CreditPayrollIncomeParsingConfigUpdateRequest> { - FluentRequest { - client: self, - params: request::CreditPayrollIncomeParsingConfigUpdateRequest { - item_id: None, - parsing_config: parsing_config.iter().map(|&x| x.to_owned()).collect(), - user_token: user_token.to_owned(), - }, - } - } - /**Retrieve data for a user's uploaded bank statements - -`/credit/bank_statements/uploads/get` returns parsed data from bank statements uploaded by users as part of the Document Income flow. If your account is not enabled for Document Parsing, contact your account manager to request access. - -See endpoint docs at .*/ - pub fn credit_bank_statements_uploads_get( - &self, - user_token: &str, - ) -> FluentRequest<'_, request::CreditBankStatementsUploadsGetRequest> { - FluentRequest { - client: self, - params: request::CreditBankStatementsUploadsGetRequest { - user_token: user_token.to_owned(), - }, - } - } - /**Retrieve a user's payroll information - -This endpoint gets payroll income information for a specific user, either as a result of the user connecting to their payroll provider or uploading a pay related document. - -See endpoint docs at .*/ - pub fn credit_payroll_income_get( - &self, - ) -> FluentRequest<'_, request::CreditPayrollIncomeGetRequest> { - FluentRequest { - client: self, - params: request::CreditPayrollIncomeGetRequest { - user_token: None, - }, - } - } - /**Retrieve fraud insights for a user's manually uploaded document(s). - -`/credit/payroll_income/risk_signals/get` can be used as part of the Document Income flow to assess a user-uploaded document for signs of potential fraud or tampering. It returns a risk score for each uploaded document that indicates the likelihood of the document being fraudulent, in addition to details on the individual risk signals contributing to the score. - -To trigger risk signal generation for an Item, call `/link/token/create` with `parsing_config` set to include `fraud_risk`, or call `/credit/payroll_income/parsing_config/update`. Once risk signal generation has been triggered, `/credit/payroll_income/risk_signals/get` can be called at any time after the `INCOME_VERIFICATION_RISK_SIGNALS` webhook has been fired. - -`/credit/payroll_income/risk_signals/get` is offered as an add-on to Document Income and is billed separately. To request access to this endpoint, submit a product access request or contact your Plaid account manager. - -See endpoint docs at .*/ - pub fn credit_payroll_income_risk_signals_get( - &self, - ) -> FluentRequest<'_, request::CreditPayrollIncomeRiskSignalsGetRequest> { - FluentRequest { - client: self, - params: request::CreditPayrollIncomeRiskSignalsGetRequest { - user_token: None, - }, - } - } - /**Check income verification eligibility and optimize conversion - -`/credit/payroll_income/precheck` is an optional endpoint that can be called before initializing a Link session for income verification. It evaluates whether a given user is supportable by digital income verification. If the user is eligible for digital verification, that information will be associated with the user token, and in this way will generate a Link UI optimized for the end user and their specific employer. If the user cannot be confirmed as eligible, the user can still use the income verification flow, but they may be required to manually upload a paystub to verify their income. - -While all request fields are optional, providing `employer` data will increase the chance of receiving a useful result. - -When testing in Sandbox, you can control the results by providing special test values in the `employer` and `access_tokens` fields. `employer_good` and `employer_bad` will result in `HIGH` and `LOW` confidence values, respectively. `employer_multi` will result in a `HIGH` confidence with multiple payroll options. Likewise, `access_good` and `access_bad` will result in `HIGH` and `LOW` confidence values, respectively. Any other value for `employer` and `access_tokens` in Sandbox will result in `UNKNOWN` confidence. - -See endpoint docs at .*/ - pub fn credit_payroll_income_precheck( - &self, - ) -> FluentRequest<'_, request::CreditPayrollIncomePrecheckRequest> { - FluentRequest { - client: self, - params: request::CreditPayrollIncomePrecheckRequest { - access_tokens: None, - employer: None, - payroll_institution: None, - us_military_info: None, - user_token: None, - }, - } - } - /**Retrieve a summary of an individual's employment information - -`/credit/employment/get` returns a list of items with employment information from a user's payroll provider that was verified by an end user. - -See endpoint docs at .*/ - pub fn credit_employment_get( - &self, - user_token: &str, - ) -> FluentRequest<'_, request::CreditEmploymentGetRequest> { - FluentRequest { - client: self, - params: request::CreditEmploymentGetRequest { - user_token: user_token.to_owned(), - }, - } - } - /**Refresh a digital payroll income verification - -`/credit/payroll_income/refresh` refreshes a given digital payroll income verification. - -See endpoint docs at .*/ - pub fn credit_payroll_income_refresh( - &self, - user_token: &str, - ) -> FluentRequest<'_, request::CreditPayrollIncomeRefreshRequest> { - FluentRequest { - client: self, - params: request::CreditPayrollIncomeRefreshRequest { - options: None, - user_token: user_token.to_owned(), - }, - } - } - /**Create a relay token to share an Asset Report with a partner client (beta) - -Plaid can share an Asset Report directly with a participating third party on your behalf. The shared Asset Report is the exact same Asset Report originally created in `/asset_report/create`. - -To grant a third party access to an Asset Report, use the `/credit/relay/create` endpoint to create a `relay_token` and then pass that token to your third party. Each third party has its own `secondary_client_id`; for example, `ce5bd328dcd34123456`. You'll need to create a separate `relay_token` for each third party that needs access to the report on your behalf. - -See endpoint docs at .*/ - pub fn credit_relay_create( - &self, - report_tokens: &[&str], - secondary_client_id: &str, - ) -> FluentRequest<'_, request::CreditRelayCreateRequest> { - FluentRequest { - client: self, - params: request::CreditRelayCreateRequest { - report_tokens: report_tokens.iter().map(|&x| x.to_owned()).collect(), - secondary_client_id: secondary_client_id.to_owned(), - webhook: None, - }, - } - } - /**Retrieve the reports associated with a relay token that was shared with you (beta) - -`/credit/relay/get` allows third parties to receive a report that was shared with them, using a `relay_token` that was created by the report owner. - -See endpoint docs at .*/ - pub fn credit_relay_get( - &self, - relay_token: &str, - report_type: &str, - ) -> FluentRequest<'_, request::CreditRelayGetRequest> { - FluentRequest { - client: self, - params: request::CreditRelayGetRequest { - relay_token: relay_token.to_owned(), - report_type: report_type.to_owned(), - }, - } - } - /**Retrieve the pdf reports associated with a relay token that was shared with you (beta) - -`/credit/relay/pdf/get` allows third parties to receive a pdf report that was shared with them, using a `relay_token` that was created by the report owner. - -The `/credit/relay/pdf/get` endpoint retrieves the Asset Report in PDF format. Before calling `/credit/relay/pdf/get`, you must first create the Asset Report using `/credit/relay/create` and then wait for the [`PRODUCT_READY`](https://plaid.com/docs/api/products/assets/#product_ready) webhook to fire, indicating that the Report is ready to be retrieved. - -The response to `/credit/relay/pdf/get` is the PDF binary data. The `request_id` is returned in the `Plaid-Request-ID` header. - -[View a sample PDF Asset Report](https://plaid.com/documents/sample-asset-report.pdf). - -See endpoint docs at .*/ - pub fn credit_relay_pdf_get( - &self, - relay_token: &str, - report_type: &str, - ) -> FluentRequest<'_, request::CreditRelayPdfGetRequest> { - FluentRequest { - client: self, - params: request::CreditRelayPdfGetRequest { - relay_token: relay_token.to_owned(), - report_type: report_type.to_owned(), - }, - } - } - /**Refresh a report of a relay token (beta) - -The `/credit/relay/refresh` endpoint allows third parties to refresh a report that was relayed to them, using a `relay_token` that was created by the report owner. A new report will be created with the original report parameters, but with the most recent data available based on the `days_requested` value of the original report. - -See endpoint docs at .*/ - pub fn credit_relay_refresh( - &self, - relay_token: &str, - report_type: &str, - ) -> FluentRequest<'_, request::CreditRelayRefreshRequest> { - FluentRequest { - client: self, - params: request::CreditRelayRefreshRequest { - relay_token: relay_token.to_owned(), - report_type: report_type.to_owned(), - webhook: None, - }, - } - } - /**Remove relay token (beta) - -The `/credit/relay/remove` endpoint allows you to invalidate a `relay_token`. The third party holding the token will no longer be able to access or refresh the reports which the `relay_token` gives access to. The original report, associated Items, and other relay tokens that provide access to the same report are not affected and will remain accessible after removing the given `relay_token`. - -See endpoint docs at .*/ - pub fn credit_relay_remove( - &self, - relay_token: &str, - ) -> FluentRequest<'_, request::CreditRelayRemoveRequest> { - FluentRequest { - client: self, - params: request::CreditRelayRemoveRequest { - relay_token: relay_token.to_owned(), - }, - } - } - /**Manually fire a Bank Transfer webhook - -Use the `/sandbox/bank_transfer/fire_webhook` endpoint to manually trigger a Bank Transfers webhook in the Sandbox environment. - -See endpoint docs at .*/ - pub fn sandbox_bank_transfer_fire_webhook( - &self, - webhook: &str, - ) -> FluentRequest<'_, request::SandboxBankTransferFireWebhookRequest> { - FluentRequest { - client: self, - params: request::SandboxBankTransferFireWebhookRequest { - webhook: webhook.to_owned(), - }, - } - } - /**Manually fire an Income webhook - -Use the `/sandbox/income/fire_webhook` endpoint to manually trigger a Payroll or Document Income webhook in the Sandbox environment. - -See endpoint docs at .*/ - pub fn sandbox_income_fire_webhook( - &self, - item_id: &str, - webhook: &str, - webhook_code: &str, - ) -> FluentRequest<'_, request::SandboxIncomeFireWebhookRequest> { - FluentRequest { - client: self, - params: request::SandboxIncomeFireWebhookRequest { - item_id: item_id.to_owned(), - user_id: None, - verification_status: None, - webhook: webhook.to_owned(), - webhook_code: webhook_code.to_owned(), - }, - } - } - /**Manually fire a bank income webhook in sandbox - -Use the `/sandbox/bank_income/fire_webhook` endpoint to manually trigger a Bank Income webhook in the Sandbox environment. - -See endpoint docs at .*/ - pub fn sandbox_bank_income_fire_webhook( - &self, - webhook_code: &str, - webhook_fields: SandboxBankIncomeWebhookFireRequestWebhookFields, - ) -> FluentRequest<'_, request::SandboxBankIncomeFireWebhookRequest> { - FluentRequest { - client: self, - params: request::SandboxBankIncomeFireWebhookRequest { - webhook_code: webhook_code.to_owned(), - webhook_fields, - webhook_override: None, - }, - } - } - ///Save the selected accounts when connecting to the Platypus Oauth institution - pub fn sandbox_oauth_select_accounts( - &self, - accounts: &[&str], - oauth_state_id: &str, - ) -> FluentRequest<'_, request::SandboxOauthSelectAccountsRequest> { - FluentRequest { - client: self, - params: request::SandboxOauthSelectAccountsRequest { - accounts: accounts.iter().map(|&x| x.to_owned()).collect(), - oauth_state_id: oauth_state_id.to_owned(), - }, - } - } - /**Evaluate a planned ACH transaction - -Use `/signal/evaluate` to evaluate a planned ACH transaction to get a return risk assessment (such as a risk score and risk tier) and additional risk signals. - -In order to obtain a valid score for an ACH transaction, Plaid must have an access token for the account, and the Item must be healthy (receiving product updates) or have recently been in a healthy state. If the transaction does not meet eligibility requirements, an error will be returned corresponding to the underlying cause. If `/signal/evaluate` is called on the same transaction multiple times within a 24-hour period, cached results may be returned. For more information please refer to the error documentation on [Item errors](/docs/errors/item/) and [Link in Update Mode](/docs/link/update-mode/). - -Note: This request may take some time to complete if Signal is being added to an existing Item. This is because Plaid must communicate directly with the institution when retrieving the data for the first time. - -See endpoint docs at .*/ - pub fn signal_evaluate( - &self, - args: request::SignalEvaluateRequired, - ) -> FluentRequest<'_, request::SignalEvaluateRequest> { - FluentRequest { - client: self, - params: request::SignalEvaluateRequest { - access_token: args.access_token.to_owned(), - account_id: args.account_id.to_owned(), - amount: args.amount, - client_transaction_id: args.client_transaction_id.to_owned(), - client_user_id: None, - default_payment_method: None, - device: None, - is_recurring: None, - risk_profile_key: None, - user: None, - user_present: None, - }, - } - } - /**Report whether you initiated an ACH transaction - -After calling `/signal/evaluate`, call `/signal/decision/report` to report whether the transaction was initiated. - -See endpoint docs at .*/ - pub fn signal_decision_report( - &self, - client_transaction_id: &str, - initiated: bool, - ) -> FluentRequest<'_, request::SignalDecisionReportRequest> { - FluentRequest { - client: self, - params: request::SignalDecisionReportRequest { - amount_instantly_available: None, - client_transaction_id: client_transaction_id.to_owned(), - days_funds_on_hold: None, - decision_outcome: None, - initiated, - payment_method: None, - }, - } - } - /**Report a return for an ACH transaction - -Call the `/signal/return/report` endpoint to report a returned transaction that was previously sent to the `/signal/evaluate` endpoint. Your feedback will be used by the model to incorporate the latest risk trend in your portfolio. - -See endpoint docs at .*/ - pub fn signal_return_report( - &self, - client_transaction_id: &str, - return_code: &str, - ) -> FluentRequest<'_, request::SignalReturnReportRequest> { - FluentRequest { - client: self, - params: request::SignalReturnReportRequest { - client_transaction_id: client_transaction_id.to_owned(), - return_code: return_code.to_owned(), - returned_at: None, - }, - } - } - /**Opt-in an Item to Signal - -When Link is not initialized with Signal, call `/signal/prepare` to opt-in that Item to the Signal data collection process, developing a Signal score. - -If you are using other Plaid products after Link, e.g. Identity or Assets, call `/signal/prepare` after those product calls are complete. - -Example flow: Link is initialized with Auth, call `/auth/get` for the account and routing number, call `/identity/get` to retrieve bank ownership details, then call `/signal/prepare` to begin Signal data collection. Later, once you have obtained details about the proposed transaction from the user, call `/signal/evaluate` for a Signal score. For more information please see [Recommendations for initializing Link with specific product combinations](https://www.plaid.com/docs/link/initializing-products/#recommendations-for-initializing-link-with-specific-product-combinations). - -If run on an Item that is already initialized with Signal, this endpoint will return a 200 response and will not modify the Item. - -See endpoint docs at .*/ - pub fn signal_prepare( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::SignalPrepareRequest> { - FluentRequest { - client: self, - params: request::SignalPrepareRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Create an e-wallet - -Create an e-wallet. The response is the newly created e-wallet object. - -See endpoint docs at .*/ - pub fn wallet_create( - &self, - iso_currency_code: &str, - ) -> FluentRequest<'_, request::WalletCreateRequest> { - FluentRequest { - client: self, - params: request::WalletCreateRequest { - iso_currency_code: iso_currency_code.to_owned(), - }, - } - } - /**Fetch an e-wallet - -Fetch an e-wallet. The response includes the current balance. - -See endpoint docs at .*/ - pub fn wallet_get( - &self, - wallet_id: &str, - ) -> FluentRequest<'_, request::WalletGetRequest> { - FluentRequest { - client: self, - params: request::WalletGetRequest { - wallet_id: wallet_id.to_owned(), - }, - } - } - /**Fetch a list of e-wallets - -This endpoint lists all e-wallets in descending order of creation. - -See endpoint docs at .*/ - pub fn wallet_list(&self) -> FluentRequest<'_, request::WalletListRequest> { - FluentRequest { - client: self, - params: request::WalletListRequest { - count: None, - cursor: None, - iso_currency_code: None, - }, - } - } - /**Execute a transaction using an e-wallet - -Execute a transaction using the specified e-wallet. -Specify the e-wallet to debit from, the counterparty to credit to, the idempotency key to prevent duplicate transactions, the amount and reference for the transaction. -Transactions will settle in seconds to several days, depending on the underlying payment rail. - -See endpoint docs at .*/ - pub fn wallet_transaction_execute( - &self, - args: request::WalletTransactionExecuteRequired, - ) -> FluentRequest<'_, request::WalletTransactionExecuteRequest> { - FluentRequest { - client: self, - params: request::WalletTransactionExecuteRequest { - amount: args.amount, - counterparty: args.counterparty, - idempotency_key: args.idempotency_key.to_owned(), - reference: args.reference.to_owned(), - wallet_id: args.wallet_id.to_owned(), - }, - } - } - /**Fetch an e-wallet transaction - -Fetch a specific e-wallet transaction - -See endpoint docs at .*/ - pub fn wallet_transaction_get( - &self, - transaction_id: &str, - ) -> FluentRequest<'_, request::WalletTransactionGetRequest> { - FluentRequest { - client: self, - params: request::WalletTransactionGetRequest { - transaction_id: transaction_id.to_owned(), - }, - } - } - /**List e-wallet transactions - -This endpoint lists the latest transactions of the specified e-wallet. Transactions are returned in descending order by the `created_at` time. - -See endpoint docs at .*/ - pub fn wallet_transaction_list( - &self, - wallet_id: &str, - ) -> FluentRequest<'_, request::WalletTransactionListRequest> { - FluentRequest { - client: self, - params: request::WalletTransactionListRequest { - count: None, - cursor: None, - options: None, - wallet_id: wallet_id.to_owned(), - }, - } - } - /**enhance locally-held transaction data - -The `/beta/transactions/v1/enhance` endpoint enriches raw transaction data provided directly by clients. - -The product is currently in beta.*/ - pub fn transactions_enhance( - &self, - account_type: &str, - transactions: Vec, - ) -> FluentRequest<'_, request::TransactionsEnhanceRequest> { - FluentRequest { - client: self, - params: request::TransactionsEnhanceRequest { - account_type: account_type.to_owned(), - transactions, - }, - } - } - /**Create transaction category rule - -The `/transactions/rules/v1/create` endpoint creates transaction categorization rules. - -Rules will be applied on the Item's transactions returned in `/transactions/get` response. - -The product is currently in beta. To request access, contact transactions-feedback@plaid.com.*/ - pub fn transactions_rules_create( - &self, - access_token: &str, - personal_finance_category: &str, - rule_details: TransactionsRuleDetails, - ) -> FluentRequest<'_, request::TransactionsRulesCreateRequest> { - FluentRequest { - client: self, - params: request::TransactionsRulesCreateRequest { - access_token: access_token.to_owned(), - personal_finance_category: personal_finance_category.to_owned(), - rule_details, - }, - } - } - /**Return a list of rules created for the Item associated with the access token. - -The `/transactions/rules/v1/list` returns a list of transaction rules created for the Item associated with the access token.*/ - pub fn transactions_rules_list( - &self, - access_token: &str, - ) -> FluentRequest<'_, request::TransactionsRulesListRequest> { - FluentRequest { - client: self, - params: request::TransactionsRulesListRequest { - access_token: access_token.to_owned(), - }, - } - } - /**Remove transaction rule - -The `/transactions/rules/v1/remove` endpoint is used to remove a transaction rule.*/ - pub fn transactions_rules_remove( - &self, - access_token: &str, - rule_id: &str, - ) -> FluentRequest<'_, request::TransactionsRulesRemoveRequest> { - FluentRequest { - client: self, - params: request::TransactionsRulesRemoveRequest { - access_token: access_token.to_owned(), - rule_id: rule_id.to_owned(), - }, - } - } - /**Obtain user insights based on transactions sent through /transactions/enrich - -The `/beta/transactions/user_insights/v1/get` gets user insights for clients who have enriched data with `/transactions/enrich`. - -The product is currently in beta. - -See endpoint docs at .*/ - pub fn transactions_user_insights_get( - &self, - client_user_id: &str, - ) -> FluentRequest<'_, request::TransactionsUserInsightsGetRequest> { - FluentRequest { - client: self, - params: request::TransactionsUserInsightsGetRequest { - client_user_id: client_user_id.to_owned(), - }, - } - } - /**Create payment profile - -Use `/payment_profile/create` endpoint to create a new payment profile. -To initiate the account linking experience, call `/link/token/create` and provide the `payment_profile_token` in the `transfer.payment_profile_token` field. -You can then use the `payment_profile_token` when creating transfers using `/transfer/authorization/create` and `/transfer/create`. - -See endpoint docs at .*/ - pub fn payment_profile_create( - &self, - ) -> FluentRequest<'_, request::PaymentProfileCreateRequest> { - FluentRequest { - client: self, - params: request::PaymentProfileCreateRequest { - }, - } - } - /**Get payment profile - -Use `/payment_profile/get` endpoint to get the status of a given Payment Profile. - -See endpoint docs at .*/ - pub fn payment_profile_get( - &self, - payment_profile_token: &str, - ) -> FluentRequest<'_, request::PaymentProfileGetRequest> { - FluentRequest { - client: self, - params: request::PaymentProfileGetRequest { - payment_profile_token: payment_profile_token.to_owned(), - }, - } - } - /**Remove payment profile - -Use the `/payment_profile/remove` endpoint to remove a given Payment Profile. Once it’s removed, it can no longer be used to create transfers. - -See endpoint docs at .*/ - pub fn payment_profile_remove( - &self, - payment_profile_token: &str, - ) -> FluentRequest<'_, request::PaymentProfileRemoveRequest> { - FluentRequest { - client: self, - params: request::PaymentProfileRemoveRequest { - payment_profile_token: payment_profile_token.to_owned(), - }, - } - } - /**Creates a new end customer for a Plaid reseller. - -The `/partner/customer/create` endpoint is used by reseller partners to create end customers. - -See endpoint docs at .*/ - pub fn partner_customer_create( - &self, - args: request::PartnerCustomerCreateRequired, - ) -> FluentRequest<'_, request::PartnerCustomerCreateRequest> { - FluentRequest { - client: self, - params: request::PartnerCustomerCreateRequest { - address: args.address, - application_name: args.application_name.to_owned(), - assets_under_management: None, - billing_contact: None, - client_id: None, - company_name: args.company_name.to_owned(), - create_link_customization: None, - customer_support_info: None, - is_bank_addendum_completed: args.is_bank_addendum_completed, - is_diligence_attested: args.is_diligence_attested, - legal_entity_name: args.legal_entity_name.to_owned(), - logo: None, - products: None, - redirect_uris: None, - registration_number: None, - secret: None, - technical_contact: None, - website: args.website.to_owned(), - }, - } - } - /**Returns a Plaid reseller's end customer. - -The `/partner/customer/get` endpoint is used by reseller partners to retrieve data about a single end customer. - -See endpoint docs at .*/ - pub fn partner_customer_get( - &self, - end_customer_client_id: &str, - ) -> FluentRequest<'_, request::PartnerCustomerGetRequest> { - FluentRequest { - client: self, - params: request::PartnerCustomerGetRequest { - client_id: None, - end_customer_client_id: end_customer_client_id.to_owned(), - secret: None, - }, - } - } - /**Enables a Plaid reseller's end customer in the Production environment. - -The `/partner/customer/enable` endpoint is used by reseller partners to enable an end customer in the Production environment. - -See endpoint docs at .*/ - pub fn partner_customer_enable( - &self, - end_customer_client_id: &str, - ) -> FluentRequest<'_, request::PartnerCustomerEnableRequest> { - FluentRequest { - client: self, - params: request::PartnerCustomerEnableRequest { - client_id: None, - end_customer_client_id: end_customer_client_id.to_owned(), - secret: None, - }, - } - } - /**Removes a Plaid reseller's end customer. - -The `/partner/customer/remove` endpoint is used by reseller partners to remove an end customer. Removing an end customer will remove it from view in the Plaid Dashboard and deactivate its API keys. This endpoint can only be used to remove an end customer that has not yet been enabled in Production. - -See endpoint docs at .*/ - pub fn partner_customer_remove( - &self, - end_customer_client_id: &str, - ) -> FluentRequest<'_, request::PartnerCustomerRemoveRequest> { - FluentRequest { - client: self, - params: request::PartnerCustomerRemoveRequest { - client_id: None, - end_customer_client_id: end_customer_client_id.to_owned(), - secret: None, - }, - } - } - /**Returns OAuth-institution registration information for a given end customer. - -The `/partner/customer/oauth_institutions/get` endpoint is used by reseller partners to retrieve OAuth-institution registration information about a single end customer. To learn how to set up a webhook to listen to status update events, visit the [reseller documentation](https://plaid.com/docs/account/resellers/#enabling-end-customers). - -See endpoint docs at .*/ - pub fn partner_customer_oauth_institutions_get( - &self, - end_customer_client_id: &str, - ) -> FluentRequest<'_, request::PartnerCustomerOauthInstitutionsGetRequest> { - FluentRequest { - client: self, - params: request::PartnerCustomerOauthInstitutionsGetRequest { - client_id: None, - end_customer_client_id: end_customer_client_id.to_owned(), - secret: None, - }, - } - } - /**Create Hosted Link session - -Use the `/link_delivery/create` endpoint to create a Hosted Link session. - -See endpoint docs at .*/ - pub fn link_delivery_create( - &self, - link_token: &str, - ) -> FluentRequest<'_, request::LinkDeliveryCreateRequest> { - FluentRequest { - client: self, - params: request::LinkDeliveryCreateRequest { - link_token: link_token.to_owned(), - options: None, - }, - } - } - /**Get Hosted Link session - -Use the `/link_delivery/get` endpoint to get the status of a Hosted Link session. - -See endpoint docs at .*/ - pub fn link_delivery_get( - &self, - link_delivery_session_id: &str, - ) -> FluentRequest<'_, request::LinkDeliveryGetRequest> { - FluentRequest { - client: self, - params: request::LinkDeliveryGetRequest { - link_delivery_session_id: link_delivery_session_id.to_owned(), - }, - } - } - /**Webhook receiver for fdx notifications - -A generic webhook receiver endpoint for FDX Event Notifications - -See endpoint docs at .*/ - pub fn fdx_notifications( - &self, - args: request::FdxNotificationsRequired, - ) -> FluentRequest<'_, request::FdxNotificationsRequest> { - FluentRequest { - client: self, - params: request::FdxNotificationsRequest { - category: args.category.to_owned(), - notification_id: args.notification_id.to_owned(), - notification_payload: args.notification_payload, - priority: None, - publisher: None, - sent_on: args.sent_on, - severity: None, - subscriber: None, - type_: args.type_.to_owned(), - url: None, - }, - } - } } pub enum PlaidAuth { - ClientId { client_id: String, secret: String, plaid_version: String }, + ClientId { plaid_client_id: String }, } impl PlaidAuth { pub fn from_env() -> Self { Self::ClientId { - client_id: std::env::var("PLAID_CLIENT_ID") - .expect("Environment variable PLAID_CLIENT_ID is not set."), - secret: std::env::var("PLAID_SECRET") - .expect("Environment variable PLAID_SECRET is not set."), - plaid_version: std::env::var("PLAID_VERSION") - .expect("Environment variable PLAID_VERSION is not set."), + plaid_client_id: std::env::var("PLAID_PLAID_CLIENT_ID") + .expect("Environment variable PLAID_PLAID_CLIENT_ID is not set."), } } } diff --git a/src/model/account_access.rs b/src/model/account_access.rs index 602ce8a3..a84fc9c9 100644 --- a/src/model/account_access.rs +++ b/src/model/account_access.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for AccountAccess { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/account_assets.rs b/src/model/account_assets.rs index 1f1ee596..3260fb3c 100644 --- a/src/model/account_assets.rs +++ b/src/model/account_assets.rs @@ -1,26 +1,44 @@ use serde::{Serialize, Deserialize}; use super::{ - AccountBase, AssetReportInvestments, AssetReportTransaction, HistoricalBalance, - Owner, OwnershipType, + AccountHolderCategory, AccountSubtype, AccountType, AssetReportAccountBalance, + AssetReportInvestments, AssetReportTransaction, HistoricalBalance, Owner, + OwnershipType, }; ///Asset information about an account -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AccountAssets { - ///A single account at a financial institution. - #[serde(flatten)] - pub account_base: AccountBase, - ///The duration of transaction history available for this Item, typically defined as the time since the date of the earliest transaction in that account. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub days_available: Option, + /**Plaid’s unique identifier for the account. This value will not change unless Plaid can't reconcile the account with the data returned by the financial institution. This may occur, for example, when the name of the account changes. If this happens a new `account_id` will be assigned to the account. + +The `account_id` can also change if the `access_token` is deleted and the same credentials that were used to generate that `access_token` are used to generate a new `access_token` on a later date. In that case, the new `account_id` will be different from the old `account_id`. + +If an account with a specific `account_id` disappears instead of changing, the account is likely closed. Closed accounts are not returned by the Plaid API. + +Like all Plaid identifiers, the `account_id` is case sensitive.*/ + pub account_id: String, + ///A set of fields describing the balance for an account. Balance information may be cached unless the balance object was returned by `/accounts/balance/get`. + pub balances: AssetReportAccountBalance, + ///The duration of transaction history available within this report for this Item, typically defined as the time since the date of the earliest transaction in that account. + pub days_available: f64, ///Calculated data about the historical balances on the account. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub historical_balances: Vec, + ///Indicates the account's categorization as either a personal or a business account. This field is currently in beta; to request access, contact your account manager. #[serde(default, skip_serializing_if = "Option::is_none")] - pub historical_balances: Option>, + pub holder_category: Option, ///A transaction within an investment account. #[serde(default, skip_serializing_if = "Option::is_none")] pub investments: Option, - ///Data returned by the financial institution about the account owner or owners.For business accounts, the name reported may be either the name of the individual or the name of the business, depending on the institution. Multiple owners on a single account will be represented in the same `owner` object, not in multiple owner objects within the array. In API versions 2018-05-22 and earlier, the `owners` object is not returned, and instead identity information is returned in the top level `identity` object. For more details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2019-05-29) + ///The last 2-4 alphanumeric characters of an account's official account number. Note that the mask may be non-unique between an Item's accounts, and it may also not match the mask that the bank displays to the user. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mask: Option, + ///The name of the account, either assigned by the user or by the financial institution itself + pub name: String, + ///The official name of the account as given by the financial institution #[serde(default, skip_serializing_if = "Option::is_none")] - pub owners: Option>, + pub official_name: Option, + ///Data returned by the financial institution about the account owner or owners.For business accounts, the name reported may be either the name of the individual or the name of the business, depending on the institution. Multiple owners on a single account will be represented in the same `owner` object, not in multiple owner objects within the array. In API versions 2018-05-22 and earlier, the `owners` object is not returned, and instead identity information is returned in the top level `identity` object. For more details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2019-05-29) + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub owners: Vec, /**How an asset is owned. `association`: Ownership by a corporation, partnership, or unincorporated association, including for-profit and not-for-profit organizations. @@ -29,23 +47,48 @@ pub struct AccountAssets { `trust`: Ownership by a revocable or irrevocable trust.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub ownership_type: Option, + ///A unique and persistent identifier for accounts that can be used to trace multiple instances of the same account across different Items for depository accounts. This is currently an opt-in field and only supported for Chase Items. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub persistent_account_id: Option, + ///See the [Account type schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subtype: Option, ///Transaction history associated with the account. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub transactions: Vec, + /**`investment:` Investment account. In API versions 2018-05-22 and earlier, this type is called `brokerage` instead. + +`credit:` Credit card + +`depository:` Depository account + +`loan:` Loan account + +`other:` Non-specified account type + +See the [Account type schema](https://plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.*/ + #[serde(rename = "type")] + pub type_: AccountType, + /**The current verification status of an Auth Item initiated through Automated or Manual micro-deposits. Returned for Auth Items only. + +`pending_automatic_verification`: The Item is pending automatic verification + +`pending_manual_verification`: The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the micro-deposit. + +`automatically_verified`: The Item has successfully been automatically verified + +`manually_verified`: The Item has successfully been manually verified + +`verification_expired`: Plaid was unable to automatically verify the deposit within 7 calendar days and will no longer attempt to validate the Item. Users may retry by submitting their information again through Link. + +`verification_failed`: The Item failed manual micro-deposit verification because the user exhausted all 3 verification attempts. Users may retry by submitting their information again through Link. + +`database_matched`: The Item has successfully been verified using Plaid's data sources. Note: Database Match is currently a beta feature, please contact your account manager for more information.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub transactions: Option>, + pub verification_status: Option, } impl std::fmt::Display for AccountAssets { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } } -impl std::ops::Deref for AccountAssets { - type Target = AccountBase; - fn deref(&self) -> &Self::Target { - &self.account_base - } -} -impl std::ops::DerefMut for AccountAssets { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.account_base - } -} \ No newline at end of file diff --git a/src/model/account_balance.rs b/src/model/account_balance.rs index 5b51f86f..31c8ab16 100644 --- a/src/model/account_balance.rs +++ b/src/model/account_balance.rs @@ -35,7 +35,7 @@ When returned by `/accounts/balance/get`, this field may be `null`. When this ha pub iso_currency_code: Option, /**Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the oldest acceptable balance when making a request to `/accounts/balance/get`. -This field is only used and expected when the institution is `ins_128026` (Capital One) and the Item contains one or more accounts with a non-depository account type, in which case a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For Capital One depository accounts as well as all other account types on all other institutions, this field is ignored. See [account type schema](https://en.wikipedia.org/wiki/ISO_8601) for a full list of account types. +This field is only used and expected when the institution is `ins_128026` (Capital One) and the Item contains one or more accounts with a non-depository account type, in which case a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For Capital One depository accounts as well as all other account types on all other institutions, this field is ignored. See [account type schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full list of account types. If the balance that is pulled is older than the given timestamp for Items with this field required, an `INVALID_REQUEST` error with the code of `LAST_UPDATED_DATETIME_OUT_OF_RANGE` will be returned with the most recent timestamp for the requested account contained in the response.*/ #[serde(default, skip_serializing_if = "Option::is_none")] @@ -57,4 +57,4 @@ impl std::fmt::Display for AccountBalance { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/account_base.rs b/src/model/account_base.rs index 0a8b2c82..94cb8546 100644 --- a/src/model/account_base.rs +++ b/src/model/account_base.rs @@ -1,7 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::{AccountBalance, AccountSubtype}; +use super::{ + AccountBalance, AccountHolderCategory, AccountSubtype, AccountType, + AccountVerificationInsights, +}; ///A single account at a financial institution. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AccountBase { /**Plaid’s unique identifier for the account. This value will not change unless Plaid can't reconcile the account with the data returned by the financial institution. This may occur, for example, when the name of the account changes. If this happens a new `account_id` will be assigned to the account. @@ -13,6 +16,9 @@ Like all Plaid identifiers, the `account_id` is case sensitive.*/ pub account_id: String, ///A set of fields describing the balance for an account. Balance information may be cached unless the balance object was returned by `/accounts/balance/get`. pub balances: AccountBalance, + ///Indicates the account's categorization as either a personal or a business account. This field is currently in beta; to request access, contact your account manager. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub holder_category: Option, ///The last 2-4 alphanumeric characters of an account's official account number. Note that the mask may be non-unique between an Item's accounts, and it may also not match the mask that the bank displays to the user. #[serde(default, skip_serializing_if = "Option::is_none")] pub mask: Option, @@ -21,7 +27,7 @@ Like all Plaid identifiers, the `account_id` is case sensitive.*/ ///The official name of the account as given by the financial institution #[serde(default, skip_serializing_if = "Option::is_none")] pub official_name: Option, - ///A unique and persistent identifier for accounts that can be used to trace multiple instances of the same account across different Items for depository accounts. This is currently only supported for Chase Items. + ///A unique and persistent identifier for accounts that can be used to trace multiple instances of the same account across different Items for depository accounts. This field is currently supported only for Items at institutions that use Tokenized Account Numbers (i.e., Chase and PNC). Because these accounts have a different account number each time they are linked, this field may be used instead of the account number to uniquely identify an account across multiple Items for payments use cases, helping to reduce duplicate Items or attempted fraud. In Sandbox, this field may be populated for any account; in Production, it will only be populated for accounts at applicable institutions. #[serde(default, skip_serializing_if = "Option::is_none")] pub persistent_account_id: Option, ///See the [Account type schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes. @@ -39,8 +45,11 @@ Like all Plaid identifiers, the `account_id` is case sensitive.*/ See the [Account type schema](https://plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.*/ #[serde(rename = "type")] - pub type_: String, - /**The current verification status of an Auth Item initiated through Automated or Manual micro-deposits. Returned for Auth Items only. + pub type_: AccountType, + ///Insights from performing database verification for the account. Only returned for Auth Items created via Database Insights. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub verification_insights: Option, + /**The current verification status of an Auth Item initiated through micro-deposits or database verification. Returned for Auth Items only. `pending_automatic_verification`: The Item is pending automatic verification @@ -54,7 +63,13 @@ See the [Account type schema](https://plaid.com/docs/api/accounts#account-type-s `verification_failed`: The Item failed manual micro-deposit verification because the user exhausted all 3 verification attempts. Users may retry by submitting their information again through Link. -`database_matched`: The Item has successfully been verified using Plaid's data sources. Note: Database Match is currently a beta feature, please contact your account manager for more information.*/ +`database_matched`: The Item has successfully been verified using Plaid's data sources. Only returned for Auth Items created via Database Match. + +`database_insights_pass`: The Item's numbers have been verified using Plaid's data sources and have strong signal for being valid. Only returned for Auth Items created via Database Insights. Note: Database Insights is currently a beta feature, please contact your account manager for more information. + +`database_insights_pass_with_caution`: The Item's numbers have been verified using Plaid's data sources and have some signal for being valid. Only returned for Auth Items created via Database Insights. Note: Database Insights is currently a beta feature, please contact your account manager for more information. + +`database_insights_fail`: The Item's numbers have been verified using Plaid's data sources and have signal for being invalid and/or have no signal for being valid. Only returned for Auth Items created via Database Insights. Note: Database Insights is currently a beta feature, please contact your account manager for more information.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub verification_status: Option, } @@ -62,4 +77,4 @@ impl std::fmt::Display for AccountBase { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/account_filters_response.rs b/src/model/account_filters_response.rs index 1a4a34f5..0c34a296 100644 --- a/src/model/account_filters_response.rs +++ b/src/model/account_filters_response.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for AccountFiltersResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/account_holder_category.rs b/src/model/account_holder_category.rs new file mode 100644 index 00000000..ca0690d0 --- /dev/null +++ b/src/model/account_holder_category.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Indicates the account's categorization as either a personal or a business account. This field is currently in beta; to request access, contact your account manager. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AccountHolderCategory { + #[serde(rename = "business")] + Business, + #[serde(rename = "personal")] + Personal, + #[serde(rename = "unrecognized")] + Unrecognized, +} diff --git a/src/model/account_identity.rs b/src/model/account_identity.rs index 18cd371b..bc4df2b0 100644 --- a/src/model/account_identity.rs +++ b/src/model/account_identity.rs @@ -1,14 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::{AccountBase, IdentityDocument, Owner}; +use super::{AccountBase, Owner}; ///Identity information about an account -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AccountIdentity { ///A single account at a financial institution. #[serde(flatten)] pub account_base: AccountBase, - ///Array of documents that identity data is dervied from. This array will be empty if none of the account identity is from a document. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub documents: Option>, ///Data returned by the financial institution about the account owner or owners. Only returned by Identity or Assets endpoints. For business accounts, the name reported may be either the name of the individual or the name of the business, depending on the institution; detecting whether the linked account is a business account is not currently supported. Multiple owners on a single account will be represented in the same `owner` object, not in multiple owner objects within the array. In API versions 2018-05-22 and earlier, the `owners` object is not returned, and instead identity information is returned in the top level `identity` object. For more details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2019-05-29) #[serde(default, skip_serializing_if = "Vec::is_empty")] pub owners: Vec, @@ -28,4 +25,4 @@ impl std::ops::DerefMut for AccountIdentity { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.account_base } -} \ No newline at end of file +} diff --git a/src/model/account_identity_document_upload.rs b/src/model/account_identity_document_upload.rs new file mode 100644 index 00000000..30161bdf --- /dev/null +++ b/src/model/account_identity_document_upload.rs @@ -0,0 +1,31 @@ +use serde::{Serialize, Deserialize}; +use super::{AccountBase, IdentityDocumentUpload, Owner}; +///Identity information about an account +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AccountIdentityDocumentUpload { + ///A single account at a financial institution. + #[serde(flatten)] + pub account_base: AccountBase, + ///Data about the documents that were uploaded as proof of account ownership. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub documents: Option>, + ///Data returned by the financial institution about the account owner or owners. Only returned by Identity or Assets endpoints. For business accounts, the name reported may be either the name of the individual or the name of the business, depending on the institution; detecting whether the linked account is a business account is not currently supported. Multiple owners on a single account will be represented in the same `owner` object, not in multiple owner objects within the array. In API versions 2018-05-22 and earlier, the `owners` object is not returned, and instead identity information is returned in the top level `identity` object. For more details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2019-05-29) + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub owners: Vec, +} +impl std::fmt::Display for AccountIdentityDocumentUpload { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} +impl std::ops::Deref for AccountIdentityDocumentUpload { + type Target = AccountBase; + fn deref(&self) -> &Self::Target { + &self.account_base + } +} +impl std::ops::DerefMut for AccountIdentityDocumentUpload { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.account_base + } +} diff --git a/src/model/account_identity_match_score.rs b/src/model/account_identity_match_score.rs index e9e05dc9..f52c6de6 100644 --- a/src/model/account_identity_match_score.rs +++ b/src/model/account_identity_match_score.rs @@ -4,7 +4,7 @@ use super::{ PhoneNumberMatchScore, }; ///Identity match scores for an account -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AccountIdentityMatchScore { ///A single account at a financial institution. #[serde(flatten)] @@ -37,4 +37,4 @@ impl std::ops::DerefMut for AccountIdentityMatchScore { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.account_base } -} \ No newline at end of file +} diff --git a/src/model/account_ids_with_updated_auth.rs b/src/model/account_ids_with_updated_auth.rs new file mode 100644 index 00000000..505770a1 --- /dev/null +++ b/src/model/account_ids_with_updated_auth.rs @@ -0,0 +1,3 @@ +use serde::{Serialize, Deserialize}; +use super::AuthUpdateTypes; +pub type AccountIdsWithUpdatedAuth = Vec; diff --git a/src/model/account_ids_with_updated_identity.rs b/src/model/account_ids_with_updated_identity.rs index b10ddf05..70e3220f 100644 --- a/src/model/account_ids_with_updated_identity.rs +++ b/src/model/account_ids_with_updated_identity.rs @@ -1,11 +1,3 @@ use serde::{Serialize, Deserialize}; -/**An object with keys of `account_id`'s that are mapped to their respective identity attributes that changed. - -Example: `{ "XMBvvyMGQ1UoLbKByoMqH3nXMj84ALSdE5B58": ["PHONES"] }`*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct AccountIdsWithUpdatedIdentity {} -impl std::fmt::Display for AccountIdsWithUpdatedIdentity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +use super::IdentityUpdateTypes; +pub type AccountIdsWithUpdatedIdentity = Vec; diff --git a/src/model/account_product_access.rs b/src/model/account_product_access.rs index 067a2470..6539dac5 100644 --- a/src/model/account_product_access.rs +++ b/src/model/account_product_access.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for AccountProductAccess { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/account_subtype.rs b/src/model/account_subtype.rs index 5060a521..0d1aafcf 100644 --- a/src/model/account_subtype.rs +++ b/src/model/account_subtype.rs @@ -1,3 +1,145 @@ use serde::{Serialize, Deserialize}; -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct AccountSubtype(pub serde_json::Value); \ No newline at end of file +///See the [Account type schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AccountSubtype { + #[serde(rename = "401a")] + AccountSubtype401A, + #[serde(rename = "401k")] + AccountSubtype401K, + #[serde(rename = "403B")] + AccountSubtype403B, + #[serde(rename = "457b")] + AccountSubtype457B, + #[serde(rename = "529")] + AccountSubtype529, + #[serde(rename = "auto")] + Auto, + #[serde(rename = "brokerage")] + Brokerage, + #[serde(rename = "business")] + Business, + #[serde(rename = "cash isa")] + CashIsa, + #[serde(rename = "cash management")] + CashManagement, + #[serde(rename = "cd")] + Cd, + #[serde(rename = "checking")] + Checking, + #[serde(rename = "commercial")] + Commercial, + #[serde(rename = "construction")] + Construction, + #[serde(rename = "consumer")] + Consumer, + #[serde(rename = "credit card")] + CreditCard, + #[serde(rename = "crypto exchange")] + CryptoExchange, + #[serde(rename = "ebt")] + Ebt, + #[serde(rename = "education savings account")] + EducationSavingsAccount, + #[serde(rename = "fixed annuity")] + FixedAnnuity, + #[serde(rename = "gic")] + Gic, + #[serde(rename = "health reimbursement arrangement")] + HealthReimbursementArrangement, + #[serde(rename = "home equity")] + HomeEquity, + #[serde(rename = "hsa")] + Hsa, + #[serde(rename = "isa")] + Isa, + #[serde(rename = "ira")] + Ira, + #[serde(rename = "keogh")] + Keogh, + #[serde(rename = "lif")] + Lif, + #[serde(rename = "life insurance")] + LifeInsurance, + #[serde(rename = "line of credit")] + LineOfCredit, + #[serde(rename = "lira")] + Lira, + #[serde(rename = "loan")] + Loan, + #[serde(rename = "lrif")] + Lrif, + #[serde(rename = "lrsp")] + Lrsp, + #[serde(rename = "money market")] + MoneyMarket, + #[serde(rename = "mortgage")] + Mortgage, + #[serde(rename = "mutual fund")] + MutualFund, + #[serde(rename = "non-custodial wallet")] + NonCustodialWallet, + #[serde(rename = "non-taxable brokerage account")] + NonTaxableBrokerageAccount, + #[serde(rename = "other")] + Other, + #[serde(rename = "other insurance")] + OtherInsurance, + #[serde(rename = "other annuity")] + OtherAnnuity, + #[serde(rename = "overdraft")] + Overdraft, + #[serde(rename = "paypal")] + Paypal, + #[serde(rename = "payroll")] + Payroll, + #[serde(rename = "pension")] + Pension, + #[serde(rename = "prepaid")] + Prepaid, + #[serde(rename = "prif")] + Prif, + #[serde(rename = "profit sharing plan")] + ProfitSharingPlan, + #[serde(rename = "rdsp")] + Rdsp, + #[serde(rename = "resp")] + Resp, + #[serde(rename = "retirement")] + Retirement, + #[serde(rename = "rlif")] + Rlif, + #[serde(rename = "roth")] + Roth, + #[serde(rename = "roth 401k")] + Roth401K, + #[serde(rename = "rrif")] + Rrif, + #[serde(rename = "rrsp")] + Rrsp, + #[serde(rename = "sarsep")] + Sarsep, + #[serde(rename = "savings")] + Savings, + #[serde(rename = "sep ira")] + SepIra, + #[serde(rename = "simple ira")] + SimpleIra, + #[serde(rename = "sipp")] + Sipp, + #[serde(rename = "stock plan")] + StockPlan, + #[serde(rename = "student")] + Student, + #[serde(rename = "thrift savings plan")] + ThriftSavingsPlan, + #[serde(rename = "tfsa")] + Tfsa, + #[serde(rename = "trust")] + Trust, + #[serde(rename = "ugma")] + Ugma, + #[serde(rename = "utma")] + Utma, + #[serde(rename = "variable annuity")] + VariableAnnuity, +} diff --git a/src/model/account_type.rs b/src/model/account_type.rs new file mode 100644 index 00000000..5263428d --- /dev/null +++ b/src/model/account_type.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +/**`investment:` Investment account. In API versions 2018-05-22 and earlier, this type is called `brokerage` instead. + +`credit:` Credit card + +`depository:` Depository account + +`loan:` Loan account + +`other:` Non-specified account type + +See the [Account type schema](https://plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AccountType { + #[serde(rename = "investment")] + Investment, + #[serde(rename = "credit")] + Credit, + #[serde(rename = "depository")] + Depository, + #[serde(rename = "loan")] + Loan, + #[serde(rename = "brokerage")] + Brokerage, + #[serde(rename = "other")] + Other, +} diff --git a/src/model/account_verification_insights.rs b/src/model/account_verification_insights.rs new file mode 100644 index 00000000..eed0596b --- /dev/null +++ b/src/model/account_verification_insights.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +use super::{ + AccountVerificationInsightsAccountNumberFormat, + AccountVerificationInsightsNetworkStatus, AccountVerificationInsightsPreviousReturns, +}; +///Insights from performing database verification for the account. Only returned for Auth Items created via Database Insights. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AccountVerificationInsights { + /**Indicator of account number format validity for institution. + +`valid`: indicates that the account number has a correct format for the institution. + +`invalid`: indicates that the account number has an incorrect format for the institution. + +`unknown`: indicates that there was not enough information to determine whether the format is correct for the institution.*/ + pub account_number_format: AccountVerificationInsightsAccountNumberFormat, + ///Status information about the account and routing number in the Plaid network. + pub network_status: AccountVerificationInsightsNetworkStatus, + ///Information about known ACH returns for the account and routing number. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub previous_returns: Option, +} +impl std::fmt::Display for AccountVerificationInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/account_verification_insights_account_number_format.rs b/src/model/account_verification_insights_account_number_format.rs new file mode 100644 index 00000000..3ca1a2fd --- /dev/null +++ b/src/model/account_verification_insights_account_number_format.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**Indicator of account number format validity for institution. + +`valid`: indicates that the account number has a correct format for the institution. + +`invalid`: indicates that the account number has an incorrect format for the institution. + +`unknown`: indicates that there was not enough information to determine whether the format is correct for the institution.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AccountVerificationInsightsAccountNumberFormat { + #[serde(rename = "valid")] + Valid, + #[serde(rename = "invalid")] + Invalid, + #[serde(rename = "unknown")] + Unknown, +} diff --git a/src/model/account_verification_insights_network_status.rs b/src/model/account_verification_insights_network_status.rs new file mode 100644 index 00000000..ae279cf0 --- /dev/null +++ b/src/model/account_verification_insights_network_status.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///Status information about the account and routing number in the Plaid network. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct AccountVerificationInsightsNetworkStatus { + ///Indicates whether we found at least one matching account for the ACH account and routing number. + pub has_numbers_match: bool, + ///Indicates if at least one matching account for the ACH account and routing number is already verified. + pub is_numbers_match_verified: bool, +} +impl std::fmt::Display for AccountVerificationInsightsNetworkStatus { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/account_verification_insights_previous_returns.rs b/src/model/account_verification_insights_previous_returns.rs new file mode 100644 index 00000000..783658da --- /dev/null +++ b/src/model/account_verification_insights_previous_returns.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///Information about known ACH returns for the account and routing number. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct AccountVerificationInsightsPreviousReturns { + ///Indicates whether Plaid's data sources include a known administrative ACH return for account and routing number. + pub has_previous_administrative_return: bool, +} +impl std::fmt::Display for AccountVerificationInsightsPreviousReturns { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/accounts_balance_get_request_options.rs b/src/model/accounts_balance_get_request_options.rs index 50f235f8..d15bd964 100644 --- a/src/model/accounts_balance_get_request_options.rs +++ b/src/model/accounts_balance_get_request_options.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///An optional object to filter `/accounts/balance/get` results. +///Optional parameters to `/accounts/balance/get`. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct AccountsBalanceGetRequestOptions { /**A list of `account_ids` to retrieve for the Item. The default value is `null`. @@ -9,9 +9,9 @@ Note: An error will be returned if a provided `account_id` is not associated wit pub account_ids: Option>, /**Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the oldest acceptable balance when making a request to `/accounts/balance/get`. -If the balance that is pulled for `ins_128026` (Capital One) is older than the given timestamp, an `INVALID_REQUEST` error with the code of `LAST_UPDATED_DATETIME_OUT_OF_RANGE` will be returned with the most recent timestamp for the requested account contained in the response. +This field is only necessary when the institution is `ins_128026` (Capital One), *and* one or more account types being requested is a non-depository account (such as a credit card) as Capital One does not provide real-time balance for non-depository accounts. In this case, a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For all other institutions, as well as for depository accounts at Capital One (including all checking and savings accounts) this field is ignored and real-time balance information will be fetched. -This field is only used when the institution is `ins_128026` (Capital One), in which case a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For all other institutions, this field is ignored.*/ +If this field is not ignored, and no acceptable balance is available, an `INVALID_RESULT` error with the code `LAST_UPDATED_DATETIME_OUT_OF_RANGE` will be returned.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub min_last_updated_datetime: Option>, } @@ -19,4 +19,4 @@ impl std::fmt::Display for AccountsBalanceGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/accounts_balance_get_request_payment_details.rs b/src/model/accounts_balance_get_request_payment_details.rs index 871a288c..8fefd21e 100644 --- a/src/model/accounts_balance_get_request_payment_details.rs +++ b/src/model/accounts_balance_get_request_payment_details.rs @@ -1,24 +1,28 @@ use serde::{Serialize, Deserialize}; -///An optional object containing payment details. If set, a payment risk assessment is performed and returned as AccountsBalanceGetResponsePaymentRiskAssessment. +///To enable Balance Plus (beta), send this object as part of the `/accounts/balance/get` request. Only available to customers participating in the Balance Plus beta program; to enroll in the beta, contact your account manager. If this object is present in the request, the [`payment_risk_assessment`](https://plaid.com/docs/balance/balance-plus/#accounts-balance-get-response-payment-risk-assessment-risk-level) object will be present in the response. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct AccountsBalanceGetRequestPaymentDetails { /**The Plaid `account_id` of the account that is the funding source for the proposed transaction. The `account_id` is returned in the `/accounts/get` endpoint as well as the [`onSuccess`](/docs/link/ios/#link-ios-onsuccess-linkSuccess-metadata-accounts-id) callback metadata. This will return an [`INVALID_ACCOUNT_ID`](/docs/errors/invalid-input/#invalid_account_id) error if the account has been removed at the bank or if the `account_id` is no longer valid.*/ - #[serde(default, skip_serializing_if = "Option::is_none")] - pub account_id: Option, + pub account_id: String, ///The transaction amount, in USD (e.g. `102.05`) - #[serde(default, skip_serializing_if = "Option::is_none")] - pub amount: Option, - ///The threshold percentage of the account balance used for comparison with the requested ACH debit amount. + pub amount: f64, + /**If the `amount` multiplied by the `balance_threshold_percentage` (as a percentage) exceeds the balance in the account, then [`payment_risk_assessment.exceeds_balance_threshold`](https://plaid.com/docs/balance/balance-plus/#accounts-balance-get-response-payment-risk-assessment-exceeds-balance-threshold) in the response will be true, otherwise, it will be false. For example, if the `amount` is 200 and the `balance_threshold_percentage` is 90, then the account balance must be at least 180 for `exceeds_balance_threshold` to be false. + +By default, the available balance will be used for this calculation; if it cannot be obtained, the current balance will be used. + +This field is particularly useful for customers using indirect Items and who do not have direct access to raw balance data.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub balance_threshold_percentage: Option, - ///The unique ID that you would like to use to refer to this transaction. For your convenience mapping your internal data, you could use your internal identifier for this transaction. The max length for this field is 36 characters. + ///The unique ID that you would like to use to refer to this transaction. For your convenience mapping your internal data, you could use your internal identifier for this transaction. + pub client_transaction_id: String, + ///A boolean that determines whether the balance has to be refreshed in real time as part of the API call when using Balance Plus. Setting this to field to `true` will result in more recent balances, but latency may be up to 30 seconds or more. If making a regular (non-Balance Plus) Balance call, without the `payment_details` object present, `/accounts/balance/get` will always return real-time balances. #[serde(default, skip_serializing_if = "Option::is_none")] - pub client_transaction_id: Option, + pub requires_real_time_balance_refresh: Option, } impl std::fmt::Display for AccountsBalanceGetRequestPaymentDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/accounts_balance_get_response_payment_risk_assessment.rs b/src/model/accounts_balance_get_response_payment_risk_assessment.rs index ef93fccd..5d7f5899 100644 --- a/src/model/accounts_balance_get_response_payment_risk_assessment.rs +++ b/src/model/accounts_balance_get_response_payment_risk_assessment.rs @@ -1,16 +1,44 @@ use serde::{Serialize, Deserialize}; -///This object provides detailed risk assessment for the requested transaction -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::{BalancePlusAttributes, BalancePlusRiskLevel, RiskReason}; +///Provides a detailed risk assessment for the requested transaction. For this field to be returned, the client must be enrolled in the Balance Plus beta program and the [`payment_details`](http://plaid.com/docs/balance/balance-plus/#accounts-balance-get-request-payment-details) object must have been sent in the request. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AccountsBalanceGetResponsePaymentRiskAssessment { - ///Indicates whether the requested ACH debit amount is greater than the threshold (set by customers) of the available or current balance. + ///Contains additional data that can be used to assess the ACH return risk + pub attributes: BalancePlusAttributes, + ///Timestamp of the last successful balance update, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. + pub balance_last_updated: chrono::DateTime, + /**Whether the proposed transaction exceeds the balance threshold set in the request. `true` indicates higher risk; `false` indicates lower risk. If the `amount` multiplied by the `balance_threshold_percentage` (as a percentage) exceeds the balance in the account, then `exceeds_balance_threshold` will be true, otherwise, it will be false. For example, if the `amount` is 200 and the `balance_threshold_percentage` is 90, then the account balance must be at least 180 for `exceeds_balance_threshold` to be false. + +By default, the available balance will be used for this calculation; if it cannot be obtained, the current balance will be used. + +This field is particularly useful for customers using indirect Items and who do not have direct access to raw balance data.*/ + pub exceeds_balance_threshold: bool, + /**A five-tier risk assessment for the transaction, based on the probability distribution of ACH returns, measured by the incident rate. + +Each tier corresponds to a distribution with a different mean (average) probability. + +`HIGH`: The mean probability of ACH return risk is above 40%. +`MEDIUM_HIGH`: The mean probability of ACH return risk is 15%-40%. +`MEDIUM`: The mean probability of ACH return risk is 5-10%. +`MEDIUM_LOW`: The mean probability of ACH return risk is 1%-2%. +`LOW`: The mean probability of ACH return risk is below 1%. + +Note that these tiers correspond to probability *distributions* and not to discrete probabilities. + +These tier definitions are specific to Balance Plus and do not apply to risk tiers generated by other Plaid endpoints.*/ + pub risk_level: BalancePlusRiskLevel, + ///An array of objects, each representing a specific reason contributing to the risk assessment of an ACH transaction. This field is only supplied for transactions classified as `HIGH`, `MEDIUM-HIGH`, or `MEDIUM` risk. #[serde(default, skip_serializing_if = "Option::is_none")] - pub exceeds_balance_threshold: Option, - ///A five-tier risk assessment for the transaction based on the probability of return. + pub risk_reasons: Option>, + /**A risk score ranging from 1-99, reflecting the likelihood of ACH debit return. +A higher score indicates a greater risk of return, often due to overdrawn accounts or account +ineligibility to receive ACH transactions. Typical return codes include "R01", "R02", "R03", +"R04", "R06", "R08", "R09", "R13", "R16", "R17", "R20", "R23", etc., with a turnaround of 2 banking days.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub risk_level: Option, + pub score: Option, } impl std::fmt::Display for AccountsBalanceGetResponsePaymentRiskAssessment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/accounts_get_request_options.rs b/src/model/accounts_get_request_options.rs index 97bad214..ffae9e3e 100644 --- a/src/model/accounts_get_request_options.rs +++ b/src/model/accounts_get_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for AccountsGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/accounts_get_response.rs b/src/model/accounts_get_response.rs index 287bfc00..a3884913 100644 --- a/src/model/accounts_get_response.rs +++ b/src/model/accounts_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountBase, AccountsBalanceGetResponsePaymentRiskAssessment, Item}; ///AccountsGetResponse defines the response schema for `/accounts/get` and `/accounts/balance/get`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AccountsGetResponse { /**An array of financial institution accounts associated with the Item. If `/accounts/balance/get` was called, each account will include real-time balance information.*/ @@ -9,7 +9,7 @@ If `/accounts/balance/get` was called, each account will include real-time balan pub accounts: Vec, ///Metadata about the Item. pub item: Item, - ///This object provides detailed risk assessment for the requested transaction + ///Provides a detailed risk assessment for the requested transaction. For this field to be returned, the client must be enrolled in the Balance Plus beta program and the [`payment_details`](http://plaid.com/docs/balance/balance-plus/#accounts-balance-get-request-payment-details) object must have been sent in the request. #[serde(default, skip_serializing_if = "Option::is_none")] pub payment_risk_assessment: Option, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -19,4 +19,4 @@ impl std::fmt::Display for AccountsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/ach_class.rs b/src/model/ach_class.rs new file mode 100644 index 00000000..d410271c --- /dev/null +++ b/src/model/ach_class.rs @@ -0,0 +1,24 @@ +use serde::{Serialize, Deserialize}; +/**Specifies the use case of the transfer. Required for transfers on an ACH network. For more details, see [ACH SEC codes](https://plaid.com/docs/transfer/creating-transfers/#ach-sec-codes). + +Codes supported for credits: `ccd`, `ppd` +Codes supported for debits: `ccd`, `tel`, `web` + +`"ccd"` - Corporate Credit or Debit - fund transfer between two corporate bank accounts + +`"ppd"` - Prearranged Payment or Deposit - the transfer is part of a pre-existing relationship with a consumer, e.g. bill payment + +`"tel"` - Telephone-Initiated Entry + +`"web"` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AchClass { + #[serde(rename = "ccd")] + Ccd, + #[serde(rename = "ppd")] + Ppd, + #[serde(rename = "tel")] + Tel, + #[serde(rename = "web")] + Web, +} diff --git a/src/model/action_state.rs b/src/model/action_state.rs new file mode 100644 index 00000000..9a6035b8 --- /dev/null +++ b/src/model/action_state.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///Enum representing the state of the action/activity. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ActionState { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "ATTEMPT")] + Attempt, + #[serde(rename = "SUCCESS")] + Success, + #[serde(rename = "FAILURE")] + Failure, + #[serde(rename = "SKIPPED")] + Skipped, +} diff --git a/src/model/activity.rs b/src/model/activity.rs index ee04df8c..b0c5a993 100644 --- a/src/model/activity.rs +++ b/src/model/activity.rs @@ -1,10 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::Scopes; +use super::{ActionState, ActivityType, ItemCreateAuthentication, Scopes}; ///Describes a consent activity. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Activity { ///Types of consent activities - pub activity: String, + pub activity: ActivityType, + ///Enum representing the entity authenticating the user. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authentication: Option, ///A unique identifier for the activity pub id: String, ///The date this activity was initiated [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC. @@ -15,7 +18,7 @@ pub struct Activity { #[serde(default, skip_serializing_if = "Option::is_none")] pub scopes: Option, ///Enum representing the state of the action/activity. - pub state: String, + pub state: ActionState, ///This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect. #[serde(default, skip_serializing_if = "Option::is_none")] pub target_application_id: Option, @@ -24,4 +27,4 @@ impl std::fmt::Display for Activity { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/activity_type.rs b/src/model/activity_type.rs new file mode 100644 index 00000000..ac1bbcc4 --- /dev/null +++ b/src/model/activity_type.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +///Types of consent activities +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ActivityType { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "ITEM_CREATE")] + ItemCreate, + #[serde(rename = "ITEM_IMPORT")] + ItemImport, + #[serde(rename = "ITEM_UPDATE")] + ItemUpdate, + #[serde(rename = "ITEM_UNLINK")] + ItemUnlink, + #[serde(rename = "PORTAL_UNLINK")] + PortalUnlink, + #[serde(rename = "PORTAL_ITEMS_DELETE")] + PortalItemsDelete, + #[serde(rename = "ITEM_REMOVE")] + ItemRemove, + #[serde(rename = "INVARIANT_CHECKER_DELETION")] + InvariantCheckerDeletion, + #[serde(rename = "SCOPES_UPDATE")] + ScopesUpdate, +} diff --git a/src/model/address.rs b/src/model/address.rs index 1ad2b0dc..797607ea 100644 --- a/src/model/address.rs +++ b/src/model/address.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for Address { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/address_data.rs b/src/model/address_data.rs index 9430c93d..72fee342 100644 --- a/src/model/address_data.rs +++ b/src/model/address_data.rs @@ -23,4 +23,4 @@ impl std::fmt::Display for AddressData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/address_data_not_required.rs b/src/model/address_data_not_required.rs index 718f733d..2a031964 100644 --- a/src/model/address_data_not_required.rs +++ b/src/model/address_data_not_required.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for AddressDataNotRequired { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/address_match_score.rs b/src/model/address_match_score.rs index d376b6ad..9143befe 100644 --- a/src/model/address_match_score.rs +++ b/src/model/address_match_score.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for AddressMatchScore { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/address_purpose_label.rs b/src/model/address_purpose_label.rs new file mode 100644 index 00000000..999c940a --- /dev/null +++ b/src/model/address_purpose_label.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**Field describing whether the associated address is being used for commercial or residential purposes. + +Note: This value will be `no_data` when Plaid does not have sufficient data to determine the address's use.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AddressPurposeLabel { + #[serde(rename = "residential")] + Residential, + #[serde(rename = "commercial")] + Commercial, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/application.rs b/src/model/application.rs index 2436da93..04499a3a 100644 --- a/src/model/application.rs +++ b/src/model/application.rs @@ -43,4 +43,4 @@ impl std::fmt::Display for Application { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/application_get_response.rs b/src/model/application_get_response.rs index 3b126578..e47c2ecb 100644 --- a/src/model/application_get_response.rs +++ b/src/model/application_get_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for ApplicationGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/apr.rs b/src/model/apr.rs index b7f2c5e7..e598927e 100644 --- a/src/model/apr.rs +++ b/src/model/apr.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for Apr { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset.rs b/src/model/asset.rs index 8a014d4d..dc164fa9 100644 --- a/src/model/asset.rs +++ b/src/model/asset.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AssetDetail, AssetHolder, AssetOwners, AssetTransactions, ValidationSources}; ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Asset { ///Details about an asset. #[serde(rename = "ASSET_DETAIL")] @@ -23,4 +23,4 @@ impl std::fmt::Display for Asset { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_detail.rs b/src/model/asset_detail.rs index 8acf97c9..1501f6c0 100644 --- a/src/model/asset_detail.rs +++ b/src/model/asset_detail.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::AssetType; ///Details about an asset. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AssetDetail { ///A unique alphanumeric string identifying an asset. #[serde(rename = "AssetAccountIdentifier")] @@ -27,7 +28,7 @@ pub struct AssetDetail { pub asset_ownership_type: Option, ///A value from a MISMO prescribed list that specifies financial assets in a mortgage loan transaction. Assets may be either liquid or fixed and are associated with a corresponding asset amount. #[serde(rename = "AssetType")] - pub asset_type: String, + pub asset_type: AssetType, ///Additional Asset Decription some examples are Investment Tax-Deferred , Loan, 401K, 403B, Checking, Money Market, Credit Card,ROTH,529,Biller,ROLLOVER,CD,Savings,Investment Taxable, IRA, Mortgage, Line Of Credit. #[serde(rename = "AssetTypeAdditionalDescription")] #[serde(default, skip_serializing_if = "Option::is_none")] @@ -40,4 +41,4 @@ impl std::fmt::Display for AssetDetail { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_holder.rs b/src/model/asset_holder.rs index 9f2ad3b8..94d14abd 100644 --- a/src/model/asset_holder.rs +++ b/src/model/asset_holder.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for AssetHolder { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_holder_name.rs b/src/model/asset_holder_name.rs index 9274f6b3..66ff6720 100644 --- a/src/model/asset_holder_name.rs +++ b/src/model/asset_holder_name.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for AssetHolderName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_owner.rs b/src/model/asset_owner.rs index 9981517f..f2b04a1f 100644 --- a/src/model/asset_owner.rs +++ b/src/model/asset_owner.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for AssetOwner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_owners.rs b/src/model/asset_owners.rs index 6fbd6178..173074e8 100644 --- a/src/model/asset_owners.rs +++ b/src/model/asset_owners.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for AssetOwners { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report.rs b/src/model/asset_report.rs index 320b95aa..593885e9 100644 --- a/src/model/asset_report.rs +++ b/src/model/asset_report.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for AssetReport { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_account_balance.rs b/src/model/asset_report_account_balance.rs new file mode 100644 index 00000000..3ccadb21 --- /dev/null +++ b/src/model/asset_report_account_balance.rs @@ -0,0 +1,65 @@ +use serde::{Serialize, Deserialize}; +///A set of fields describing the balance for an account. Balance information may be cached unless the balance object was returned by `/accounts/balance/get`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct AssetReportAccountBalance { + /**The amount of funds available to be withdrawn from the account, as determined by the financial institution. + +For `credit`-type accounts, the `available` balance typically equals the `limit` less the `current` balance, less any pending outflows plus any pending inflows. + +For `depository`-type accounts, the `available` balance typically equals the `current` balance less any pending outflows plus any pending inflows. For `depository`-type accounts, the `available` balance does not include the overdraft limit. + +For `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the `available` balance is the total cash available to withdraw as presented by the institution. + +Note that not all institutions calculate the `available` balance. In the event that `available` balance is unavailable, Plaid will return an `available` balance value of `null`. + +Available balance may be cached and is not guaranteed to be up-to-date in realtime unless the value was returned by `/accounts/balance/get`. + +If `current` is `null` this field is guaranteed not to be `null`.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available: Option, + /**The total amount of funds in or owed by the account. + +For `credit`-type accounts, a positive balance indicates the amount owed; a negative amount indicates the lender owing the account holder. + +For `loan`-type accounts, the current balance is the principal remaining on the loan, except in the case of student loan accounts at Sallie Mae (`ins_116944`). For Sallie Mae student loans, the account's balance includes both principal and any outstanding interest. + +For `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the current balance is the total value of assets as presented by the institution. + +Note that balance information may be cached unless the value was returned by `/accounts/balance/get`; if the Item is enabled for Transactions, the balance will be at least as recent as the most recent Transaction update. If you require realtime balance information, use the `available` balance as provided by `/accounts/balance/get`. + +When returned by `/accounts/balance/get`, this field may be `null`. When this happens, `available` is guaranteed not to be `null`.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current: Option, + ///The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the oldest acceptable balance when making a request to `/accounts/balance/get`. + +This field is only used and expected when the institution is `ins_128026` (Capital One) and the Item contains one or more accounts with a non-depository account type, in which case a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For Capital One depository accounts as well as all other account types on all other institutions, this field is ignored. See [account type schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full list of account types. + +If the balance that is pulled is older than the given timestamp for Items with this field required, an `INVALID_REQUEST` error with the code of `LAST_UPDATED_DATETIME_OUT_OF_RANGE` will be returned with the most recent timestamp for the requested account contained in the response.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_updated_datetime: Option>, + /**For `credit`-type accounts, this represents the credit limit. + +For `depository`-type accounts, this represents the pre-arranged overdraft limit, which is common for current (checking) accounts in Europe. + +In North America, this field is typically only available for `credit`-type accounts.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + /**The total amount of borrowed funds in the account, as determined by the financial institution. +For investment-type accounts, the margin balance is the total value of borrowed assets in the account, as presented by the institution. +This is commonly referred to as margin or a loan.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub margin_loan_amount: Option, + /**The unofficial currency code associated with the balance. Always null if `iso_currency_code` is non-null. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. + +See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for AssetReportAccountBalance { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/asset_report_add_ons.rs b/src/model/asset_report_add_ons.rs new file mode 100644 index 00000000..ba5fb140 --- /dev/null +++ b/src/model/asset_report_add_ons.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**A list of add-ons that should be included in the Asset Report. + +`fast_assets`: When Fast Assets is requested, Plaid will create two versions of the Asset Report: the Fast Asset Report, which will contain only Identity and Balance information, and the Full Asset Report, which will also contain Transactions information. A `PRODUCT_READY` webhook will be fired for each Asset Report when it is ready, and the `report_type` field will indicate whether the webhook is firing for the `full` or `fast` Asset Report. To retrieve the Fast Asset Report, call `/asset_report/get` with `fast_report` set to `true`. There is no additional charge for using Fast Assets. To create a Fast Asset Report, Plaid must successfully retrieve both Identity and Balance data; if Plaid encounters an error obtaining this data, the Fast Asset Report will not be created. However, as long as Plaid can obtain Transactions data, the Full Asset Report will still be available. + +`investments`: Request an Asset Report with Investments. This add-on is in closed beta and not generally available.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AssetReportAddOns { + #[serde(rename = "investments")] + Investments, + #[serde(rename = "fast_assets")] + FastAssets, +} diff --git a/src/model/asset_report_audit_copy_create_response.rs b/src/model/asset_report_audit_copy_create_response.rs index 4bf46b8f..be122b44 100644 --- a/src/model/asset_report_audit_copy_create_response.rs +++ b/src/model/asset_report_audit_copy_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for AssetReportAuditCopyCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_audit_copy_remove_response.rs b/src/model/asset_report_audit_copy_remove_response.rs index 6821de91..e3e265ec 100644 --- a/src/model/asset_report_audit_copy_remove_response.rs +++ b/src/model/asset_report_audit_copy_remove_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for AssetReportAuditCopyRemoveResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_create_request_options.rs b/src/model/asset_report_create_request_options.rs index c52d5f69..dc3487f2 100644 --- a/src/model/asset_report_create_request_options.rs +++ b/src/model/asset_report_create_request_options.rs @@ -1,11 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::AssetReportUser; +use super::{AssetReportAddOns, AssetReportUser}; ///An optional object to filter `/asset_report/create` results. If provided, must be non-`null`. The optional `user` object is required for the report to be eligible for Fannie Mae's Day 1 Certainty program. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct AssetReportCreateRequestOptions { - ///Use this field to request a `fast_asset` report. When Fast Assets is requested, Plaid will create two versions of the Asset Report: first, the Fast Asset Report, which will contain only current identity and balance information, and later, the Full Asset Report, which will also contain historical balance information and transaction data. A `PRODUCT_READY` webhook will be fired for each Asset Report when it is ready, and the `report_type` field will indicate whether the webhook is firing for the `full` or `fast` Asset Report. To retrieve the Fast Asset Report, call `/asset_report/get` with `fast_report` set to `true`. There is no additional charge for using Fast Assets. + ///This field can be used to add additional options for the Asset Report. To fetch `investments` data (transactions, holdings, etc.) in the Asset Report, `investments` must be specified in `add_ons`. For Fast Assets, `fast_assets` must be specified in `add_ons`. #[serde(default, skip_serializing_if = "Option::is_none")] - pub add_ons: Option>, + pub add_ons: Option>, ///Client-generated identifier, which can be used by lenders to track loan applications. #[serde(default, skip_serializing_if = "Option::is_none")] pub client_report_id: Option, @@ -15,6 +15,9 @@ pub struct AssetReportCreateRequestOptions { ///Additional information that can be included in the asset report. Possible values: `"investments"` #[serde(default, skip_serializing_if = "Option::is_none")] pub products: Option>, + ///If set to false, only 1 item must be healthy at the time of report creation. The default value is true, which would require all items to be healthy at the time of report creation. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub require_all_items: Option, ///The user object allows you to provide additional information about the user to be appended to the Asset Report. All fields are optional. The `first_name`, `last_name`, and `ssn` fields are required if you would like the Report to be eligible for Fannie Mae’s Day 1 Certainty™ program. #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, @@ -26,4 +29,4 @@ impl std::fmt::Display for AssetReportCreateRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_create_response.rs b/src/model/asset_report_create_response.rs index 24dbca4b..f2537e8c 100644 --- a/src/model/asset_report_create_response.rs +++ b/src/model/asset_report_create_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for AssetReportCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_filter_response.rs b/src/model/asset_report_filter_response.rs index cd4a7499..0a95726f 100644 --- a/src/model/asset_report_filter_response.rs +++ b/src/model/asset_report_filter_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for AssetReportFilterResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_freddie.rs b/src/model/asset_report_freddie.rs index 7d9c3ab0..0e59f669 100644 --- a/src/model/asset_report_freddie.rs +++ b/src/model/asset_report_freddie.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{Loans, Parties, Services}; ///An object representing an Asset Report with Freddie Mac schema. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AssetReportFreddie { ///A collection of loans that are part of a single deal. #[serde(rename = "LOANS")] @@ -17,4 +17,4 @@ impl std::fmt::Display for AssetReportFreddie { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_freddie_get_response.rs b/src/model/asset_report_freddie_get_response.rs index 0e0465d3..2b4dc8df 100644 --- a/src/model/asset_report_freddie_get_response.rs +++ b/src/model/asset_report_freddie_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::AssetReportFreddie; ///AssetReportFreddieGetResponse defines the response schema for `/asset_report/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AssetReportFreddieGetResponse { ///An object representing an Asset Report with Freddie Mac schema. #[serde(rename = "DEAL")] @@ -16,4 +16,4 @@ impl std::fmt::Display for AssetReportFreddieGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_get_request_options.rs b/src/model/asset_report_get_request_options.rs index 08b51b2b..25552a3c 100644 --- a/src/model/asset_report_get_request_options.rs +++ b/src/model/asset_report_get_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for AssetReportGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_get_response.rs b/src/model/asset_report_get_response.rs index 98897125..4abf9c06 100644 --- a/src/model/asset_report_get_response.rs +++ b/src/model/asset_report_get_response.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for AssetReportGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_investments.rs b/src/model/asset_report_investments.rs index 0c2ab05e..f3629d4d 100644 --- a/src/model/asset_report_investments.rs +++ b/src/model/asset_report_investments.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::{InvestmentTransactionSubtype, InvestmentTransactionType}; ///A transaction within an investment account. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AssetReportInvestments { ///The `account_id` of the account against which this transaction posted. pub account_id: String, @@ -26,7 +27,7 @@ pub struct AssetReportInvestments { #[serde(default, skip_serializing_if = "Option::is_none")] pub security_id: Option, ///For descriptions of possible transaction types and subtypes, see the [Investment transaction types schema](https://plaid.com/docs/api/accounts/#investment-transaction-types-schema). - pub subtype: String, + pub subtype: InvestmentTransactionSubtype, /**Value is one of the following: `buy`: Buying an investment `sell`: Selling an investment @@ -37,15 +38,19 @@ pub struct AssetReportInvestments { For descriptions of possible transaction types and subtypes, see the [Investment transaction types schema](https://plaid.com/docs/api/accounts/#investment-transaction-types-schema).*/ #[serde(rename = "type")] - pub type_: String, + pub type_: InvestmentTransactionType, /**The unofficial currency code associated with the holding. Always `null` if `iso_currency_code` is non-`null`. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `iso_currency_code`s.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub unofficial_currency_code: Option, + ///The total quantity of vested assets held, as reported by the financial institution. Vested assets are only associated with [equities](https://plaid.com/docs/api/products/investments/#investments-holdings-get-response-securities-type). + pub vested_quantity: f64, + ///The value of the vested holdings as reported by the institution. + pub vested_value: f64, } impl std::fmt::Display for AssetReportInvestments { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_item.rs b/src/model/asset_report_item.rs index 02fb3d1f..b71cd0b1 100644 --- a/src/model/asset_report_item.rs +++ b/src/model/asset_report_item.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for AssetReportItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_pdf_get_request_options.rs b/src/model/asset_report_pdf_get_request_options.rs index 5f466386..5092f46b 100644 --- a/src/model/asset_report_pdf_get_request_options.rs +++ b/src/model/asset_report_pdf_get_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for AssetReportPdfGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_refresh_request_options.rs b/src/model/asset_report_refresh_request_options.rs index 8a344168..893c4d41 100644 --- a/src/model/asset_report_refresh_request_options.rs +++ b/src/model/asset_report_refresh_request_options.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for AssetReportRefreshRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_refresh_response.rs b/src/model/asset_report_refresh_response.rs index 0ff7867d..807c0fa3 100644 --- a/src/model/asset_report_refresh_response.rs +++ b/src/model/asset_report_refresh_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for AssetReportRefreshResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_remove_response.rs b/src/model/asset_report_remove_response.rs index 7026ad25..d23e7a45 100644 --- a/src/model/asset_report_remove_response.rs +++ b/src/model/asset_report_remove_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for AssetReportRemoveResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_transaction.rs b/src/model/asset_report_transaction.rs index 9fb4a26e..ae3678b6 100644 --- a/src/model/asset_report_transaction.rs +++ b/src/model/asset_report_transaction.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{CreditCategory, Location, PaymentMeta}; +use super::{AssetReportTransactionType, CreditCategory, Location, PaymentMeta}; ///A transaction on the asset report -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AssetReportTransaction { ///The ID of the account in which this transaction occurred. pub account_id: String, @@ -73,7 +73,7 @@ If the `transactions` object was returned by a Transactions endpoint such as `/t `unresolved:` transactions that do not fit into the other three types.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub transaction_type: Option, + pub transaction_type: Option, /**The unofficial currency code associated with the transaction. Always `null` if `iso_currency_code` is non-`null`. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.*/ @@ -84,4 +84,4 @@ impl std::fmt::Display for AssetReportTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_report_transaction_type.rs b/src/model/asset_report_transaction_type.rs new file mode 100644 index 00000000..81351829 --- /dev/null +++ b/src/model/asset_report_transaction_type.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +/**`digital:` transactions that took place online. + +`place:` transactions that were made at a physical location. + +`special:` transactions that relate to banks, e.g. fees or deposits. + +`unresolved:` transactions that do not fit into the other three types.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AssetReportTransactionType { + #[serde(rename = "digital")] + Digital, + #[serde(rename = "place")] + Place, + #[serde(rename = "special")] + Special, + #[serde(rename = "unresolved")] + Unresolved, +} diff --git a/src/model/asset_report_type.rs b/src/model/asset_report_type.rs new file mode 100644 index 00000000..c683ef70 --- /dev/null +++ b/src/model/asset_report_type.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///Indicates either a Fast Asset Report, which will contain only current identity and balance information, or a Full Asset Report, which will also contain historical balance information and transaction data. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AssetReportType { + #[serde(rename = "FULL")] + Full, + #[serde(rename = "FAST")] + Fast, +} diff --git a/src/model/asset_report_user.rs b/src/model/asset_report_user.rs index b9c5b4b2..c0c17528 100644 --- a/src/model/asset_report_user.rs +++ b/src/model/asset_report_user.rs @@ -30,4 +30,4 @@ impl std::fmt::Display for AssetReportUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_transaction.rs b/src/model/asset_transaction.rs index 27ac7f78..cbd8028b 100644 --- a/src/model/asset_transaction.rs +++ b/src/model/asset_transaction.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AssetTransactionDescription, AssetTransactionDetail}; ///An object representing... -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AssetTransaction { ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. #[serde(rename = "ASSET_TRANSACTION_DESCRIPTON")] @@ -15,4 +15,4 @@ impl std::fmt::Display for AssetTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_transaction_category_type.rs b/src/model/asset_transaction_category_type.rs new file mode 100644 index 00000000..1af445e0 --- /dev/null +++ b/src/model/asset_transaction_category_type.rs @@ -0,0 +1,119 @@ +use serde::{Serialize, Deserialize}; +///Asset Transaction Category Type Enumerated derived by Vendor. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AssetTransactionCategoryType { + #[serde(rename = "ATMFee")] + AtmFee, + Advertising, + AirTravel, + AlcoholBars, + Allowance, + Amusement, + Arts, + AutoTransport, + AutoInsurance, + AutoPayment, + BabySupplies, + BabysitterDaycare, + BankFee, + BillsUtilities, + Bonus, + BooksSupplies, + #[serde(rename = "Business Services")] + BusinessServices, + Buy, + #[serde(rename = "CashATM")] + CashAtm, + Charity, + Check, + ChildSupport, + Clothing, + CoffeeShops, + CreditCardPayment, + Dentist, + Doctor, + Education, + ElectronicsSoftware, + Entertainment, + Eyecare, + FastFood, + FederalTax, + FeesCharges, + FinanceCharge, + Financial, + FinancialAdvisor, + FoodDining, + Furnishings, + GasFuel, + GiftsDonations, + Groceries, + Gym, + Hair, + HealthFitness, + HealthInsurance, + Hobbies, + Home, + HomeImprovement, + HomeInsurance, + HomePhone, + HomeServices, + HomeSupplies, + Hotel, + Income, + InterestIncome, + Internet, + Investments, + Kids, + KidsActivities, + LateFee, + Laundry, + LawnGarden, + Legal, + LifeInsurance, + LoanInsurance, + LoanPayment, + Loans, + MobilePhone, + MortgageRent, + #[serde(rename = "MoviesDVDs")] + MoviesDvDs, + Music, + NewspapersMagazines, + OfficeSupplies, + Parking, + Paycheck, + PersonalCare, + PetFoodSupplies, + PetGrooming, + Pets, + Pharmacy, + Printing, + #[serde(rename = "Property Tax")] + PropertyTax, + #[serde(rename = "Public Transportation")] + PublicTransportation, + Reimbursement, + RentalCarTaxi, + Restaurants, + SalesTax, + ServiceParts, + ServiceFee, + Shipping, + Shopping, + SpaMassage, + SportingGoods, + Sports, + StateTax, + #[serde(rename = "Student Loan")] + StudentLoan, + Taxes, + Television, + Toys, + Transfer, + Travel, + Tuition, + Uncategorized, + Utilities, + Vacation, + Veterinary, +} diff --git a/src/model/asset_transaction_description.rs b/src/model/asset_transaction_description.rs index 876d7718..7d80c199 100644 --- a/src/model/asset_transaction_description.rs +++ b/src/model/asset_transaction_description.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for AssetTransactionDescription { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_transaction_detail.rs b/src/model/asset_transaction_detail.rs index fb8a3687..78832875 100644 --- a/src/model/asset_transaction_detail.rs +++ b/src/model/asset_transaction_detail.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::{AssetTransactionCategoryType, AssetTransactionType}; ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AssetTransactionDetail { ///Asset Transaction Amount. #[serde(rename = "AssetTransactionAmount")] @@ -8,7 +9,7 @@ pub struct AssetTransactionDetail { ///Asset Transaction Category Type Enumerated derived by Vendor. #[serde(rename = "AssetTransactionCategoryType")] #[serde(default, skip_serializing_if = "Option::is_none")] - pub asset_transaction_category_type: Option, + pub asset_transaction_category_type: Option, ///Asset Transaction Date. #[serde(rename = "AssetTransactionDate")] pub asset_transaction_date: chrono::NaiveDate, @@ -21,7 +22,7 @@ pub struct AssetTransactionDetail { pub asset_transaction_post_date: chrono::NaiveDate, ///Asset Transaction Type. #[serde(rename = "AssetTransactionType")] - pub asset_transaction_type: String, + pub asset_transaction_type: AssetTransactionType, ///FI Provided - examples are atm, cash, check, credit, debit, deposit, directDebit, directDeposit, dividend, fee, interest, other, payment, pointOfSale, repeatPayment, serviceCharge, transfer. #[serde(rename = "AssetTransactionTypeAdditionalDescription")] #[serde(default, skip_serializing_if = "Option::is_none")] @@ -38,4 +39,4 @@ impl std::fmt::Display for AssetTransactionDetail { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_transaction_type.rs b/src/model/asset_transaction_type.rs new file mode 100644 index 00000000..8ab7d28a --- /dev/null +++ b/src/model/asset_transaction_type.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///Asset Transaction Type. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AssetTransactionType { + Credit, + Debit, +} diff --git a/src/model/asset_transactions.rs b/src/model/asset_transactions.rs index d2f6f74c..792e1307 100644 --- a/src/model/asset_transactions.rs +++ b/src/model/asset_transactions.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for AssetTransactions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/asset_type.rs b/src/model/asset_type.rs new file mode 100644 index 00000000..caf79e4d --- /dev/null +++ b/src/model/asset_type.rs @@ -0,0 +1,10 @@ +use serde::{Serialize, Deserialize}; +///A value from a MISMO prescribed list that specifies financial assets in a mortgage loan transaction. Assets may be either liquid or fixed and are associated with a corresponding asset amount. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AssetType { + CheckingAccount, + SavingsAccount, + Investment, + MoneyMarketFund, + Other, +} diff --git a/src/model/assets.rs b/src/model/assets.rs index d8845c5e..76f0b43e 100644 --- a/src/model/assets.rs +++ b/src/model/assets.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for Assets { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/assets_error_webhook.rs b/src/model/assets_error_webhook.rs index 77f5ebb0..f7a102ca 100644 --- a/src/model/assets_error_webhook.rs +++ b/src/model/assets_error_webhook.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired when Asset Report generation has failed. The resulting `error` will have an `error_type` of `ASSET_REPORT_ERROR`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AssetsErrorWebhook { ///The ID associated with the Asset Report. pub asset_report_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `user_id` corresponding to the User ID the webhook has fired for. @@ -22,4 +22,4 @@ impl std::fmt::Display for AssetsErrorWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/assets_product_ready_webhook.rs b/src/model/assets_product_ready_webhook.rs index 6eba1b00..7c0b7fb4 100644 --- a/src/model/assets_product_ready_webhook.rs +++ b/src/model/assets_product_ready_webhook.rs @@ -1,14 +1,15 @@ use serde::{Serialize, Deserialize}; +use super::{AssetReportType, WebhookEnvironmentValues}; ///Fired when the Asset Report has been generated and `/asset_report/get` is ready to be called. If you attempt to retrieve an Asset Report before this webhook has fired, you’ll receive a response with the HTTP status code 400 and a Plaid error code of `PRODUCT_NOT_READY`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AssetsProductReadyWebhook { ///The `asset_report_id` corresponding to the Asset Report the webhook has fired for. pub asset_report_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, - ///The report type, indicating whether the Asset Report is a `full` or `fast` report. + pub environment: WebhookEnvironmentValues, + ///Indicates either a Fast Asset Report, which will contain only current identity and balance information, or a Full Asset Report, which will also contain historical balance information and transaction data. #[serde(default, skip_serializing_if = "Option::is_none")] - pub report_type: Option, + pub report_type: Option, ///The `user_id` corresponding to the User ID the webhook has fired for. #[serde(default, skip_serializing_if = "Option::is_none")] pub user_id: Option, @@ -21,4 +22,4 @@ impl std::fmt::Display for AssetsProductReadyWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/auth_default_update_webhook.rs b/src/model/auth_default_update_webhook.rs new file mode 100644 index 00000000..d5664590 --- /dev/null +++ b/src/model/auth_default_update_webhook.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +use super::{AccountIdsWithUpdatedAuth, PlaidError, WebhookEnvironmentValues}; +///Plaid will trigger a `DEFAULT_UPDATE` webhook for Items that undergo a change in Auth data. This is generally caused by data partners notifying Plaid of a change in their account numbering system or to their routing numbers. To avoid returned transactions, customers that receive a `DEFAULT_UPDATE` webhook with the `account_ids_with_updated_auth` object populated should immediately discontinue all usages of existing Auth data for those accounts and call `/auth/get` or `/processor/auth/get` to obtain updated account and routing numbers. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AuthDefaultUpdateWebhook { + ///An array of `account_id`'s for accounts that contain new auth. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub account_ids_with_new_auth: Vec, + /**An object with keys of `account_id`'s that are mapped to their respective auth attributes that changed. `ACCOUNT_NUMBER` and `ROUTING_NUMBER` are the two potential values that can be flagged as updated. + +Example: `{ "XMBvvyMGQ1UoLbKByoMqH3nXMj84ALSdE5B58": ["ACCOUNT_NUMBER"] }`*/ + pub account_ids_with_updated_auth: AccountIdsWithUpdatedAuth, + ///The Plaid environment the webhook was sent from + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, + ///The `item_id` of the Item associated with this webhook, warning, or error + pub item_id: String, + ///`DEFAULT_UPDATE` + pub webhook_code: String, + ///`AUTH` + pub webhook_type: String, +} +impl std::fmt::Display for AuthDefaultUpdateWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/auth_get_numbers.rs b/src/model/auth_get_numbers.rs index b83cfa1f..ec6715fc 100644 --- a/src/model/auth_get_numbers.rs +++ b/src/model/auth_get_numbers.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for AuthGetNumbers { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/auth_get_request_options.rs b/src/model/auth_get_request_options.rs index 3e80bec2..fe62caf3 100644 --- a/src/model/auth_get_request_options.rs +++ b/src/model/auth_get_request_options.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for AuthGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/auth_get_response.rs b/src/model/auth_get_response.rs index 2653a79b..e5923909 100644 --- a/src/model/auth_get_response.rs +++ b/src/model/auth_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountBase, AuthGetNumbers, Item}; ///AuthGetResponse defines the response schema for `/auth/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AuthGetResponse { ///The `accounts` for which numbers are being retrieved. #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -17,4 +17,4 @@ impl std::fmt::Display for AuthGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/auth_metadata.rs b/src/model/auth_metadata.rs index f2508d51..456273ae 100644 --- a/src/model/auth_metadata.rs +++ b/src/model/auth_metadata.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for AuthMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/auth_supported_methods.rs b/src/model/auth_supported_methods.rs index c9160a4f..9018ac9d 100644 --- a/src/model/auth_supported_methods.rs +++ b/src/model/auth_supported_methods.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for AuthSupportedMethods { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/auth_update_types.rs b/src/model/auth_update_types.rs new file mode 100644 index 00000000..1549ac6e --- /dev/null +++ b/src/model/auth_update_types.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The possible types of auth data that may have changed. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum AuthUpdateTypes { + #[serde(rename = "ACCOUNT_NUMBER")] + AccountNumber, + #[serde(rename = "ROUTING_NUMBER")] + RoutingNumber, +} diff --git a/src/model/automatically_verified_webhook.rs b/src/model/automatically_verified_webhook.rs index 78c5074a..32e24ab6 100644 --- a/src/model/automatically_verified_webhook.rs +++ b/src/model/automatically_verified_webhook.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired when an Item is verified via automated micro-deposits. We recommend communicating to your users when this event is received to notify them that their account is verified and ready for use. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AutomaticallyVerifiedWebhook { ///The `account_id` of the account associated with the webhook pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -21,4 +21,4 @@ impl std::fmt::Display for AutomaticallyVerifiedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/balance_plus_attributes.rs b/src/model/balance_plus_attributes.rs new file mode 100644 index 00000000..99f5633e --- /dev/null +++ b/src/model/balance_plus_attributes.rs @@ -0,0 +1,113 @@ +use serde::{Serialize, Deserialize}; +///Contains additional data that can be used to assess the ACH return risk +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BalancePlusAttributes { + ///The number of times the account's addresses on file have changed over the past 28 days + #[serde(rename = "address_change_count_28d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_change_count28_d: Option, + ///The number of times the account's addresses on file have changed over the past 90 days + #[serde(rename = "address_change_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_change_count90_d: Option, + ///The number of days since the first time the Item was connected to an application via Plaid + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_since_first_plaid_connection: Option, + ///The number of times the account's email addresses on file have changed over the past 28 days + #[serde(rename = "email_change_count_28d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email_change_count28_d: Option, + ///The number of times the account's email addresses on file have changed over the past 90 days + #[serde(rename = "email_change_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email_change_count90_d: Option, + ///The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 30 days + #[serde(rename = "failed_plaid_non_oauth_authentication_attempts_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failed_plaid_non_oauth_authentication_attempts_count30_d: Option, + ///The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 3 days + #[serde(rename = "failed_plaid_non_oauth_authentication_attempts_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failed_plaid_non_oauth_authentication_attempts_count3_d: Option, + ///The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 7 days + #[serde(rename = "failed_plaid_non_oauth_authentication_attempts_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failed_plaid_non_oauth_authentication_attempts_count7_d: Option, + ///Indicates if the receiver bank account is closed + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_account_closed: Option, + ///Indicates if the receiver bank account is either frozen or restricted + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_account_frozen_or_restricted: Option, + ///Indicates if the ACH transaction funding account is a savings/money market account + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_savings_or_money_market_account: Option, + ///The number of possible past returns due to non-sufficient funds/overdrafts over the past 30 days from the account that will be debited + #[serde(rename = "nsf_overdraft_transactions_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nsf_overdraft_transactions_count30_d: Option, + ///The number of possible past returns due to non-sufficient funds/overdrafts over the past 60 days from the account that will be debited + #[serde(rename = "nsf_overdraft_transactions_count_60d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nsf_overdraft_transactions_count60_d: Option, + ///The number of possible past returns due to non-sufficient funds/overdrafts over the past 7 days from the account that will be debited + #[serde(rename = "nsf_overdraft_transactions_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nsf_overdraft_transactions_count7_d: Option, + ///The number of possible past returns due to non-sufficient funds/overdrafts over the past 90 days from the account that will be debited + #[serde(rename = "nsf_overdraft_transactions_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nsf_overdraft_transactions_count90_d: Option, + ///The number of times the account's phone numbers on file have changed over the past 28 days + #[serde(rename = "phone_change_count_28d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_change_count28_d: Option, + ///The number of times the account's phone numbers on file have changed over the past 90 days + #[serde(rename = "phone_change_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_change_count90_d: Option, + ///The number of times the Item has been connected to applications via Plaid over the past 30 days + #[serde(rename = "plaid_connections_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_connections_count30_d: Option, + ///The number of times the Item has been connected to applications via Plaid over the past 7 days + #[serde(rename = "plaid_connections_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_connections_count7_d: Option, + ///The number of non-OAuth authentication attempts via Plaid for this bank account over the past 30 days + #[serde(rename = "plaid_non_oauth_authentication_attempts_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_non_oauth_authentication_attempts_count30_d: Option, + ///The number of non-OAuth authentication attempts via Plaid for this bank account over the past 3 days + #[serde(rename = "plaid_non_oauth_authentication_attempts_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_non_oauth_authentication_attempts_count3_d: Option, + ///The number of non-OAuth authentication attempts via Plaid for this bank account over the past 7 days + #[serde(rename = "plaid_non_oauth_authentication_attempts_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_non_oauth_authentication_attempts_count7_d: Option, + ///The total number of times the Item has been connected to applications via Plaid + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_plaid_connections_count: Option, + ///The number of possible past returns due to unauthorized transactions over the past 30 days from the account that will be debited + #[serde(rename = "unauthorized_transactions_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unauthorized_transactions_count30_d: Option, + ///The number of possible past returns due to unauthorized transactions over the past 60 days from the account that will be debited + #[serde(rename = "unauthorized_transactions_count_60d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unauthorized_transactions_count60_d: Option, + ///The number of possible past returns due to unauthorized transactions over the past 7 days from the account that will be debited + #[serde(rename = "unauthorized_transactions_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unauthorized_transactions_count7_d: Option, + ///The number of possible past returns due to unauthorized transactions over the past 90 days from the account that will be debited + #[serde(rename = "unauthorized_transactions_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unauthorized_transactions_count90_d: Option, +} +impl std::fmt::Display for BalancePlusAttributes { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/balance_plus_risk_level.rs b/src/model/balance_plus_risk_level.rs new file mode 100644 index 00000000..9de9c391 --- /dev/null +++ b/src/model/balance_plus_risk_level.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +/**A five-tier risk assessment for the transaction, based on the probability distribution of ACH returns, measured by the incident rate. + +Each tier corresponds to a distribution with a different mean (average) probability. + +`HIGH`: The mean probability of ACH return risk is above 40%. +`MEDIUM_HIGH`: The mean probability of ACH return risk is 15%-40%. +`MEDIUM`: The mean probability of ACH return risk is 5-10%. +`MEDIUM_LOW`: The mean probability of ACH return risk is 1%-2%. +`LOW`: The mean probability of ACH return risk is below 1%. + +Note that these tiers correspond to probability *distributions* and not to discrete probabilities. + +These tier definitions are specific to Balance Plus and do not apply to risk tiers generated by other Plaid endpoints.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BalancePlusRiskLevel { + #[serde(rename = "HIGH")] + High, + #[serde(rename = "MEDIUM_HIGH")] + MediumHigh, + #[serde(rename = "MEDIUM")] + Medium, + #[serde(rename = "MEDIUM_LOW")] + MediumLow, + #[serde(rename = "LOW")] + Low, +} diff --git a/src/model/bank_income_complete_result.rs b/src/model/bank_income_complete_result.rs new file mode 100644 index 00000000..f3d7ab6b --- /dev/null +++ b/src/model/bank_income_complete_result.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**The result of the bank income report generation + +`SUCCESS`: The bank income report was successfully generated and can be retrieved via `/credit/bank_income/get`. + +`FAILURE`: The bank income report failed to be generated*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BankIncomeCompleteResult { + #[serde(rename = "SUCCESS")] + Success, + #[serde(rename = "FAILURE")] + Failure, +} diff --git a/src/model/bank_income_complete_webhook.rs b/src/model/bank_income_complete_webhook.rs index eea66f0f..554abb75 100644 --- a/src/model/bank_income_complete_webhook.rs +++ b/src/model/bank_income_complete_webhook.rs @@ -1,15 +1,16 @@ use serde::{Serialize, Deserialize}; +use super::{BankIncomeCompleteResult, WebhookEnvironmentValues}; ///Fired when a bank income report has finished generating or failed to generate, triggered by calling `/credit/bank_income/get` in CRA enabled client. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BankIncomeCompleteWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, /**The result of the bank income report generation `SUCCESS`: The bank income report was successfully generated and can be retrieved via `/credit/bank_income/get`. `FAILURE`: The bank income report failed to be generated*/ - pub result: String, + pub result: BankIncomeCompleteResult, ///The `user_id` corresponding to the user the webhook has fired for. pub user_id: String, ///`BANK_INCOME_COMPLETE` @@ -21,4 +22,4 @@ impl std::fmt::Display for BankIncomeCompleteWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_income_refresh_complete_result.rs b/src/model/bank_income_refresh_complete_result.rs new file mode 100644 index 00000000..40ad0fbe --- /dev/null +++ b/src/model/bank_income_refresh_complete_result.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**The result of the bank income refresh report generation + +`SUCCESS`: The refreshed report was successfully generated and can be retrieved via `/credit/bank_income/get`. + +`FAILURE`: The refreshed report failed to be generated*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BankIncomeRefreshCompleteResult { + #[serde(rename = "SUCCESS")] + Success, + #[serde(rename = "FAILURE")] + Failure, +} diff --git a/src/model/bank_income_refresh_complete_webhook.rs b/src/model/bank_income_refresh_complete_webhook.rs index b6ae2a4b..8582b9ae 100644 --- a/src/model/bank_income_refresh_complete_webhook.rs +++ b/src/model/bank_income_refresh_complete_webhook.rs @@ -1,15 +1,16 @@ use serde::{Serialize, Deserialize}; +use super::{BankIncomeRefreshCompleteResult, WebhookEnvironmentValues}; ///Fired when a refreshed bank income report has finished generating or failed to generate, triggered by calling `/credit/bank_income/refresh`. To get this webhook, subscribe via the [Dashboard](https://dashboard.plaid.com/developers/webhooks). -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BankIncomeRefreshCompleteWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, /**The result of the bank income refresh report generation `SUCCESS`: The refreshed report was successfully generated and can be retrieved via `/credit/bank_income/get`. `FAILURE`: The refreshed report failed to be generated*/ - pub result: String, + pub result: BankIncomeRefreshCompleteResult, ///The `user_id` corresponding to the user the webhook has fired for. pub user_id: String, ///`BANK_INCOME_REFRESH_COMPLETE` @@ -21,4 +22,4 @@ impl std::fmt::Display for BankIncomeRefreshCompleteWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_income_refresh_update_webhook.rs b/src/model/bank_income_refresh_update_webhook.rs index 55ac25ca..5a05cb26 100644 --- a/src/model/bank_income_refresh_update_webhook.rs +++ b/src/model/bank_income_refresh_update_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when a change to the user's income is detected. You should call `/credit/bank_income/refresh` to get updated income data for the user. To receive this webhook, subscribe in the [Dashboard](https://dashboard.plaid.com/developers/webhooks). -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BankIncomeRefreshUpdateWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The `user_id` corresponding to the user the webhook has fired for. pub user_id: String, ///`BANK_INCOME_REFRESH_UPDATE` @@ -15,4 +16,4 @@ impl std::fmt::Display for BankIncomeRefreshUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_initiated_return_risk.rs b/src/model/bank_initiated_return_risk.rs index 1f269cd9..c87dd9ee 100644 --- a/src/model/bank_initiated_return_risk.rs +++ b/src/model/bank_initiated_return_risk.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for BankInitiatedReturnRisk { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer.rs b/src/model/bank_transfer.rs index 3d0a56c2..d1a06c33 100644 --- a/src/model/bank_transfer.rs +++ b/src/model/bank_transfer.rs @@ -1,13 +1,17 @@ use serde::{Serialize, Deserialize}; use super::{ - BankTransferDirection, BankTransferFailure, BankTransferMetadata, BankTransferUser, + AchClass, BankTransferDirection, BankTransferFailure, BankTransferMetadata, + BankTransferNetwork, BankTransferStatus, BankTransferType, BankTransferUser, }; ///Represents a bank transfer within the Bank Transfers API. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BankTransfer { ///The account ID that should be credited/debited for this bank transfer. pub account_id: String, - /**Specifies the use case of the transfer. Required for transfers on an ACH network. + /**Specifies the use case of the transfer. Required for transfers on an ACH network. For more details, see [ACH SEC codes](https://plaid.com/docs/transfer/creating-transfers/#ach-sec-codes). + +Codes supported for credits: `ccd`, `ppd` +Codes supported for debits: `ccd`, `tel`, `web` `"ccd"` - Corporate Credit or Debit - fund transfer between two corporate bank accounts @@ -16,7 +20,7 @@ pub struct BankTransfer { `"tel"` - Telephone-Initiated Entry `"web"` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet*/ - pub ach_class: String, + pub ach_class: AchClass, ///The amount of the bank transfer (decimal string with two digits of precision e.g. "10.00"). pub amount: String, ///When `true`, you can still cancel this bank transfer. @@ -47,14 +51,14 @@ Maximum value length of 500 characters*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub metadata: Option, ///The network or rails used for the transfer. Valid options are `ach`, `same-day-ach`, or `wire`. - pub network: String, + pub network: BankTransferNetwork, ///Plaid’s unique identifier for the origination account that was used for this transfer. pub origination_account_id: String, ///The status of the transfer. - pub status: String, + pub status: BankTransferStatus, ///The type of bank transfer. This will be either `debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account. #[serde(rename = "type")] - pub type_: String, + pub type_: BankTransferType, ///The legal name and other information for the account holder. pub user: BankTransferUser, } @@ -62,4 +66,4 @@ impl std::fmt::Display for BankTransfer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_balance.rs b/src/model/bank_transfer_balance.rs index bae05596..f98be332 100644 --- a/src/model/bank_transfer_balance.rs +++ b/src/model/bank_transfer_balance.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for BankTransferBalance { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_balance_get_response.rs b/src/model/bank_transfer_balance_get_response.rs index 9e5f6b3b..53be45e6 100644 --- a/src/model/bank_transfer_balance_get_response.rs +++ b/src/model/bank_transfer_balance_get_response.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for BankTransferBalanceGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_cancel_response.rs b/src/model/bank_transfer_cancel_response.rs index 1244d07d..e17cc57b 100644 --- a/src/model/bank_transfer_cancel_response.rs +++ b/src/model/bank_transfer_cancel_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for BankTransferCancelResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_create_response.rs b/src/model/bank_transfer_create_response.rs index 15920579..41d2e6c2 100644 --- a/src/model/bank_transfer_create_response.rs +++ b/src/model/bank_transfer_create_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::BankTransfer; ///Defines the response schema for `/bank_transfer/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BankTransferCreateResponse { ///Represents a bank transfer within the Bank Transfers API. pub bank_transfer: BankTransfer, @@ -12,4 +12,4 @@ impl std::fmt::Display for BankTransferCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_direction.rs b/src/model/bank_transfer_direction.rs index e373863d..bd70c6a5 100644 --- a/src/model/bank_transfer_direction.rs +++ b/src/model/bank_transfer_direction.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct BankTransferDirection(pub serde_json::Value); \ No newline at end of file +pub struct BankTransferDirection(pub serde_json::Value); diff --git a/src/model/bank_transfer_event.rs b/src/model/bank_transfer_event.rs index 41abdf93..77fe8dd8 100644 --- a/src/model/bank_transfer_event.rs +++ b/src/model/bank_transfer_event.rs @@ -1,7 +1,9 @@ use serde::{Serialize, Deserialize}; -use super::{BankTransferDirection, BankTransferFailure}; +use super::{ + BankTransferDirection, BankTransferEventType, BankTransferFailure, BankTransferType, +}; ///Represents an event in the Bank Transfers API. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BankTransferEvent { ///The account ID associated with the bank transfer. pub account_id: String, @@ -12,7 +14,7 @@ pub struct BankTransferEvent { ///The currency of the bank transfer amount. pub bank_transfer_iso_currency_code: String, ///The type of bank transfer. This will be either `debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account. - pub bank_transfer_type: String, + pub bank_transfer_type: BankTransferType, ///Indicates the direction of the transfer: `outbound` for API-initiated transfers, or `inbound` for payments received by the FBO account. #[serde(default, skip_serializing_if = "Option::is_none")] pub direction: Option, @@ -29,7 +31,7 @@ pub struct BankTransferEvent { `posted`: The transfer has been successfully submitted to the payment network. `reversed`: A posted transfer was reversed.*/ - pub event_type: String, + pub event_type: BankTransferEventType, ///The failure reason if the type of this transfer is `"failed"` or `"reversed"`. Null value otherwise. #[serde(default, skip_serializing_if = "Option::is_none")] pub failure_reason: Option, @@ -43,4 +45,4 @@ impl std::fmt::Display for BankTransferEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_event_list_bank_transfer_type.rs b/src/model/bank_transfer_event_list_bank_transfer_type.rs index 9ffeca68..e710237d 100644 --- a/src/model/bank_transfer_event_list_bank_transfer_type.rs +++ b/src/model/bank_transfer_event_list_bank_transfer_type.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct BankTransferEventListBankTransferType(pub serde_json::Value); \ No newline at end of file +pub struct BankTransferEventListBankTransferType(pub serde_json::Value); diff --git a/src/model/bank_transfer_event_list_direction.rs b/src/model/bank_transfer_event_list_direction.rs index 35d5bb5b..7919afeb 100644 --- a/src/model/bank_transfer_event_list_direction.rs +++ b/src/model/bank_transfer_event_list_direction.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct BankTransferEventListDirection(pub serde_json::Value); \ No newline at end of file +pub struct BankTransferEventListDirection(pub serde_json::Value); diff --git a/src/model/bank_transfer_event_list_response.rs b/src/model/bank_transfer_event_list_response.rs index cdc00181..6944b8b3 100644 --- a/src/model/bank_transfer_event_list_response.rs +++ b/src/model/bank_transfer_event_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for BankTransferEventListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_event_sync_response.rs b/src/model/bank_transfer_event_sync_response.rs index 09b18ae1..c2b5e4d1 100644 --- a/src/model/bank_transfer_event_sync_response.rs +++ b/src/model/bank_transfer_event_sync_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for BankTransferEventSyncResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_event_type.rs b/src/model/bank_transfer_event_type.rs new file mode 100644 index 00000000..fbb04021 --- /dev/null +++ b/src/model/bank_transfer_event_type.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +/**The type of event that this bank transfer represents. + +`pending`: A new transfer was created; it is in the pending state. + +`cancelled`: The transfer was cancelled by the client. + +`failed`: The transfer failed, no funds were moved. + +`posted`: The transfer has been successfully submitted to the payment network. + +`reversed`: A posted transfer was reversed.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BankTransferEventType { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "posted")] + Posted, + #[serde(rename = "reversed")] + Reversed, +} diff --git a/src/model/bank_transfer_failure.rs b/src/model/bank_transfer_failure.rs index bda2eb1b..ddcc91a4 100644 --- a/src/model/bank_transfer_failure.rs +++ b/src/model/bank_transfer_failure.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for BankTransferFailure { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_get_response.rs b/src/model/bank_transfer_get_response.rs index b3dd0f85..1d84490d 100644 --- a/src/model/bank_transfer_get_response.rs +++ b/src/model/bank_transfer_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::BankTransfer; ///Defines the response schema for `/bank_transfer/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BankTransferGetResponse { ///Represents a bank transfer within the Bank Transfers API. pub bank_transfer: BankTransfer, @@ -12,4 +12,4 @@ impl std::fmt::Display for BankTransferGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_list_response.rs b/src/model/bank_transfer_list_response.rs index d72d1a2b..0a0796f5 100644 --- a/src/model/bank_transfer_list_response.rs +++ b/src/model/bank_transfer_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for BankTransferListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_metadata.rs b/src/model/bank_transfer_metadata.rs index b0c84a8f..28807bca 100644 --- a/src/model/bank_transfer_metadata.rs +++ b/src/model/bank_transfer_metadata.rs @@ -1,14 +1,2 @@ use serde::{Serialize, Deserialize}; -/**The Metadata object is a mapping of client-provided string fields to any string value. The following limitations apply: -The JSON values must be Strings (no nested JSON objects allowed) -Only ASCII characters may be used -Maximum of 50 key/value pairs -Maximum key length of 40 characters -Maximum value length of 500 characters*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct BankTransferMetadata {} -impl std::fmt::Display for BankTransferMetadata { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type BankTransferMetadata = String; diff --git a/src/model/bank_transfer_migrate_account_response.rs b/src/model/bank_transfer_migrate_account_response.rs index 4613fec7..b0f4343f 100644 --- a/src/model/bank_transfer_migrate_account_response.rs +++ b/src/model/bank_transfer_migrate_account_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for BankTransferMigrateAccountResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_network.rs b/src/model/bank_transfer_network.rs new file mode 100644 index 00000000..2cf1ada9 --- /dev/null +++ b/src/model/bank_transfer_network.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///The network or rails used for the transfer. Valid options are `ach`, `same-day-ach`, or `wire`. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BankTransferNetwork { + #[serde(rename = "ach")] + Ach, + #[serde(rename = "same-day-ach")] + SameDayAch, + #[serde(rename = "wire")] + Wire, +} diff --git a/src/model/bank_transfer_status.rs b/src/model/bank_transfer_status.rs new file mode 100644 index 00000000..a52f79ad --- /dev/null +++ b/src/model/bank_transfer_status.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///The status of the transfer. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BankTransferStatus { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "posted")] + Posted, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "reversed")] + Reversed, +} diff --git a/src/model/bank_transfer_sweep.rs b/src/model/bank_transfer_sweep.rs index 11af472e..83b5f6cc 100644 --- a/src/model/bank_transfer_sweep.rs +++ b/src/model/bank_transfer_sweep.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for BankTransferSweep { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_sweep_get_response.rs b/src/model/bank_transfer_sweep_get_response.rs index c1359d56..5779b61d 100644 --- a/src/model/bank_transfer_sweep_get_response.rs +++ b/src/model/bank_transfer_sweep_get_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for BankTransferSweepGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_sweep_list_response.rs b/src/model/bank_transfer_sweep_list_response.rs index e1c5a79c..4fbfd3e2 100644 --- a/src/model/bank_transfer_sweep_list_response.rs +++ b/src/model/bank_transfer_sweep_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for BankTransferSweepListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfer_type.rs b/src/model/bank_transfer_type.rs new file mode 100644 index 00000000..458acd56 --- /dev/null +++ b/src/model/bank_transfer_type.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The type of bank transfer. This will be either `debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BankTransferType { + #[serde(rename = "debit")] + Debit, + #[serde(rename = "credit")] + Credit, +} diff --git a/src/model/bank_transfer_user.rs b/src/model/bank_transfer_user.rs index 49f988ef..f1b7fe3a 100644 --- a/src/model/bank_transfer_user.rs +++ b/src/model/bank_transfer_user.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for BankTransferUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/bank_transfers_events_update_webhook.rs b/src/model/bank_transfers_events_update_webhook.rs index b9a581d8..546f23ee 100644 --- a/src/model/bank_transfers_events_update_webhook.rs +++ b/src/model/bank_transfers_events_update_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when new bank transfer events are available. Receiving this webhook indicates you should fetch the new events from `/bank_transfer/event/sync`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BankTransfersEventsUpdateWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///`BANK_TRANSFERS_EVENTS_UPDATE` pub webhook_code: String, ///`BANK_TRANSFERS` @@ -13,4 +14,4 @@ impl std::fmt::Display for BankTransfersEventsUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report.rs b/src/model/base_report.rs index e42cca9f..7218e105 100644 --- a/src/model/base_report.rs +++ b/src/model/base_report.rs @@ -3,6 +3,9 @@ use super::BaseReportItem; ///An object representing a Base Report #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct BaseReport { + ///Client-generated identifier, which can be used by lenders to track loan applications. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub client_report_id: Option, ///The date and time when the Base Report was created, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (e.g. "2018-04-12T03:32:11Z"). pub date_generated: chrono::DateTime, ///The number of days of transaction history requested. @@ -17,4 +20,4 @@ impl std::fmt::Display for BaseReport { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_account.rs b/src/model/base_report_account.rs index 0e2fb569..a0868391 100644 --- a/src/model/base_report_account.rs +++ b/src/model/base_report_account.rs @@ -1,24 +1,39 @@ use serde::{Serialize, Deserialize}; use super::{ - AccountSubtype, BaseReportAccountBalances, BaseReportAccountInsights, - BaseReportTransaction, HistoricalBalance, Owner, OwnershipType, + AccountSubtype, AccountType, BaseReportAccountBalances, BaseReportAccountInsights, + BaseReportAccountMetadata, BaseReportAttributes, BaseReportHistoricalBalance, + BaseReportTransaction, ConsumerDispute, Owner, OwnershipType, }; ///Base Report information about an account -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BaseReportAccount { + /**Plaid’s unique identifier for the account. This value will not change unless Plaid can't reconcile the account with the data returned by the financial institution. This may occur, for example, when the name of the account changes. If this happens a new `account_id` will be assigned to the account. + +If an account with a specific `account_id` disappears instead of changing, the account is likely closed. Closed accounts are not returned by the Plaid API. + +Like all Plaid identifiers, the `account_id` is case sensitive.*/ + pub account_id: String, ///Calculated insights derived from transaction-level data. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_insights: Option, + ///Calculated attributes derived from transaction-level data. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attributes: Option, ///Base Report information about an account's balances pub balances: BaseReportAccountBalances, - ///The duration of transaction history available for this Item, typically defined as the time since the date of the earliest transaction in that account. Only returned by Base Report endpoints. + ///The information about previously submitted valid dispute statements by the consumer + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub consumer_disputes: Vec, + ///The duration of transaction history available within this report for this Item, typically defined as the time since the date of the earliest transaction in that account. Only returned by Base Report endpoints. pub days_available: f64, ///Calculated data about the historical balances on the account. Only returned by Base Report endpoints and currently not supported by `brokerage` or `investment` accounts. - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub historical_balances: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub historical_balances: Option>, ///The last 2-4 alphanumeric characters of an account's official account number. Note that the mask may be non-unique between an Item's accounts, and it may also not match the mask that the bank displays to the user. #[serde(default, skip_serializing_if = "Option::is_none")] pub mask: Option, + ///Base Report metadata about the extracted account. + pub metadata: BaseReportAccountMetadata, ///The name of the account, either assigned by the user or by the financial institution itself pub name: String, ///The official name of the account as given by the financial institution @@ -53,10 +68,10 @@ pub struct BaseReportAccount { See the [Account type schema](https://plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.*/ #[serde(rename = "type")] - pub type_: String, + pub type_: AccountType, } impl std::fmt::Display for BaseReportAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_account_balances.rs b/src/model/base_report_account_balances.rs index 35b0ec2b..1e1121da 100644 --- a/src/model/base_report_account_balances.rs +++ b/src/model/base_report_account_balances.rs @@ -1,9 +1,70 @@ use serde::{Serialize, Deserialize}; +use super::BaseReportAverageMonthlyBalances; ///Base Report information about an account's balances #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct BaseReportAccountBalances {} +pub struct BaseReportAccountBalances { + /**The amount of funds available to be withdrawn from the account, as determined by the financial institution. + +For `credit`-type accounts, the `available` balance typically equals the `limit` less the `current` balance, less any pending outflows plus any pending inflows. + +For `depository`-type accounts, the `available` balance typically equals the `current` balance less any pending outflows plus any pending inflows. For `depository`-type accounts, the `available` balance does not include the overdraft limit. + +For `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the `available` balance is the total cash available to withdraw as presented by the institution. + +Note that not all institutions calculate the `available` balance. In the event that `available` balance is unavailable, Plaid will return an `available` balance value of `null`. + +Available balance may be cached and is not guaranteed to be up-to-date in realtime unless the value was returned by `/accounts/balance/get`. + +If `current` is `null` this field is guaranteed not to be `null`.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available: Option, + ///The average historical balance for the entire report + #[serde(default, skip_serializing_if = "Option::is_none")] + pub average_balance: Option, + ///The average historical balance of each calendar month + #[serde(default, skip_serializing_if = "Option::is_none")] + pub average_monthly_balances: Option>, + /**The total amount of funds in or owed by the account. + +For `credit`-type accounts, a positive balance indicates the amount owed; a negative amount indicates the lender owing the account holder. + +For `loan`-type accounts, the current balance is the principal remaining on the loan, except in the case of student loan accounts at Sallie Mae (`ins_116944`). For Sallie Mae student loans, the account's balance includes both principal and any outstanding interest. + +For `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the current balance is the total value of assets as presented by the institution. + +Note that balance information may be cached unless the value was returned by `/accounts/balance/get`; if the Item is enabled for Transactions, the balance will be at least as recent as the most recent Transaction update. If you require realtime balance information, use the `available` balance as provided by `/accounts/balance/get`. + +When returned by `/accounts/balance/get`, this field may be `null`. When this happens, `available` is guaranteed not to be `null`.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current: Option, + ///The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the oldest acceptable balance when making a request to `/accounts/balance/get`. + +This field is only used and expected when the institution is `ins_128026` (Capital One) and the Item contains one or more accounts with a non-depository account type, in which case a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For Capital One depository accounts as well as all other account types on all other institutions, this field is ignored. See [account type schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full list of account types. + +If the balance that is pulled is older than the given timestamp for Items with this field required, an `INVALID_REQUEST` error with the code of `LAST_UPDATED_DATETIME_OUT_OF_RANGE` will be returned with the most recent timestamp for the requested account contained in the response.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_updated_datetime: Option>, + /**For `credit`-type accounts, this represents the credit limit. + +For `depository`-type accounts, this represents the pre-arranged overdraft limit, which is common for current (checking) accounts in Europe. + +In North America, this field is typically only available for `credit`-type accounts.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub limit: Option, + ///The average historical balance from the most recent 30 days + #[serde(default, skip_serializing_if = "Option::is_none")] + pub most_recent_thirty_day_average_balance: Option, + /**The unofficial currency code associated with the balance. Always null if `iso_currency_code` is non-null. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. + +See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} impl std::fmt::Display for BaseReportAccountBalances { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_account_insights.rs b/src/model/base_report_account_insights.rs index 305953f0..5c02ef9a 100644 --- a/src/model/base_report_account_insights.rs +++ b/src/model/base_report_account_insights.rs @@ -9,28 +9,37 @@ pub struct BaseReportAccountInsights { ///Average number of days between sequential transactions #[serde(default, skip_serializing_if = "Option::is_none")] pub average_days_between_transactions: Option, - ///Average amount of debit transactions into account. This field will be null for non-depository accounts. This field only takes into account USD transactions from the account. + ///Deprecated; use `average_inflow_amounts` instead. Average amount of debit transactions into the account. This array will be empty for non-depository accounts. This field only takes into account USD transactions from the account. #[serde(default, skip_serializing_if = "Option::is_none")] pub average_inflow_amount: Option>, - ///Average amount of credit transactions into account. This field will be null for non-depository accounts. This field only takes into account USD transactions from the account. + ///Customers must transition from `average_inflow_amount` by January 31st 2025. Average amount of debit transactions into the account in a time period. This array will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub average_inflow_amounts: Option>, + ///Deprecated; use `average_outflow_amounts` instead. Average amount of transactions out of the account. This array will be empty for non-depository accounts. This field only takes into account USD transactions from the account. #[serde(default, skip_serializing_if = "Option::is_none")] pub average_outflow_amount: Option>, + ///Customers must transition from `average_outflow_amount` by January 31st 2025. Average amount of transactions out of the account in a time period. This array will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub average_outflow_amounts: Option>, ///Number of days days available in the base report for the account. #[serde(default, skip_serializing_if = "Option::is_none")] pub days_available: Option, - ///Longest gap between sequential transactions + ///Deprecated; use `longest_gaps_between_transactions` instead. Longest gap between sequential transactions #[serde(default, skip_serializing_if = "Option::is_none")] pub longest_gap_between_transactions: Option>, + ///Customers must transition from `longest_gap_between_transactions` by January 31st 2025. Longest gap between sequential transactions in a time period. This array can include multiple time periods. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub longest_gaps_between_transactions: Option>, ///Date of the most recent transaction in the base report for the account. #[serde(default, skip_serializing_if = "Option::is_none")] pub most_recent_transaction_date: Option, ///Number of days with no transactions #[serde(default, skip_serializing_if = "Option::is_none")] pub number_of_days_no_transactions: Option, - ///The number of debits into the account. This field will be null for non-depository accounts. + ///The number of debits into the account. This array will be empty for non-depository accounts. #[serde(default, skip_serializing_if = "Option::is_none")] pub number_of_inflows: Option>, - ///The number of credit into the account. This field will be null for non-depository accounts. + ///The number of outflows from the account. This array will be empty for non-depository accounts. #[serde(default, skip_serializing_if = "Option::is_none")] pub number_of_outflows: Option>, ///Date of the earliest transaction in the base report for the account. @@ -41,4 +50,4 @@ impl std::fmt::Display for BaseReportAccountInsights { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_account_metadata.rs b/src/model/base_report_account_metadata.rs new file mode 100644 index 00000000..8fd10368 --- /dev/null +++ b/src/model/base_report_account_metadata.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///Base Report metadata about the extracted account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BaseReportAccountMetadata { + ///The date of the most recent extracted transaction, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ("yyyy-mm-dd"). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + ///The date of the earliest extracted transaction, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ("yyyy-mm-dd"). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, +} +impl std::fmt::Display for BaseReportAccountMetadata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/base_report_attributes.rs b/src/model/base_report_attributes.rs new file mode 100644 index 00000000..e0797e0d --- /dev/null +++ b/src/model/base_report_attributes.rs @@ -0,0 +1,54 @@ +use serde::{Serialize, Deserialize}; +use super::{ + TotalInflowAmount, TotalInflowAmount30D, TotalInflowAmount60D, TotalInflowAmount90D, + TotalOutflowAmount, TotalOutflowAmount30D, TotalOutflowAmount60D, + TotalOutflowAmount90D, +}; +///Calculated attributes derived from transaction-level data. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BaseReportAttributes { + ///Prediction indicator of whether the account is a primary account. Only one account per account type across the items connected will have a value of true. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_primary_account: Option, + ///The number of NSF and overdraft fee transactions in the time range for the report in the given account. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nsf_overdraft_transactions_count: Option, + ///Value ranging from 0-1. The higher the score, the more confident we are of the account being the primary account. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub primary_account_score: Option, + ///Total amount of debit transactions into the account in the time period of the report. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_inflow_amount: Option, + ///Total amount of debit transactions into the account in the last 30 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(rename = "total_inflow_amount_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_inflow_amount30_d: Option, + ///Total amount of debit transactions into the account in the last 60 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(rename = "total_inflow_amount_60d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_inflow_amount60_d: Option, + ///Total amount of debit transactions into the account in the last 90 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(rename = "total_inflow_amount_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_inflow_amount90_d: Option, + ///Total amount of credit transactions into the account in the time period of the report. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_outflow_amount: Option, + ///Total amount of credit transactions into the account in the last 30 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(rename = "total_outflow_amount_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_outflow_amount30_d: Option, + ///Total amount of credit transactions into the account in the last 60 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(rename = "total_outflow_amount_60d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_outflow_amount60_d: Option, + ///Total amount of credit transactions into the account in the last 90 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. + #[serde(rename = "total_outflow_amount_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_outflow_amount90_d: Option, +} +impl std::fmt::Display for BaseReportAttributes { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/base_report_average_flow_insights.rs b/src/model/base_report_average_flow_insights.rs index 6b8308fa..6e8730d5 100644 --- a/src/model/base_report_average_flow_insights.rs +++ b/src/model/base_report_average_flow_insights.rs @@ -1,22 +1,19 @@ use serde::{Serialize, Deserialize}; use super::CreditAmountWithCurrency; -///Average dollar amount of credit or debit transactions out of the account. This field will only added for depository accounts +///Average dollar amount of credit or debit transactions out of the account. This field will only be included for depository accounts. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct BaseReportAverageFlowInsights { /**The end date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, + pub end_date: chrono::NaiveDate, /**The start date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, + pub start_date: chrono::NaiveDate, ///This contains an amount, denominated in the currency specified by either `iso_currency_code` or `unofficial_currency_code` - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_amount: Option, + pub total_amount: CreditAmountWithCurrency, } impl std::fmt::Display for BaseReportAverageFlowInsights { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_average_monthly_balances.rs b/src/model/base_report_average_monthly_balances.rs new file mode 100644 index 00000000..7625d310 --- /dev/null +++ b/src/model/base_report_average_monthly_balances.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::CreditAmountWithCurrency; +///Average balance in dollar amount per month +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BaseReportAverageMonthlyBalances { + ///This contains an amount, denominated in the currency specified by either `iso_currency_code` or `unofficial_currency_code` + pub average_balance: CreditAmountWithCurrency, + /**The end date of this time period. +The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ + pub end_date: String, + /**The start date of this time period. +The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ + pub start_date: String, +} +impl std::fmt::Display for BaseReportAverageMonthlyBalances { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/base_report_historical_balance.rs b/src/model/base_report_historical_balance.rs new file mode 100644 index 00000000..0f2940de --- /dev/null +++ b/src/model/base_report_historical_balance.rs @@ -0,0 +1,24 @@ +use serde::{Serialize, Deserialize}; +///An object representing a balance held by an account in the past +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BaseReportHistoricalBalance { + /**The total amount of funds in the account, calculated from the `current` balance in the `balance` object by subtracting inflows and adding back outflows according to the posted date of each transaction. + +If the account has any pending transactions, historical balance amounts on or after the date of the earliest pending transaction may differ if retrieved in subsequent Asset Reports as a result of those pending transactions posting.*/ + pub current: f64, + ///The date of the calculated historical balance, in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD) + pub date: chrono::NaiveDate, + ///The ISO-4217 currency code of the balance. Always `null` if `unofficial_currency_code` is non-`null`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**The unofficial currency code associated with the balance. Always `null` if `iso_currency_code` is non-`null`. + +See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for BaseReportHistoricalBalance { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/base_report_item.rs b/src/model/base_report_item.rs index adf8c802..53d44eef 100644 --- a/src/model/base_report_item.rs +++ b/src/model/base_report_item.rs @@ -12,9 +12,11 @@ pub struct BaseReportItem { pub institution_id: String, ///The full financial institution name associated with the Item. pub institution_name: String, + ///The `item_id` of the Item associated with this webhook, warning, or error + pub item_id: String, } impl std::fmt::Display for BaseReportItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_longest_gap_insights.rs b/src/model/base_report_longest_gap_insights.rs index 36e83e02..7dbc5184 100644 --- a/src/model/base_report_longest_gap_insights.rs +++ b/src/model/base_report_longest_gap_insights.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for BaseReportLongestGapInsights { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_number_flow_insights.rs b/src/model/base_report_number_flow_insights.rs index 2400178e..980fd197 100644 --- a/src/model/base_report_number_flow_insights.rs +++ b/src/model/base_report_number_flow_insights.rs @@ -1,21 +1,18 @@ use serde::{Serialize, Deserialize}; -///The number of credits or debits out of the account. This field will only added for depository accounts +///The number of credits or debits out of the account. This field will only be included for depository accounts. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct BaseReportNumberFlowInsights { ///The number of credits or debits out of the account for this time period. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub count: Option, + pub count: i64, /**The end date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, + pub end_date: chrono::NaiveDate, /**The start date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, + pub start_date: chrono::NaiveDate, } impl std::fmt::Display for BaseReportNumberFlowInsights { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_transaction.rs b/src/model/base_report_transaction.rs index 99f96e34..0ce17484 100644 --- a/src/model/base_report_transaction.rs +++ b/src/model/base_report_transaction.rs @@ -1,13 +1,21 @@ use serde::{Serialize, Deserialize}; -use super::{CreditCategory, Location}; +use super::{BaseReportTransactionType, CreditCategory, Location}; ///A transaction on the Base Report -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BaseReportTransaction { + ///The ID of the account in which this transaction occurred. + pub account_id: String, ///The name of the account owner. This field is not typically populated and only relevant when dealing with sub-accounts. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_owner: Option, ///The settled value of the transaction, denominated in the transaction's currency, as stated in `iso_currency_code` or `unofficial_currency_code`. Positive values when money moves out of the account; negative values when money moves in. For example, debit card purchases are positive; credit card payments, direct deposits, and refunds are negative. pub amount: f64, + ///A hierarchical array of the categories to which this transaction belongs. For a full list of categories, see [`/categories/get`](https://plaid.com/docs/api/products/transactions/#categoriesget). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category: Option>, + ///The ID of the category to which this transaction belongs. For a full list of categories, see [`/categories/get`](https://plaid.com/docs/api/products/transactions/#categoriesget). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub category_id: Option, ///The check number of the transaction. This field is only populated for check transactions. #[serde(default, skip_serializing_if = "Option::is_none")] pub check_number: Option, @@ -35,6 +43,17 @@ See the [`taxonomy csv file`](https://plaid.com/documents/credit-category-taxono pub original_description: Option, ///When `true`, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. pub pending: bool, + ///The unique ID of the transaction. Like all Plaid identifiers, the `transaction_id` is case sensitive. + pub transaction_id: String, + /**`digital:` transactions that took place online. + +`place:` transactions that were made at a physical location. + +`special:` transactions that relate to banks, e.g. fees or deposits. + +`unresolved:` transactions that do not fit into the other types.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub transaction_type: Option, /**The unofficial currency code associated with the transaction. Always `null` if `iso_currency_code` is non-`null`. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.*/ @@ -45,4 +64,4 @@ impl std::fmt::Display for BaseReportTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_transaction_type.rs b/src/model/base_report_transaction_type.rs new file mode 100644 index 00000000..77c41b2a --- /dev/null +++ b/src/model/base_report_transaction_type.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +/**`digital:` transactions that took place online. + +`place:` transactions that were made at a physical location. + +`special:` transactions that relate to banks, e.g. fees or deposits. + +`unresolved:` transactions that do not fit into the other types.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BaseReportTransactionType { + #[serde(rename = "digital")] + Digital, + #[serde(rename = "place")] + Place, + #[serde(rename = "special")] + Special, + #[serde(rename = "unresolved")] + Unresolved, +} diff --git a/src/model/base_report_warning.rs b/src/model/base_report_warning.rs index 87e944ff..d07a29f6 100644 --- a/src/model/base_report_warning.rs +++ b/src/model/base_report_warning.rs @@ -1,12 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::Cause; -///It is possible for an Base Report to be returned with missing account owner information. In such cases, the Base Report will contain warning data in the response, indicating why obtaining the owner information failed. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::{BaseReportWarningCode, Cause}; +///It is possible for a Base Report to be returned with missing account owner information. In such cases, the Base Report will contain warning data in the response, indicating why obtaining the owner information failed. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BaseReportWarning { ///An error object and associated `item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items. - pub cause: Cause, - ///The warning code identifies a specific kind of warning. `OWNERS_UNAVAILABLE` indicates that account-owner information is not available. `TRANSACTIONS_UNAVAILABLE` indicates that transactions information associated with Credit and Depository accounts are unavailable. - pub warning_code: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cause: Option, + ///The warning code identifies a specific kind of warning. `OWNERS_UNAVAILABLE` indicates that account-owner information is not available. `TRANSACTIONS_UNAVAILABLE` indicates that transactions information associated with Credit and Depository accounts are unavailable. `USER_FRAUD_ALERT` indicates that the User has placed a fraud alert on their Plaid Check consumer report due to suspected fraud. + pub warning_code: BaseReportWarningCode, ///The warning type, which will always be `BASE_REPORT_WARNING` pub warning_type: String, } @@ -14,4 +15,4 @@ impl std::fmt::Display for BaseReportWarning { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_report_warning_code.rs b/src/model/base_report_warning_code.rs new file mode 100644 index 00000000..8ba27092 --- /dev/null +++ b/src/model/base_report_warning_code.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///The warning code identifies a specific kind of warning. `OWNERS_UNAVAILABLE` indicates that account-owner information is not available. `TRANSACTIONS_UNAVAILABLE` indicates that transactions information associated with Credit and Depository accounts are unavailable. `USER_FRAUD_ALERT` indicates that the User has placed a fraud alert on their Plaid Check consumer report due to suspected fraud. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BaseReportWarningCode { + #[serde(rename = "OWNERS_UNAVAILABLE")] + OwnersUnavailable, + #[serde(rename = "TRANSACTIONS_UNAVAILABLE")] + TransactionsUnavailable, + #[serde(rename = "USER_FRAUD_ALERT")] + UserFraudAlert, +} diff --git a/src/model/base_reports_error_webhook.rs b/src/model/base_reports_error_webhook.rs index 70b8b748..5c37ea2a 100644 --- a/src/model/base_reports_error_webhook.rs +++ b/src/model/base_reports_error_webhook.rs @@ -1,11 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired when Base Report generation has failed. The resulting `error` will have an `error_type` of `BASE_REPORT_ERROR`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BaseReportsErrorWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `user_id` corresponding to the User ID the webhook has fired for. @@ -19,4 +19,4 @@ impl std::fmt::Display for BaseReportsErrorWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/base_reports_product_ready_webhook.rs b/src/model/base_reports_product_ready_webhook.rs index f796381d..babf7372 100644 --- a/src/model/base_reports_product_ready_webhook.rs +++ b/src/model/base_reports_product_ready_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when the Base Report has been generated and `/cra/base_report/get` is ready to be called. If you attempt to retrieve a Base Report before this webhook has fired, you’ll receive a response with the HTTP status code 400 and a Plaid error code of `PRODUCT_NOT_READY`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BaseReportsProductReadyWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The `user_id` corresponding to the User ID the webhook has fired for. pub user_id: String, ///`PRODUCT_READY` @@ -15,4 +16,4 @@ impl std::fmt::Display for BaseReportsProductReadyWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_account_risk_attributes.rs b/src/model/beacon_account_risk_attributes.rs new file mode 100644 index 00000000..943399e9 --- /dev/null +++ b/src/model/beacon_account_risk_attributes.rs @@ -0,0 +1,121 @@ +use serde::{Serialize, Deserialize}; +/**The attributes object contains data that can be used to assess account risk. Examples of data include: +`days_since_first_plaid_connection`: The number of days since the first time the Item was connected to an application via Plaid +`plaid_connections_count_7d`: The number of times the Item has been connected to applications via Plaid over the past 7 days +`plaid_connections_count_30d`: The number of times the Item has been connected to applications via Plaid over the past 30 days +`total_plaid_connections_count`: The number of times the Item has been connected to applications via Plaid +For the full list and detailed documentation of core attributes available, or to request that core attributes not be returned, contact Sales or your Plaid account manager*/ +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BeaconAccountRiskAttributes { + ///The number of times the account's addresses on file have changed over the past 28 days + #[serde(rename = "address_change_count_28d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_change_count28_d: Option, + ///The number of times the account's addresses on file have changed over the past 90 days + #[serde(rename = "address_change_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_change_count90_d: Option, + ///The number of days since the bank account was opened, as reported by the financial institution + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_since_account_opening: Option, + ///The number of days since the oldest transaction available to Plaid for this account. This measure, combined with Plaid connection history, can be used to infer the age of the account + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_since_first_observed_transaction: Option, + ///The number of days since the first time the Item was connected to an application via Plaid + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_since_first_plaid_connection: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 30 days + #[serde(rename = "distinct_ip_addresses_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count30_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 3 days + #[serde(rename = "distinct_ip_addresses_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count3_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 7 days + #[serde(rename = "distinct_ip_addresses_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count7_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 90 days + #[serde(rename = "distinct_ip_addresses_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count90_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 30 days + #[serde(rename = "distinct_user_agents_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count30_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 3 days + #[serde(rename = "distinct_user_agents_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count3_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 7 days + #[serde(rename = "distinct_user_agents_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count7_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 90 days + #[serde(rename = "distinct_user_agents_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count90_d: Option, + ///The number of times the account's email addresses on file have changed over the past 28 days + #[serde(rename = "email_change_count_28d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email_change_count28_d: Option, + ///The number of times the account's email addresses on file have changed over the past 90 days + #[serde(rename = "email_change_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email_change_count90_d: Option, + ///The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 30 days + #[serde(rename = "failed_plaid_non_oauth_authentication_attempts_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failed_plaid_non_oauth_authentication_attempts_count30_d: Option, + ///The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 3 days + #[serde(rename = "failed_plaid_non_oauth_authentication_attempts_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failed_plaid_non_oauth_authentication_attempts_count3_d: Option, + ///The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 7 days + #[serde(rename = "failed_plaid_non_oauth_authentication_attempts_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failed_plaid_non_oauth_authentication_attempts_count7_d: Option, + ///Indicates if the account has been closed by the financial institution or the consumer, or is at risk of being closed + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_account_closed: Option, + ///Indicates whether the account has withdrawals and transfers disabled or if access to the account is restricted. This could be due to a freeze by the credit issuer, legal restrictions (e.g., sanctions), or regulatory requirements limiting monthly withdrawals, among other reasons + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_account_frozen_or_restricted: Option, + ///The number of times the account's phone numbers on file have changed over the past 28 days + #[serde(rename = "phone_change_count_28d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_change_count28_d: Option, + ///The number of times the account's phone numbers on file have changed over the past 90 days + #[serde(rename = "phone_change_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_change_count90_d: Option, + ///The number of times the Item has been connected to applications via Plaid over the past 30 days + #[serde(rename = "plaid_connections_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_connections_count30_d: Option, + ///The number of times the Item has been connected to applications via Plaid over the past 7 days + #[serde(rename = "plaid_connections_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_connections_count7_d: Option, + ///The number of non-OAuth authentication attempts via Plaid for this bank account over the past 30 days + #[serde(rename = "plaid_non_oauth_authentication_attempts_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_non_oauth_authentication_attempts_count30_d: Option, + ///The number of non-OAuth authentication attempts via Plaid for this bank account over the past 3 days + #[serde(rename = "plaid_non_oauth_authentication_attempts_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_non_oauth_authentication_attempts_count3_d: Option, + ///The number of non-OAuth authentication attempts via Plaid for this bank account over the past 7 days + #[serde(rename = "plaid_non_oauth_authentication_attempts_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_non_oauth_authentication_attempts_count7_d: Option, + ///The total number of times the item has been connected to applications via Plaid + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_plaid_connections_count: Option, +} +impl std::fmt::Display for BeaconAccountRiskAttributes { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_account_risk_evaluate_account.rs b/src/model/beacon_account_risk_evaluate_account.rs new file mode 100644 index 00000000..46187bbf --- /dev/null +++ b/src/model/beacon_account_risk_evaluate_account.rs @@ -0,0 +1,39 @@ +use serde::{Serialize, Deserialize}; +use super::{AccountSubtype, AccountType, BeaconAccountRiskEvaluateAccountAttributes}; +///An account in the `/beacon/account_risk/v1/evaluate` response. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BeaconAccountRiskEvaluateAccount { + ///The account ID. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + /**The attributes object contains data that can be used to assess account risk. Examples of data include: +`days_since_first_plaid_connection`: The number of days since the first time the Item was connected to an application via Plaid +`plaid_connections_count_7d`: The number of times the Item has been connected to applications via Plaid over the past 7 days +`plaid_connections_count_30d`: The number of times the Item has been connected to applications via Plaid over the past 30 days +`total_plaid_connections_count`: The number of times the Item has been connected to applications via Plaid +For the full list and detailed documentation of core attributes available, or to request that core attributes not be returned, contact Sales or your Plaid account manager*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attributes: Option, + ///See the [Account type schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subtype: Option, + /**`investment:` Investment account. In API versions 2018-05-22 and earlier, this type is called `brokerage` instead. + +`credit:` Credit card + +`depository:` Depository account + +`loan:` Loan account + +`other:` Non-specified account type + +See the [Account type schema](https://plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.*/ + #[serde(rename = "type")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl std::fmt::Display for BeaconAccountRiskEvaluateAccount { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_account_risk_evaluate_account_attributes.rs b/src/model/beacon_account_risk_evaluate_account_attributes.rs new file mode 100644 index 00000000..5b4447db --- /dev/null +++ b/src/model/beacon_account_risk_evaluate_account_attributes.rs @@ -0,0 +1,121 @@ +use serde::{Serialize, Deserialize}; +/**The attributes object contains data that can be used to assess account risk. Examples of data include: +`days_since_first_plaid_connection`: The number of days since the first time the Item was connected to an application via Plaid +`plaid_connections_count_7d`: The number of times the Item has been connected to applications via Plaid over the past 7 days +`plaid_connections_count_30d`: The number of times the Item has been connected to applications via Plaid over the past 30 days +`total_plaid_connections_count`: The number of times the Item has been connected to applications via Plaid +For the full list and detailed documentation of core attributes available, or to request that core attributes not be returned, contact Sales or your Plaid account manager*/ +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BeaconAccountRiskEvaluateAccountAttributes { + ///The number of times the account's addresses on file have changed over the past 28 days + #[serde(rename = "address_change_count_28d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_change_count28_d: Option, + ///The number of times the account's addresses on file have changed over the past 90 days + #[serde(rename = "address_change_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address_change_count90_d: Option, + ///The number of days since the bank account was opened, as reported by the financial institution + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_since_account_opening: Option, + ///The number of days since the oldest transaction available to Plaid for this account. This measure, combined with Plaid connection history, can be used to infer the age of the account + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_since_first_observed_transaction: Option, + ///The number of days since the first time the Item was connected to an application via Plaid + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_since_first_plaid_connection: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 30 days + #[serde(rename = "distinct_ip_addresses_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count30_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 3 days + #[serde(rename = "distinct_ip_addresses_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count3_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 7 days + #[serde(rename = "distinct_ip_addresses_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count7_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 90 days + #[serde(rename = "distinct_ip_addresses_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count90_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 30 days + #[serde(rename = "distinct_user_agents_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count30_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 3 days + #[serde(rename = "distinct_user_agents_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count3_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 7 days + #[serde(rename = "distinct_user_agents_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count7_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 90 days + #[serde(rename = "distinct_user_agents_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count90_d: Option, + ///The number of times the account's email addresses on file have changed over the past 28 days + #[serde(rename = "email_change_count_28d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email_change_count28_d: Option, + ///The number of times the account's email addresses on file have changed over the past 90 days + #[serde(rename = "email_change_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email_change_count90_d: Option, + ///The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 30 days + #[serde(rename = "failed_plaid_non_oauth_authentication_attempts_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failed_plaid_non_oauth_authentication_attempts_count30_d: Option, + ///The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 3 days + #[serde(rename = "failed_plaid_non_oauth_authentication_attempts_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failed_plaid_non_oauth_authentication_attempts_count3_d: Option, + ///The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 7 days + #[serde(rename = "failed_plaid_non_oauth_authentication_attempts_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub failed_plaid_non_oauth_authentication_attempts_count7_d: Option, + ///Indicates if the account has been closed by the financial institution or the consumer, or is at risk of being closed + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_account_closed: Option, + ///Indicates whether the account has withdrawals and transfers disabled or if access to the account is restricted. This could be due to a freeze by the credit issuer, legal restrictions (e.g., sanctions), or regulatory requirements limiting monthly withdrawals, among other reasons + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_account_frozen_or_restricted: Option, + ///The number of times the account's phone numbers on file have changed over the past 28 days + #[serde(rename = "phone_change_count_28d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_change_count28_d: Option, + ///The number of times the account's phone numbers on file have changed over the past 90 days + #[serde(rename = "phone_change_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_change_count90_d: Option, + ///The number of times the Item has been connected to applications via Plaid over the past 30 days + #[serde(rename = "plaid_connections_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_connections_count30_d: Option, + ///The number of times the Item has been connected to applications via Plaid over the past 7 days + #[serde(rename = "plaid_connections_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_connections_count7_d: Option, + ///The number of non-OAuth authentication attempts via Plaid for this bank account over the past 30 days + #[serde(rename = "plaid_non_oauth_authentication_attempts_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_non_oauth_authentication_attempts_count30_d: Option, + ///The number of non-OAuth authentication attempts via Plaid for this bank account over the past 3 days + #[serde(rename = "plaid_non_oauth_authentication_attempts_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_non_oauth_authentication_attempts_count3_d: Option, + ///The number of non-OAuth authentication attempts via Plaid for this bank account over the past 7 days + #[serde(rename = "plaid_non_oauth_authentication_attempts_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_non_oauth_authentication_attempts_count7_d: Option, + ///The total number of times the item has been connected to applications via Plaid + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_plaid_connections_count: Option, +} +impl std::fmt::Display for BeaconAccountRiskEvaluateAccountAttributes { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_account_risk_evaluate_evaluation_reason.rs b/src/model/beacon_account_risk_evaluate_evaluation_reason.rs new file mode 100644 index 00000000..f781e95c --- /dev/null +++ b/src/model/beacon_account_risk_evaluate_evaluation_reason.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +/**Description of the reason you want to evaluate risk. +`ONBOARDING`: user links a first bank account as part of the onboarding flow of your platform. +`NEW_ACCOUNT`: user links another bank account or replaces the currently linked bank account on your platform. +`INFORMATION_CHANGE`: user changes their information on your platform, e.g., updating their phone number. +`DORMANT_USER`: you decide to re-evaluate a user that becomes active after a period of inactivity. +`OTHER`: any other reasons not listed here +Possible values: `ONBOARDING`, `NEW_ACCOUNT`, `INFORMATION_CHANGE`, `DORMANT_USER`, `OTHER`*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BeaconAccountRiskEvaluateEvaluationReason { + #[serde(rename = "ONBOARDING")] + Onboarding, + #[serde(rename = "NEW_ACCOUNT")] + NewAccount, + #[serde(rename = "INFORMATION_CHANGE")] + InformationChange, + #[serde(rename = "DORMANT_USER")] + DormantUser, + #[serde(rename = "OTHER")] + Other, +} diff --git a/src/model/beacon_account_risk_evaluate_request_options.rs b/src/model/beacon_account_risk_evaluate_request_options.rs new file mode 100644 index 00000000..a81772ba --- /dev/null +++ b/src/model/beacon_account_risk_evaluate_request_options.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///An optional object to filter `/beacon/account_risk/v1/evaluate` results to a subset of the accounts on the linked Item. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BeaconAccountRiskEvaluateRequestOptions { + ///An array of `account_ids` for the specific accounts to evaluate. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_ids: Option>, +} +impl std::fmt::Display for BeaconAccountRiskEvaluateRequestOptions { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_account_risk_evaluate_response.rs b/src/model/beacon_account_risk_evaluate_response.rs new file mode 100644 index 00000000..ac73b7b6 --- /dev/null +++ b/src/model/beacon_account_risk_evaluate_response.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::BeaconAccountRiskEvaluateAccount; +///BeaconAccountRiskEvaluateResponse defines the response schema for `/beacon/account_risk/v1/evaluate` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BeaconAccountRiskEvaluateResponse { + ///The accounts for which a risk evaluation has been requested. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub accounts: Vec, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for BeaconAccountRiskEvaluateResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_audit_trail.rs b/src/model/beacon_audit_trail.rs index ef9de952..39fb77d8 100644 --- a/src/model/beacon_audit_trail.rs +++ b/src/model/beacon_audit_trail.rs @@ -1,8 +1,9 @@ use serde::{Serialize, Deserialize}; +use super::BeaconAuditTrailSource; ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconAuditTrail { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub dashboard_user_id: Option, /**A type indicating what caused a resource to be changed or updated. @@ -15,10 +16,12 @@ pub struct BeaconAuditTrail { `system` - The resource was created or updated automatically by a part of the Plaid Beacon system. For example, if another business using Plaid Beacon created a fraud report that matched one of your users, your matching user's status would automatically be updated and the audit trail source would be `system`. `bulk_import` - The resource was created or updated as part of a bulk import process. For example, if your company provided a CSV of user data as part of your initial onboarding, the audit trail source would be `bulk_import`.*/ - pub source: String, + pub source: BeaconAuditTrailSource, + ///An ISO8601 formatted timestamp. + pub timestamp: chrono::DateTime, } impl std::fmt::Display for BeaconAuditTrail { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_audit_trail_source.rs b/src/model/beacon_audit_trail_source.rs new file mode 100644 index 00000000..a403aa2d --- /dev/null +++ b/src/model/beacon_audit_trail_source.rs @@ -0,0 +1,22 @@ +use serde::{Serialize, Deserialize}; +/**A type indicating what caused a resource to be changed or updated. + + +`dashboard` - The resource was created or updated by a member of your team via the Plaid dashboard. + +`api` - The resource was created or updated via the Plaid API. + +`system` - The resource was created or updated automatically by a part of the Plaid Beacon system. For example, if another business using Plaid Beacon created a fraud report that matched one of your users, your matching user's status would automatically be updated and the audit trail source would be `system`. + +`bulk_import` - The resource was created or updated as part of a bulk import process. For example, if your company provided a CSV of user data as part of your initial onboarding, the audit trail source would be `bulk_import`.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BeaconAuditTrailSource { + #[serde(rename = "dashboard")] + Dashboard, + #[serde(rename = "api")] + Api, + #[serde(rename = "system")] + System, + #[serde(rename = "bulk_import")] + BulkImport, +} diff --git a/src/model/beacon_bank_account_insights.rs b/src/model/beacon_bank_account_insights.rs new file mode 100644 index 00000000..9ba51cda --- /dev/null +++ b/src/model/beacon_bank_account_insights.rs @@ -0,0 +1,36 @@ +use serde::{Serialize, Deserialize}; +use super::{AccountSubtype, AccountType, BeaconAccountRiskAttributes}; +///Bank Account Insights encapsulate the risk insights for a single Bank Account linked to an Item that is assocaited with a Beacon User. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BeaconBankAccountInsights { + ///The Plaid `account_id` + pub account_id: String, + /**The attributes object contains data that can be used to assess account risk. Examples of data include: +`days_since_first_plaid_connection`: The number of days since the first time the Item was connected to an application via Plaid +`plaid_connections_count_7d`: The number of times the Item has been connected to applications via Plaid over the past 7 days +`plaid_connections_count_30d`: The number of times the Item has been connected to applications via Plaid over the past 30 days +`total_plaid_connections_count`: The number of times the Item has been connected to applications via Plaid +For the full list and detailed documentation of core attributes available, or to request that core attributes not be returned, contact Sales or your Plaid account manager*/ + pub attributes: BeaconAccountRiskAttributes, + ///See the [Account type schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subtype: Option, + /**`investment:` Investment account. In API versions 2018-05-22 and earlier, this type is called `brokerage` instead. + +`credit:` Credit card + +`depository:` Depository account + +`loan:` Loan account + +`other:` Non-specified account type + +See the [Account type schema](https://plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.*/ + #[serde(rename = "type")] + pub type_: AccountType, +} +impl std::fmt::Display for BeaconBankAccountInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_bank_accounts.rs b/src/model/beacon_bank_accounts.rs new file mode 100644 index 00000000..8977ef88 --- /dev/null +++ b/src/model/beacon_bank_accounts.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::BeaconBankAccountInsights; +///A collection of Bank Accounts linked to an Item that is associated with this Beacon User. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BeaconBankAccounts { + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub accounts: Vec, + ///The Plaid Item ID the Bank Accounts belong to. + pub item_id: String, +} +impl std::fmt::Display for BeaconBankAccounts { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_duplicate_detected_webhook.rs b/src/model/beacon_duplicate_detected_webhook.rs index ea39887c..ccaab28a 100644 --- a/src/model/beacon_duplicate_detected_webhook.rs +++ b/src/model/beacon_duplicate_detected_webhook.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when a Beacon User created within your organization matches one of your existing users. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconDuplicateDetectedWebhook { ///The ID of the associated Beacon Duplicate. pub beacon_duplicate_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///`DUPLICATE_DETECTED` pub webhook_code: String, ///`BEACON` @@ -15,4 +16,4 @@ impl std::fmt::Display for BeaconDuplicateDetectedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_duplicate_get_response.rs b/src/model/beacon_duplicate_get_response.rs index 4c739f2c..b90ef7b4 100644 --- a/src/model/beacon_duplicate_get_response.rs +++ b/src/model/beacon_duplicate_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{BeaconMatchSummaryAnalysis, BeaconUserRevision}; ///A Beacon Duplicate represents a pair of matching Beacon Users and an analysis of the fields they matched on. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconDuplicateGetResponse { ///Analysis of which fields matched between one Beacon User and another. pub analysis: BeaconMatchSummaryAnalysis, @@ -18,4 +18,4 @@ impl std::fmt::Display for BeaconDuplicateGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_match_summary_analysis.rs b/src/model/beacon_match_summary_analysis.rs index e415675c..24a2eb19 100644 --- a/src/model/beacon_match_summary_analysis.rs +++ b/src/model/beacon_match_summary_analysis.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::BeaconMatchSummaryCode; ///Analysis of which fields matched between one Beacon User and another. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconMatchSummaryAnalysis { /**An enum indicating the match type between two Beacon Users. @@ -12,7 +13,7 @@ pub struct BeaconMatchSummaryAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub address: String, + pub address: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -23,7 +24,7 @@ pub struct BeaconMatchSummaryAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub date_of_birth: String, + pub date_of_birth: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -34,7 +35,7 @@ pub struct BeaconMatchSummaryAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub email_address: String, + pub email_address: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -45,7 +46,7 @@ pub struct BeaconMatchSummaryAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub id_number: String, + pub id_number: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -56,7 +57,7 @@ pub struct BeaconMatchSummaryAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub ip_address: String, + pub ip_address: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -67,7 +68,7 @@ pub struct BeaconMatchSummaryAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub name: String, + pub name: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -78,10 +79,10 @@ pub struct BeaconMatchSummaryAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub phone_number: String, + pub phone_number: BeaconMatchSummaryCode, } impl std::fmt::Display for BeaconMatchSummaryAnalysis { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_match_summary_code.rs b/src/model/beacon_match_summary_code.rs new file mode 100644 index 00000000..a3e56fe4 --- /dev/null +++ b/src/model/beacon_match_summary_code.rs @@ -0,0 +1,22 @@ +use serde::{Serialize, Deserialize}; +/**An enum indicating the match type between two Beacon Users. + + +`match` indicates that the provided input data was a strong match against the other Beacon User. + +`partial_match` indicates the data approximately matched the other Beacon User. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BeaconMatchSummaryCode { + #[serde(rename = "match")] + Match, + #[serde(rename = "partial_match")] + PartialMatch, + #[serde(rename = "no_match")] + NoMatch, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/beacon_report.rs b/src/model/beacon_report.rs index e8f73e7c..6110d484 100644 --- a/src/model/beacon_report.rs +++ b/src/model/beacon_report.rs @@ -1,12 +1,12 @@ use serde::{Serialize, Deserialize}; -use super::{BeaconAuditTrail, FraudAmount}; +use super::{BeaconAuditTrail, BeaconReportType, FraudAmount}; /**A Beacon Report describes the type of fraud committed by a user as well as the date the fraud was committed and the total amount of money lost due to the fraud incident. This information is used to block similar fraud attempts on your platform as well as alert other companies who screen a user with matching identity information. Other companies will not receive any new identity information, just what matched, plus information such as industry, type of fraud, and date of fraud. You can manage your fraud reports by adding, deleting, or editing reports as you get additional information on fraudulent users.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReport { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: BeaconAuditTrail, @@ -14,12 +14,15 @@ pub struct BeaconReport { pub beacon_user_id: String, ///An ISO8601 formatted timestamp. pub created_at: chrono::DateTime, + ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). + pub event_date: chrono::NaiveDate, /**The amount and currency of the fraud or attempted fraud. `fraud_amount` should be omitted to indicate an unknown fraud amount.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub fraud_amount: Option, ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - pub fraud_date: chrono::NaiveDate, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fraud_date: Option, ///ID of the associated Beacon Report. pub id: String, /**The type of Beacon Report. @@ -32,12 +35,14 @@ pub struct BeaconReport { `account_takeover`: If this individual's account was compromised. +`data_breach`: If this individual's data was compromised in a breach. + `unknown`: If you aren't sure who committed the fraud.*/ #[serde(rename = "type")] - pub type_: String, + pub type_: BeaconReportType, } impl std::fmt::Display for BeaconReport { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_create_response.rs b/src/model/beacon_report_create_response.rs index ff06715b..657be207 100644 --- a/src/model/beacon_report_create_response.rs +++ b/src/model/beacon_report_create_response.rs @@ -1,12 +1,12 @@ use serde::{Serialize, Deserialize}; -use super::{BeaconAuditTrail, FraudAmount}; +use super::{BeaconAuditTrail, BeaconReportType, FraudAmount}; /**A Beacon Report describes the type of fraud committed by a user as well as the date the fraud was committed and the total amount of money lost due to the fraud incident. This information is used to block similar fraud attempts on your platform as well as alert other companies who screen a user with matching identity information. Other companies will not receive any new identity information, just what matched, plus information such as industry, type of fraud, and date of fraud. You can manage your fraud reports by adding, deleting, or editing reports as you get additional information on fraudulent users.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReportCreateResponse { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: BeaconAuditTrail, @@ -14,12 +14,15 @@ pub struct BeaconReportCreateResponse { pub beacon_user_id: String, ///An ISO8601 formatted timestamp. pub created_at: chrono::DateTime, + ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). + pub event_date: chrono::NaiveDate, /**The amount and currency of the fraud or attempted fraud. `fraud_amount` should be omitted to indicate an unknown fraud amount.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub fraud_amount: Option, ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - pub fraud_date: chrono::NaiveDate, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fraud_date: Option, ///ID of the associated Beacon Report. pub id: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -34,12 +37,14 @@ pub struct BeaconReportCreateResponse { `account_takeover`: If this individual's account was compromised. +`data_breach`: If this individual's data was compromised in a breach. + `unknown`: If you aren't sure who committed the fraud.*/ #[serde(rename = "type")] - pub type_: String, + pub type_: BeaconReportType, } impl std::fmt::Display for BeaconReportCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_create_type.rs b/src/model/beacon_report_create_type.rs new file mode 100644 index 00000000..7efe7d4e --- /dev/null +++ b/src/model/beacon_report_create_type.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +/**The type of Beacon Report. + +`first_party`: If this is the same individual as the one who submitted the KYC. + +`stolen`: If this is a different individual from the one who submitted the KYC. + +`synthetic`: If this is an individual using fabricated information. + +`account_takeover`: If this individual's account was compromised. + +`unknown`: If you aren't sure who committed the fraud.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BeaconReportCreateType { + #[serde(rename = "first_party")] + FirstParty, + #[serde(rename = "stolen")] + Stolen, + #[serde(rename = "synthetic")] + Synthetic, + #[serde(rename = "account_takeover")] + AccountTakeover, + #[serde(rename = "data_breach")] + DataBreach, + #[serde(rename = "unknown")] + Unknown, +} diff --git a/src/model/beacon_report_created_webhook.rs b/src/model/beacon_report_created_webhook.rs index f4b7a34c..a4d04ad5 100644 --- a/src/model/beacon_report_created_webhook.rs +++ b/src/model/beacon_report_created_webhook.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when one of your Beacon Users is first reported to the Beacon network. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReportCreatedWebhook { ///The ID of the associated Beacon Report. pub beacon_report_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///`REPORT_CREATED` pub webhook_code: String, ///`BEACON` @@ -15,4 +16,4 @@ impl std::fmt::Display for BeaconReportCreatedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_get_response.rs b/src/model/beacon_report_get_response.rs index 6453aa62..cb84b9d8 100644 --- a/src/model/beacon_report_get_response.rs +++ b/src/model/beacon_report_get_response.rs @@ -1,12 +1,12 @@ use serde::{Serialize, Deserialize}; -use super::{BeaconAuditTrail, FraudAmount}; +use super::{BeaconAuditTrail, BeaconReportType, FraudAmount}; /**A Beacon Report describes the type of fraud committed by a user as well as the date the fraud was committed and the total amount of money lost due to the fraud incident. This information is used to block similar fraud attempts on your platform as well as alert other companies who screen a user with matching identity information. Other companies will not receive any new identity information, just what matched, plus information such as industry, type of fraud, and date of fraud. You can manage your fraud reports by adding, deleting, or editing reports as you get additional information on fraudulent users.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReportGetResponse { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: BeaconAuditTrail, @@ -14,12 +14,15 @@ pub struct BeaconReportGetResponse { pub beacon_user_id: String, ///An ISO8601 formatted timestamp. pub created_at: chrono::DateTime, + ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). + pub event_date: chrono::NaiveDate, /**The amount and currency of the fraud or attempted fraud. `fraud_amount` should be omitted to indicate an unknown fraud amount.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub fraud_amount: Option, ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - pub fraud_date: chrono::NaiveDate, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fraud_date: Option, ///ID of the associated Beacon Report. pub id: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -34,12 +37,14 @@ pub struct BeaconReportGetResponse { `account_takeover`: If this individual's account was compromised. +`data_breach`: If this individual's data was compromised in a breach. + `unknown`: If you aren't sure who committed the fraud.*/ #[serde(rename = "type")] - pub type_: String, + pub type_: BeaconReportType, } impl std::fmt::Display for BeaconReportGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_list_response.rs b/src/model/beacon_report_list_response.rs index 44f2594a..4a268bf5 100644 --- a/src/model/beacon_report_list_response.rs +++ b/src/model/beacon_report_list_response.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for BeaconReportListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_syndication.rs b/src/model/beacon_report_syndication.rs index 88543111..23cf4d0a 100644 --- a/src/model/beacon_report_syndication.rs +++ b/src/model/beacon_report_syndication.rs @@ -5,7 +5,7 @@ use super::{BeaconReportSyndicationAnalysis, BeaconReportSyndicationOriginalRepo The `analysis` field in the response indicates which fields matched between the originally reported Beacon User and the Beacon User that the report was syndicated to. The `report` field in the response contains a subset of information from the original report.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReportSyndication { ///Analysis of which fields matched between the originally reported Beacon User and the Beacon User that the report was syndicated to. pub analysis: BeaconReportSyndicationAnalysis, @@ -20,4 +20,4 @@ impl std::fmt::Display for BeaconReportSyndication { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_syndication_analysis.rs b/src/model/beacon_report_syndication_analysis.rs index 4bf88431..88d589d7 100644 --- a/src/model/beacon_report_syndication_analysis.rs +++ b/src/model/beacon_report_syndication_analysis.rs @@ -1,6 +1,9 @@ use serde::{Serialize, Deserialize}; +use super::{ + BeaconMatchSummaryCode, BeaconSyndicatedReportDepositoryAccountMatchAnalysis, +}; ///Analysis of which fields matched between the originally reported Beacon User and the Beacon User that the report was syndicated to. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReportSyndicationAnalysis { /**An enum indicating the match type between two Beacon Users. @@ -12,7 +15,7 @@ pub struct BeaconReportSyndicationAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub address: String, + pub address: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -23,7 +26,9 @@ pub struct BeaconReportSyndicationAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub date_of_birth: String, + pub date_of_birth: BeaconMatchSummaryCode, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub depository_accounts: Vec, /**An enum indicating the match type between two Beacon Users. @@ -34,7 +39,7 @@ pub struct BeaconReportSyndicationAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub email_address: String, + pub email_address: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -45,7 +50,7 @@ pub struct BeaconReportSyndicationAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub id_number: String, + pub id_number: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -56,7 +61,7 @@ pub struct BeaconReportSyndicationAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub ip_address: String, + pub ip_address: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -67,7 +72,7 @@ pub struct BeaconReportSyndicationAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub name: String, + pub name: BeaconMatchSummaryCode, /**An enum indicating the match type between two Beacon Users. @@ -78,10 +83,10 @@ pub struct BeaconReportSyndicationAnalysis { `no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. `no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ - pub phone_number: String, + pub phone_number: BeaconMatchSummaryCode, } impl std::fmt::Display for BeaconReportSyndicationAnalysis { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_syndication_created_webhook.rs b/src/model/beacon_report_syndication_created_webhook.rs index b0413c2b..7c3439ac 100644 --- a/src/model/beacon_report_syndication_created_webhook.rs +++ b/src/model/beacon_report_syndication_created_webhook.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when a report created on the Beacon Network matches with one of your Beacon Users. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReportSyndicationCreatedWebhook { ///The ID of the associated Beacon Report Syndication. pub beacon_report_syndication_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///`REPORT_SYNDICATION_CREATED` pub webhook_code: String, ///`BEACON` @@ -15,4 +16,4 @@ impl std::fmt::Display for BeaconReportSyndicationCreatedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_syndication_get_response.rs b/src/model/beacon_report_syndication_get_response.rs index c23a80b7..e62d16fe 100644 --- a/src/model/beacon_report_syndication_get_response.rs +++ b/src/model/beacon_report_syndication_get_response.rs @@ -5,7 +5,7 @@ use super::{BeaconReportSyndicationAnalysis, BeaconReportSyndicationOriginalRepo The `analysis` field in the response indicates which fields matched between the originally reported Beacon User and the Beacon User that the report was syndicated to. The `report` field in the response contains a subset of information from the original report.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReportSyndicationGetResponse { ///Analysis of which fields matched between the originally reported Beacon User and the Beacon User that the report was syndicated to. pub analysis: BeaconReportSyndicationAnalysis, @@ -22,4 +22,4 @@ impl std::fmt::Display for BeaconReportSyndicationGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_syndication_list_response.rs b/src/model/beacon_report_syndication_list_response.rs index d5d02040..56b6def9 100644 --- a/src/model/beacon_report_syndication_list_response.rs +++ b/src/model/beacon_report_syndication_list_response.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for BeaconReportSyndicationListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_syndication_original_report.rs b/src/model/beacon_report_syndication_original_report.rs index dc7f9e63..e656c9a8 100644 --- a/src/model/beacon_report_syndication_original_report.rs +++ b/src/model/beacon_report_syndication_original_report.rs @@ -1,13 +1,17 @@ use serde::{Serialize, Deserialize}; +use super::BeaconReportType; /**A subset of information from a Beacon Report that has been syndicated to a matching Beacon User in your program. The `id` field in the response is the ID of the original report that was syndicated. If the original report was created by your organization, the field will be filled with the ID of the report. Otherwise, the field will be `null` indicating that the original report was created by another Beacon customer.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReportSyndicationOriginalReport { ///An ISO8601 formatted timestamp. pub created_at: chrono::DateTime, ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - pub fraud_date: chrono::NaiveDate, + pub event_date: chrono::NaiveDate, + ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub fraud_date: Option, ///ID of the associated Beacon Report. #[serde(default, skip_serializing_if = "Option::is_none")] pub id: Option, @@ -21,12 +25,14 @@ pub struct BeaconReportSyndicationOriginalReport { `account_takeover`: If this individual's account was compromised. +`data_breach`: If this individual's data was compromised in a breach. + `unknown`: If you aren't sure who committed the fraud.*/ #[serde(rename = "type")] - pub type_: String, + pub type_: BeaconReportType, } impl std::fmt::Display for BeaconReportSyndicationOriginalReport { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_report_type.rs b/src/model/beacon_report_type.rs new file mode 100644 index 00000000..566939e0 --- /dev/null +++ b/src/model/beacon_report_type.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +/**The type of Beacon Report. + +`first_party`: If this is the same individual as the one who submitted the KYC. + +`stolen`: If this is a different individual from the one who submitted the KYC. + +`synthetic`: If this is an individual using fabricated information. + +`account_takeover`: If this individual's account was compromised. + +`data_breach`: If this individual's data was compromised in a breach. + +`unknown`: If you aren't sure who committed the fraud.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BeaconReportType { + #[serde(rename = "first_party")] + FirstParty, + #[serde(rename = "stolen")] + Stolen, + #[serde(rename = "synthetic")] + Synthetic, + #[serde(rename = "account_takeover")] + AccountTakeover, + #[serde(rename = "data_breach")] + DataBreach, + #[serde(rename = "unknown")] + Unknown, +} diff --git a/src/model/beacon_report_updated_webhook.rs b/src/model/beacon_report_updated_webhook.rs index be5228c9..b6af6154 100644 --- a/src/model/beacon_report_updated_webhook.rs +++ b/src/model/beacon_report_updated_webhook.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when one of your existing Beacon Reports has been modified or removed from the Beacon Network. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconReportUpdatedWebhook { ///The ID of the associated Beacon Report. pub beacon_report_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///`REPORT_UPDATED` pub webhook_code: String, ///`BEACON` @@ -15,4 +16,4 @@ impl std::fmt::Display for BeaconReportUpdatedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_syndicated_report_depository_account_match_analysis.rs b/src/model/beacon_syndicated_report_depository_account_match_analysis.rs new file mode 100644 index 00000000..4e3f8dd7 --- /dev/null +++ b/src/model/beacon_syndicated_report_depository_account_match_analysis.rs @@ -0,0 +1,26 @@ +use serde::{Serialize, Deserialize}; +use super::BeaconMatchSummaryCode; +///Analysis of whether this account matched between the originally reported Beacon User and the Beacon User that the report syndicated to. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BeaconSyndicatedReportDepositoryAccountMatchAnalysis { + ///The last 2-4 numeric characters of this account’s account number. + pub account_mask: String, + /**An enum indicating the match type between two Beacon Users. + + +`match` indicates that the provided input data was a strong match against the other Beacon User. + +`partial_match` indicates the data approximately matched the other Beacon User. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to compare this field against the other Beacon User and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to compare this field against the original Beacon User because the field was not present in one of the Beacon Users.*/ + pub match_status: BeaconMatchSummaryCode, + ///The routing number of the account. + pub routing_number: String, +} +impl std::fmt::Display for BeaconSyndicatedReportDepositoryAccountMatchAnalysis { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_user.rs b/src/model/beacon_user.rs new file mode 100644 index 00000000..f5dbf3e0 --- /dev/null +++ b/src/model/beacon_user.rs @@ -0,0 +1,38 @@ +use serde::{Serialize, Deserialize}; +use super::{BeaconAuditTrail, BeaconUserData, BeaconUserStatus}; +///A Beacon User represents an end user that has been scanned against the Beacon Network. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BeaconUser { + ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. + pub audit_trail: BeaconAuditTrail, + ///A unique ID that identifies the end user in your system. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. + pub client_user_id: String, + ///An ISO8601 formatted timestamp. + pub created_at: chrono::DateTime, + ///ID of the associated Beacon User. + pub id: String, + ///An array of Plaid Item IDs corresponding to the Accounts associated with this Beacon User. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub item_ids: Vec, + ///ID of the associated Beacon Program. + pub program_id: String, + /**A status of a Beacon User. + +`rejected`: The Beacon User has been rejected for fraud. Users can be automatically or manually rejected. + +`pending_review`: The Beacon User has been marked for review. + +`cleared`: The Beacon User has been cleared of fraud.*/ + pub status: BeaconUserStatus, + ///An ISO8601 formatted timestamp. This field indicates the last time the resource was modified. + pub updated_at: chrono::DateTime, + ///A Beacon User's data and resulting analysis when checked against duplicate records and the Beacon Fraud Network. + pub user: BeaconUserData, + ///The `version` field begins with 1 and increments each time the user is updated. + pub version: i64, +} +impl std::fmt::Display for BeaconUser { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_user_account_insights_get_response.rs b/src/model/beacon_user_account_insights_get_response.rs new file mode 100644 index 00000000..a9fee1ca --- /dev/null +++ b/src/model/beacon_user_account_insights_get_response.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +use super::BeaconBankAccounts; +///The response schema for `/beacon/user/account/insights/get` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BeaconUserAccountInsightsGetResponse { + ///A collection of Bank Accounts linked to an Item that is associated with this Beacon User. + pub bank_account_insights: BeaconBankAccounts, + ///ID of the associated Beacon User. + pub beacon_user_id: String, + ///An ISO8601 formatted timestamp. + pub created_at: chrono::DateTime, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, + ///An ISO8601 formatted timestamp. This field indicates the last time the resource was modified. + pub updated_at: chrono::DateTime, +} +impl std::fmt::Display for BeaconUserAccountInsightsGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_user_address.rs b/src/model/beacon_user_address.rs index 550e6d42..50ed83f5 100644 --- a/src/model/beacon_user_address.rs +++ b/src/model/beacon_user_address.rs @@ -8,7 +8,7 @@ Addresses from the United Kingdom will not include a region Addresses from Hong Kong will not include a postal code*/ #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct BeaconUserAddress { - ///City from the end user's address + ///City from the end user's address. A string with at least one non-whitespace alphabetical character, with a max length of 100 characters." pub city: String, ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. pub country: String, @@ -18,9 +18,9 @@ pub struct BeaconUserAddress { ///An ISO 3166-2 subdivision code. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc. #[serde(default, skip_serializing_if = "Option::is_none")] pub region: Option, - ///The primary street portion of an address. If an address is provided, this field will always be filled. + ///The primary street portion of an address. If an address is provided, this field will always be filled. A string with at least one non-whitespace alphabetical character, with a max length of 80 characters. pub street: String, - ///Extra street information, like an apartment or suite number. + ///Extra street information, like an apartment or suite number. If provided, a string with at least one non-whitespace character, with a max length of 50 characters. #[serde(default, skip_serializing_if = "Option::is_none")] pub street2: Option, } @@ -28,4 +28,4 @@ impl std::fmt::Display for BeaconUserAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_create_response.rs b/src/model/beacon_user_create_response.rs index e9c11a53..88d219ee 100644 --- a/src/model/beacon_user_create_response.rs +++ b/src/model/beacon_user_create_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{BeaconAuditTrail, BeaconUserData}; +use super::{BeaconAuditTrail, BeaconUserData, BeaconUserStatus}; ///A Beacon User represents an end user that has been scanned against the Beacon Network. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserCreateResponse { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: BeaconAuditTrail, @@ -11,6 +11,9 @@ pub struct BeaconUserCreateResponse { pub created_at: chrono::DateTime, ///ID of the associated Beacon User. pub id: String, + ///An array of Plaid Item IDs corresponding to the Accounts associated with this Beacon User. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub item_ids: Vec, ///ID of the associated Beacon Program. pub program_id: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -22,14 +25,16 @@ pub struct BeaconUserCreateResponse { `pending_review`: The Beacon User has been marked for review. `cleared`: The Beacon User has been cleared of fraud.*/ - pub status: String, + pub status: BeaconUserStatus, ///An ISO8601 formatted timestamp. This field indicates the last time the resource was modified. pub updated_at: chrono::DateTime, ///A Beacon User's data and resulting analysis when checked against duplicate records and the Beacon Fraud Network. pub user: BeaconUserData, + ///The `version` field begins with 1 and increments each time the user is updated. + pub version: i64, } impl std::fmt::Display for BeaconUserCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_data.rs b/src/model/beacon_user_data.rs index 5a837d89..53df2427 100644 --- a/src/model/beacon_user_data.rs +++ b/src/model/beacon_user_data.rs @@ -1,7 +1,9 @@ use serde::{Serialize, Deserialize}; -use super::{BeaconUserAddress, BeaconUserIdNumber, BeaconUserName}; +use super::{ + BeaconUserAddress, BeaconUserDepositoryAccount, BeaconUserIdNumber, BeaconUserName, +}; ///A Beacon User's data and resulting analysis when checked against duplicate records and the Beacon Fraud Network. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserData { /**Even if an address has been collected, some fields may be null depending on the region's addressing system. For example: @@ -13,7 +15,9 @@ Addresses from Hong Kong will not include a postal code*/ pub address: BeaconUserAddress, ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). pub date_of_birth: chrono::NaiveDate, - ///A valid email address. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub depository_accounts: Vec, + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, ///The ID number associated with a Beacon User. @@ -32,4 +36,4 @@ impl std::fmt::Display for BeaconUserData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_depository_account.rs b/src/model/beacon_user_depository_account.rs new file mode 100644 index 00000000..cf8b8111 --- /dev/null +++ b/src/model/beacon_user_depository_account.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///Depository account information for the associated user. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BeaconUserDepositoryAccount { + ///The last 2-4 numeric characters of this account’s account number. + pub account_mask: String, + ///An ISO8601 formatted timestamp. + pub added_at: chrono::DateTime, + ///The routing number of the account. + pub routing_number: String, +} +impl std::fmt::Display for BeaconUserDepositoryAccount { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_user_get_response.rs b/src/model/beacon_user_get_response.rs index 82cc3c07..ca078cbd 100644 --- a/src/model/beacon_user_get_response.rs +++ b/src/model/beacon_user_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{BeaconAuditTrail, BeaconUserData}; +use super::{BeaconAuditTrail, BeaconUserData, BeaconUserStatus}; ///A Beacon User represents an end user that has been scanned against the Beacon Network. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserGetResponse { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: BeaconAuditTrail, @@ -11,6 +11,9 @@ pub struct BeaconUserGetResponse { pub created_at: chrono::DateTime, ///ID of the associated Beacon User. pub id: String, + ///An array of Plaid Item IDs corresponding to the Accounts associated with this Beacon User. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub item_ids: Vec, ///ID of the associated Beacon Program. pub program_id: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -22,14 +25,16 @@ pub struct BeaconUserGetResponse { `pending_review`: The Beacon User has been marked for review. `cleared`: The Beacon User has been cleared of fraud.*/ - pub status: String, + pub status: BeaconUserStatus, ///An ISO8601 formatted timestamp. This field indicates the last time the resource was modified. pub updated_at: chrono::DateTime, ///A Beacon User's data and resulting analysis when checked against duplicate records and the Beacon Fraud Network. pub user: BeaconUserData, + ///The `version` field begins with 1 and increments each time the user is updated. + pub version: i64, } impl std::fmt::Display for BeaconUserGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_history_list_response.rs b/src/model/beacon_user_history_list_response.rs new file mode 100644 index 00000000..e2e64bbc --- /dev/null +++ b/src/model/beacon_user_history_list_response.rs @@ -0,0 +1,18 @@ +use serde::{Serialize, Deserialize}; +use super::BeaconUser; +///The response schema for `/beacon/user/history/list` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BeaconUserHistoryListResponse { + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub beacon_users: Vec, + ///An identifier that determines which page of results you receive. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_cursor: Option, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for BeaconUserHistoryListResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_user_id_number.rs b/src/model/beacon_user_id_number.rs index f4a46c85..391844e2 100644 --- a/src/model/beacon_user_id_number.rs +++ b/src/model/beacon_user_id_number.rs @@ -1,15 +1,16 @@ use serde::{Serialize, Deserialize}; +use super::IdNumberType; ///The ID number associated with a Beacon User. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserIdNumber { ///A globally unique and human readable ID type, specific to the country and document category. For more context on this field, see [Hybrid Input Validation](https://plaid.com/docs/identity-verification/hybrid-input-validation). #[serde(rename = "type")] - pub type_: String, - ///Value of identity document value typed in by user. Alpha-numeric, with all formatting characters stripped. + pub type_: IdNumberType, + ///Value of identity document value typed in by user. Alpha-numeric, with all formatting characters stripped. For specific format requirements by ID type, see [Hybrid Input Validation](https://plaid.com/docs/identity-verification/hybrid-input-validation/). pub value: String, } impl std::fmt::Display for BeaconUserIdNumber { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_name.rs b/src/model/beacon_user_name.rs index 9a979977..49a478b0 100644 --- a/src/model/beacon_user_name.rs +++ b/src/model/beacon_user_name.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for BeaconUserName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_name_nullable.rs b/src/model/beacon_user_name_nullable.rs index c379bc62..43b23067 100644 --- a/src/model/beacon_user_name_nullable.rs +++ b/src/model/beacon_user_name_nullable.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for BeaconUserNameNullable { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_request_address.rs b/src/model/beacon_user_request_address.rs index daee49e7..5fe95874 100644 --- a/src/model/beacon_user_request_address.rs +++ b/src/model/beacon_user_request_address.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; ///Home address for the associated user. For more context on this field, see [Input Validation by Country](https://plaid.com/docs/identity-verification/hybrid-input-validation/#input-validation-by-country). #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct BeaconUserRequestAddress { - ///City from the end user's address + ///City from the end user's address. A string with at least one non-whitespace alphabetical character, with a max length of 100 characters." pub city: String, ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. pub country: String, @@ -12,9 +12,9 @@ pub struct BeaconUserRequestAddress { ///An ISO 3166-2 subdivision code. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc. #[serde(default, skip_serializing_if = "Option::is_none")] pub region: Option, - ///The primary street portion of an address. If an address is provided, this field will always be filled. + ///The primary street portion of an address. If an address is provided, this field will always be filled. A string with at least one non-whitespace alphabetical character, with a max length of 80 characters. pub street: String, - ///Extra street information, like an apartment or suite number. + ///Extra street information, like an apartment or suite number. If provided, a string with at least one non-whitespace character, with a max length of 50 characters. #[serde(default, skip_serializing_if = "Option::is_none")] pub street2: Option, } @@ -22,4 +22,4 @@ impl std::fmt::Display for BeaconUserRequestAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_request_address_nullable.rs b/src/model/beacon_user_request_address_nullable.rs index 0deda4be..caecc3b3 100644 --- a/src/model/beacon_user_request_address_nullable.rs +++ b/src/model/beacon_user_request_address_nullable.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; ///Home address for the associated user. For more context on this field, see [Input Validation by Country](https://plaid.com/docs/identity-verification/hybrid-input-validation/#input-validation-by-country). #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct BeaconUserRequestAddressNullable { - ///City from the end user's address + ///City from the end user's address. A string with at least one non-whitespace alphabetical character, with a max length of 100 characters." pub city: String, ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. pub country: String, @@ -12,9 +12,9 @@ pub struct BeaconUserRequestAddressNullable { ///An ISO 3166-2 subdivision code. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc. #[serde(default, skip_serializing_if = "Option::is_none")] pub region: Option, - ///The primary street portion of an address. If an address is provided, this field will always be filled. + ///The primary street portion of an address. If an address is provided, this field will always be filled. A string with at least one non-whitespace alphabetical character, with a max length of 80 characters. pub street: String, - ///Extra street information, like an apartment or suite number. + ///Extra street information, like an apartment or suite number. If provided, a string with at least one non-whitespace character, with a max length of 50 characters. #[serde(default, skip_serializing_if = "Option::is_none")] pub street2: Option, } @@ -22,4 +22,4 @@ impl std::fmt::Display for BeaconUserRequestAddressNullable { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_request_data.rs b/src/model/beacon_user_request_data.rs index 1a5dd2e4..fb8e1895 100644 --- a/src/model/beacon_user_request_data.rs +++ b/src/model/beacon_user_request_data.rs @@ -1,13 +1,25 @@ use serde::{Serialize, Deserialize}; -use super::{BeaconUserIdNumber, BeaconUserName, BeaconUserRequestAddress}; -///A Beacon User's data which is used to check against duplicate records and the Beacon Fraud Network. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::{ + BeaconUserIdNumber, BeaconUserName, BeaconUserRequestAddress, + BeaconUserRequestDepositoryAccount, +}; +/**A Beacon User's data which is used to check against duplicate records and the Beacon Fraud Network. + +In order to create a Beacon User, in addition to the `name`, _either_ the `date_of_birth` _or_ the `depository_accounts` field must be provided.*/ +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserRequestData { ///Home address for the associated user. For more context on this field, see [Input Validation by Country](https://plaid.com/docs/identity-verification/hybrid-input-validation/#input-validation-by-country). - pub address: BeaconUserRequestAddress, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - pub date_of_birth: chrono::NaiveDate, - ///A valid email address. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub date_of_birth: Option, + /**Provide a list of bank accounts that are associated with this Beacon User. These accounts will be scanned across the Beacon Network and used to find duplicate records. + +Note: These accounts will not have Bank Account Insights. To receive Bank Account Insights please supply `access_tokens`.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub depository_accounts: Option>, + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, ///The ID number associated with a Beacon User. @@ -26,4 +38,4 @@ impl std::fmt::Display for BeaconUserRequestData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_request_depository_account.rs b/src/model/beacon_user_request_depository_account.rs new file mode 100644 index 00000000..befc6cbb --- /dev/null +++ b/src/model/beacon_user_request_depository_account.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///Depository account information for the associated user. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct BeaconUserRequestDepositoryAccount { + ///Must be a valid US Bank Account Number + pub account_number: String, + ///The routing number of the account. + pub routing_number: String, +} +impl std::fmt::Display for BeaconUserRequestDepositoryAccount { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/beacon_user_revision.rs b/src/model/beacon_user_revision.rs index 39c93de6..9c0c0a75 100644 --- a/src/model/beacon_user_revision.rs +++ b/src/model/beacon_user_revision.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for BeaconUserRevision { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_status.rs b/src/model/beacon_user_status.rs new file mode 100644 index 00000000..fa95e9ae --- /dev/null +++ b/src/model/beacon_user_status.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**A status of a Beacon User. + +`rejected`: The Beacon User has been rejected for fraud. Users can be automatically or manually rejected. + +`pending_review`: The Beacon User has been marked for review. + +`cleared`: The Beacon User has been cleared of fraud.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum BeaconUserStatus { + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "pending_review")] + PendingReview, + #[serde(rename = "cleared")] + Cleared, +} diff --git a/src/model/beacon_user_status_updated_webhook.rs b/src/model/beacon_user_status_updated_webhook.rs index 89aea89f..05984dfc 100644 --- a/src/model/beacon_user_status_updated_webhook.rs +++ b/src/model/beacon_user_status_updated_webhook.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when a Beacon User status has changed, which can occur manually via the dashboard or when information is reported to the Beacon network. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserStatusUpdatedWebhook { ///The ID of the associated Beacon user. pub beacon_user_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///`USER_STATUS_UPDATED` pub webhook_code: String, ///`BEACON` @@ -15,4 +16,4 @@ impl std::fmt::Display for BeaconUserStatusUpdatedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_update_request_data.rs b/src/model/beacon_user_update_request_data.rs index 4074702f..e45308b1 100644 --- a/src/model/beacon_user_update_request_data.rs +++ b/src/model/beacon_user_update_request_data.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; use super::{ BeaconUserIdNumber, BeaconUserNameNullable, BeaconUserRequestAddressNullable, + BeaconUserRequestDepositoryAccount, }; -///A subset of a Beacon User's data which is used to patch the existing identity data associated with a Beacon User. At least one field must be provided,. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +///A subset of a Beacon User's data which is used to patch the existing identity data associated with a Beacon User. At least one field must be provided. If left unset or null, user data will not be patched. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserUpdateRequestData { ///Home address for the associated user. For more context on this field, see [Input Validation by Country](https://plaid.com/docs/identity-verification/hybrid-input-validation/#input-validation-by-country). #[serde(default, skip_serializing_if = "Option::is_none")] @@ -11,7 +12,9 @@ pub struct BeaconUserUpdateRequestData { ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub date_of_birth: Option, - ///A valid email address. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub depository_accounts: Option>, + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, ///The ID number associated with a Beacon User. @@ -31,4 +34,4 @@ impl std::fmt::Display for BeaconUserUpdateRequestData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/beacon_user_update_response.rs b/src/model/beacon_user_update_response.rs index d835d1a8..a178e1b2 100644 --- a/src/model/beacon_user_update_response.rs +++ b/src/model/beacon_user_update_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{BeaconAuditTrail, BeaconUserData}; +use super::{BeaconAuditTrail, BeaconUserData, BeaconUserStatus}; ///A Beacon User represents an end user that has been scanned against the Beacon Network. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserUpdateResponse { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: BeaconAuditTrail, @@ -11,6 +11,9 @@ pub struct BeaconUserUpdateResponse { pub created_at: chrono::DateTime, ///ID of the associated Beacon User. pub id: String, + ///An array of Plaid Item IDs corresponding to the Accounts associated with this Beacon User. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub item_ids: Vec, ///ID of the associated Beacon Program. pub program_id: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -22,14 +25,16 @@ pub struct BeaconUserUpdateResponse { `pending_review`: The Beacon User has been marked for review. `cleared`: The Beacon User has been cleared of fraud.*/ - pub status: String, + pub status: BeaconUserStatus, ///An ISO8601 formatted timestamp. This field indicates the last time the resource was modified. pub updated_at: chrono::DateTime, ///A Beacon User's data and resulting analysis when checked against duplicate records and the Beacon Fraud Network. pub user: BeaconUserData, + ///The `version` field begins with 1 and increments each time the user is updated. + pub version: i64, } impl std::fmt::Display for BeaconUserUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cashflow_attributes_version.rs b/src/model/cashflow_attributes_version.rs new file mode 100644 index 00000000..9829b76f --- /dev/null +++ b/src/model/cashflow_attributes_version.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///The versions of cashflow attributes +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CashflowAttributesVersion { + #[serde(rename = "v1.0")] + V10, +} diff --git a/src/model/categories_get_response.rs b/src/model/categories_get_response.rs index 9414a98b..ecd0145b 100644 --- a/src/model/categories_get_response.rs +++ b/src/model/categories_get_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CategoriesGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/category.rs b/src/model/category.rs index 5615d8e9..48a14364 100644 --- a/src/model/category.rs +++ b/src/model/category.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for Category { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/category_insight_details.rs b/src/model/category_insight_details.rs index 188fcd28..dc20707e 100644 --- a/src/model/category_insight_details.rs +++ b/src/model/category_insight_details.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for CategoryInsightDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/category_insights.rs b/src/model/category_insights.rs index a012556e..e661e143 100644 --- a/src/model/category_insights.rs +++ b/src/model/category_insights.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for CategoryInsights { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cause.rs b/src/model/cause.rs index cdf1a6ce..528666b0 100644 --- a/src/model/cause.rs +++ b/src/model/cause.rs @@ -1,9 +1,2 @@ use serde::{Serialize, Deserialize}; -///An error object and associated `item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct Cause {} -impl std::fmt::Display for Cause { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type Cause = serde_json::Value; diff --git a/src/model/client_provided_enhanced_transaction.rs b/src/model/client_provided_enhanced_transaction.rs index 3ad7174d..f42350e9 100644 --- a/src/model/client_provided_enhanced_transaction.rs +++ b/src/model/client_provided_enhanced_transaction.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::Enhancements; ///A client-provided transaction that Plaid has enhanced. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ClientProvidedEnhancedTransaction { ///The value of the transaction, denominated in the account's currency, as stated in `iso_currency_code`. Positive values when money moves out of the account; negative values when money moves in. For example, debit card purchases are positive; credit card payments, direct deposits, and refunds are negative. pub amount: f64, @@ -18,4 +18,4 @@ impl std::fmt::Display for ClientProvidedEnhancedTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/client_provided_enriched_transaction.rs b/src/model/client_provided_enriched_transaction.rs index 363bec98..cc5744bb 100644 --- a/src/model/client_provided_enriched_transaction.rs +++ b/src/model/client_provided_enriched_transaction.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::Enrichments; +use super::{EnrichTransactionDirection, Enrichments}; ///A client-provided transaction that Plaid has enriched. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ClientProvidedEnrichedTransaction { ///The account subtype associated with the transaction. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). #[serde(default, skip_serializing_if = "Option::is_none")] @@ -25,7 +25,7 @@ pub struct ClientProvidedEnrichedTransaction { `INFLOW` - Includes incoming transfers, refunds, and income. (Typically represented as a positive value on checking accounts and debit cards and a negative value on credit cards.)*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub direction: Option, + pub direction: Option, ///A grouping of the Plaid produced transaction enrichment fields. pub enrichments: Enrichments, ///The unique ID for the transaction as provided by you in the request. @@ -37,4 +37,4 @@ impl std::fmt::Display for ClientProvidedEnrichedTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/client_provided_raw_transaction.rs b/src/model/client_provided_raw_transaction.rs index e2357f5b..a91ea922 100644 --- a/src/model/client_provided_raw_transaction.rs +++ b/src/model/client_provided_raw_transaction.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for ClientProvidedRawTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/client_provided_transaction.rs b/src/model/client_provided_transaction.rs index 50e5b29b..9d76ee07 100644 --- a/src/model/client_provided_transaction.rs +++ b/src/model/client_provided_transaction.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::ClientProvidedTransactionLocation; +use super::{ClientProvidedTransactionLocation, EnrichTransactionDirection}; ///A client-provided transaction for Plaid to enrich. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ClientProvidedTransaction { ///The account subtype associated with the transaction. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). #[serde(default, skip_serializing_if = "Option::is_none")] @@ -27,7 +27,7 @@ pub struct ClientProvidedTransaction { `OUTFLOW` - Includes outgoing transfers, purchases, and fees. (Typically represented as a negative value on checking accounts and debit cards and a positive value on credit cards.) `INFLOW` - Includes incoming transfers, refunds, and income. (Typically represented as a positive value on checking accounts and debit cards and a negative value on credit cards.)*/ - pub direction: String, + pub direction: EnrichTransactionDirection, ///A unique ID for the transaction used to help you tie data back to your systems. pub id: String, ///The ISO-4217 currency code of the transaction e.g. USD. @@ -45,4 +45,4 @@ impl std::fmt::Display for ClientProvidedTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/client_provided_transaction_location.rs b/src/model/client_provided_transaction_location.rs index eed7b1c9..cb1cbd3e 100644 --- a/src/model/client_provided_transaction_location.rs +++ b/src/model/client_provided_transaction_location.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for ClientProvidedTransactionLocation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/connected_application.rs b/src/model/connected_application.rs index d2064592..8671004c 100644 --- a/src/model/connected_application.rs +++ b/src/model/connected_application.rs @@ -29,4 +29,4 @@ impl std::fmt::Display for ConnectedApplication { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/consent_event.rs b/src/model/consent_event.rs new file mode 100644 index 00000000..9c49f604 --- /dev/null +++ b/src/model/consent_event.rs @@ -0,0 +1,43 @@ +use serde::{Serialize, Deserialize}; +use super::{ConsentEventCode, ConsentEventInitiator, ConsentEventType, ConsentedAccount}; +///Describes a consent event. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ConsentEvent { + ///An array containing the accounts associated with the Item for which authorizations are granted. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub consented_accounts: Option>, + ///A list of strings containing the full list of data scopes the end user has consented to for the Item. These correspond to consented products; see the [full mapping](/docs/link/data-transparency-messaging-migration-guide/#data-scopes-by-product) of data scopes and products. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub consented_data_scopes: Option>, + /**A list of strings containing the full list of use cases the end user has consented to for the Item. + +See the [full list](/docs/link/data-transparency-messaging-migration-guide/#updating-link-customizations) of use cases.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub consented_use_cases: Option>, + ///The date and time when the consent event occurred, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + ///Codes describing the object of a consent event. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub event_code: Option, + ///A broad categorization of the consent event. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub event_type: Option, + ///The entity that initiated collection of consent. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub initiator: Option, + ///Unique identifier for the institution associated with the Item. Field is `null` for Items created via Same Day Micro-deposits. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution_id: Option, + ///The full name of the institution associated with the Item. Field is `null` for Items created via Same Day Micro-deposits. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution_name: Option, + ///The Plaid Item ID. The `item_id` is always unique; linking the same account at the same institution twice will result in two Items with different `item_id` values. Like all Plaid identifiers, the `item_id` is case-sensitive. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item_id: Option, +} +impl std::fmt::Display for ConsentEvent { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/consent_event_code.rs b/src/model/consent_event_code.rs new file mode 100644 index 00000000..70ce1f5c --- /dev/null +++ b/src/model/consent_event_code.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///Codes describing the object of a consent event. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ConsentEventCode { + #[serde(rename = "USER_AGREEMENT")] + UserAgreement, + #[serde(rename = "USE_CASES")] + UseCases, + #[serde(rename = "DATA_SCOPES")] + DataScopes, + #[serde(rename = "ACCOUNT_SCOPES")] + AccountScopes, +} diff --git a/src/model/consent_event_initiator.rs b/src/model/consent_event_initiator.rs new file mode 100644 index 00000000..36fcdad1 --- /dev/null +++ b/src/model/consent_event_initiator.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///The entity that initiated collection of consent. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ConsentEventInitiator { + #[serde(rename = "PLAID")] + Plaid, + #[serde(rename = "DATA_PROVIDER")] + DataProvider, + #[serde(rename = "CUSTOMER")] + Customer, + #[serde(rename = "END_USER")] + EndUser, +} diff --git a/src/model/consent_event_type.rs b/src/model/consent_event_type.rs new file mode 100644 index 00000000..3c3d0bef --- /dev/null +++ b/src/model/consent_event_type.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///A broad categorization of the consent event. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ConsentEventType { + #[serde(rename = "CONSENT_GRANTED")] + ConsentGranted, + #[serde(rename = "CONSENT_REVOKED")] + ConsentRevoked, + #[serde(rename = "CONSENT_UPDATED")] + ConsentUpdated, +} diff --git a/src/model/consent_events_get_response.rs b/src/model/consent_events_get_response.rs new file mode 100644 index 00000000..23b10b44 --- /dev/null +++ b/src/model/consent_events_get_response.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::ConsentEvent; +///Describes a historical log of item consent events. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ConsentEventsGetResponse { + ///A list of consent events. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub consent_events: Vec, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for ConsentEventsGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/consented_account.rs b/src/model/consented_account.rs new file mode 100644 index 00000000..5f58fcb5 --- /dev/null +++ b/src/model/consented_account.rs @@ -0,0 +1,40 @@ +use serde::{Serialize, Deserialize}; +use super::{AccountSubtype, AccountType}; +///A financial institution account. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ConsentedAccount { + ///Plaid’s unique identifier for the account. Like all Plaid identifiers, the `account_id` is case sensitive. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + ///The last 2-4 alphanumeric characters of an account's official account number + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mask: Option, + ///The name of the account, either assigned by the user or by the financial institution itself + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + ///The official name of the account as given by the financial institution + #[serde(default, skip_serializing_if = "Option::is_none")] + pub official_name: Option, + ///See the [Account type schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subtype: Option, + /**`investment:` Investment account. In API versions 2018-05-22 and earlier, this type is called `brokerage` instead. + +`credit:` Credit card + +`depository:` Depository account + +`loan:` Loan account + +`other:` Non-specified account type + +See the [Account type schema](https://plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.*/ + #[serde(rename = "type")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl std::fmt::Display for ConsentedAccount { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/consumer_dispute.rs b/src/model/consumer_dispute.rs new file mode 100644 index 00000000..e16025e6 --- /dev/null +++ b/src/model/consumer_dispute.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::ConsumerDisputeCategory; +///The information about a previously submitted valid dispute statement by the consumer +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ConsumerDispute { + ///Type of data being disputed by the consumer + pub category: ConsumerDisputeCategory, + ///A unique identifier (UUID) of the consumer dispute that can be used for troubleshooting + pub consumer_dispute_id: String, + ///Date of the disputed field (e.g. transaction date), in an ISO 8601 format (YYYY-MM-DD) + pub dispute_field_create_date: chrono::NaiveDate, + ///Text content of dispute + pub statement: String, +} +impl std::fmt::Display for ConsumerDispute { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/consumer_dispute_category.rs b/src/model/consumer_dispute_category.rs new file mode 100644 index 00000000..d3e32560 --- /dev/null +++ b/src/model/consumer_dispute_category.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///Type of data being disputed by the consumer +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ConsumerDisputeCategory { + #[serde(rename = "TRANSACTION")] + Transaction, + #[serde(rename = "BALANCE")] + Balance, + #[serde(rename = "IDENTITY")] + Identity, + #[serde(rename = "OTHER")] + Other, +} diff --git a/src/model/consumer_report_permissible_purpose.rs b/src/model/consumer_report_permissible_purpose.rs new file mode 100644 index 00000000..9a3a6ccf --- /dev/null +++ b/src/model/consumer_report_permissible_purpose.rs @@ -0,0 +1,37 @@ +use serde::{Serialize, Deserialize}; +/**Describes the reason you are generating a Consumer Report for this user. + +`ACCOUNT_REVIEW_CREDIT`: In connection with a consumer credit transaction for the review or collection of an account pursuant to FCRA Section 604(a)(3)(A). + +`ACCOUNT_REVIEW_NON_CREDIT`: For a legitimate business need of the information to review a non-credit account provided primarily for personal, family, or household purposes to determine whether the consumer continues to meet the terms of the account pursuant to FCRA Section 604(a)(3)(F)(2). + +`EMPLOYMENT`: For employment purposes pursuant to FCRA 604(a)(3)(B), including hiring, retention and promotion purposes. + +`EXTENSION_OF_CREDIT`: In connection with a credit transaction initiated by and involving the consumer pursuant to FCRA Section 604(a)(3)(A). + +`LEGITIMATE_BUSINESS_NEED_TENANT_SCREENING`: For a legitimate business need in connection with a business transaction initiated by the consumer primarily for personal, family, or household purposes in connection with a property rental assessment pursuant to FCRA Section 604(a)(3)(F)(i). + +`LEGITIMATE_BUSINESS_NEED_OTHER`: For a legitimate business need in connection with a business transaction made primarily for personal, family, or household initiated by the consumer pursuant to FCRA Section 604(a)(3)(F)(i). + +`WRITTEN_INSTRUCTION_PREQUALIFICATION`: In accordance with the written instructions of the consumer pursuant to FCRA Section 604(a)(2), to evaluate an application’s profile to make an offer to the consumer. + +`WRITTEN_INSTRUCTION_OTHER`: In accordance with the written instructions of the consumer pursuant to FCRA Section 604(a)(2), such as when an individual agrees to act as a guarantor or assumes personal liability for a consumer, business, or commercial loan.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ConsumerReportPermissiblePurpose { + #[serde(rename = "ACCOUNT_REVIEW_CREDIT")] + AccountReviewCredit, + #[serde(rename = "ACCOUNT_REVIEW_NON_CREDIT")] + AccountReviewNonCredit, + #[serde(rename = "EMPLOYMENT")] + Employment, + #[serde(rename = "EXTENSION_OF_CREDIT")] + ExtensionOfCredit, + #[serde(rename = "LEGITIMATE_BUSINESS_NEED_TENANT_SCREENING")] + LegitimateBusinessNeedTenantScreening, + #[serde(rename = "LEGITIMATE_BUSINESS_NEED_OTHER")] + LegitimateBusinessNeedOther, + #[serde(rename = "WRITTEN_INSTRUCTION_PREQUALIFICATION")] + WrittenInstructionPrequalification, + #[serde(rename = "WRITTEN_INSTRUCTION_OTHER")] + WrittenInstructionOther, +} diff --git a/src/model/consumer_report_user_identity.rs b/src/model/consumer_report_user_identity.rs index 489259d6..7c00ab8c 100644 --- a/src/model/consumer_report_user_identity.rs +++ b/src/model/consumer_report_user_identity.rs @@ -1,8 +1,13 @@ use serde::{Serialize, Deserialize}; use super::AddressData; -///ConsumerReportUserIdentity defines the user identity data collected for consumer report purpose. This field is required to be set if you later use the created user for consumer report purpose. +///To create a Plaid Check Consumer Report for a user, this field must be present on the user token. If this field is not provided during user token creation, you can add it to the user later by calling `/user/update`. Once the field has been added to the user, you will be able to call `/link/token/create` with a non-empty `consumer_report_permissible_purpose` (which will automatically create a Plaid Check Consumer Report), or call `/cra/check_report/create` for that user. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ConsumerReportUserIdentity { + /**To be provided in the format "yyyy-mm-dd". +This field is required for any clients who became Plaid Check customers on or after Oct 1, 2024. +This field will be required for all Plaid Check customers as of Feb 1, 2025.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub date_of_birth: Option, ///The user's emails #[serde(default, skip_serializing_if = "Vec::is_empty")] pub emails: Vec, @@ -10,14 +15,18 @@ pub struct ConsumerReportUserIdentity { pub first_name: String, ///The user's last name pub last_name: String, - ///The user's phone numbers. The format of phone number will be validated and for better normalization, it is expected to be in E.164 format +{countrycode}{number}, for example `+14151234567`. + ///The user's phone number, in E.164 format: +{countrycode}{number}. For example: "+14157452130". Phone numbers provided in other formats will be parsed on a best-effort basis. Phone number input is validated against valid number ranges; number strings that do not match a real-world phone numbering scheme may cause the request to fail, even in the Sandbox test environment. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub phone_numbers: Vec, ///Data about the components comprising an address. pub primary_address: AddressData, + ///The last 4 digits of the user's social security number. + #[serde(rename = "ssn_last_4")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ssn_last4: Option, } impl std::fmt::Display for ConsumerReportUserIdentity { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/counterparty.rs b/src/model/counterparty.rs index d64b4b48..72a50e1d 100644 --- a/src/model/counterparty.rs +++ b/src/model/counterparty.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::CounterpartyType; ///The counterparty, such as the merchant or financial institution, is extracted by Plaid from the raw description. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Counterparty { /**A description of how confident we are that the provided counterparty is involved in the transaction. @@ -19,7 +20,7 @@ pub struct Counterparty { pub logo_url: Option, ///The name of the counterparty, such as the merchant or the financial institution, as extracted by Plaid from the raw description. pub name: String, - ///The phone number associated with the primary_counterparty in E. 164 format. If there is a location match (i.e. a street address is returned in the location object), the phone number will be location specific. + ///The phone number associated with the counterparty in E. 164 format. If there is a location match (i.e. a street address is returned in the location object), the phone number will be location specific. #[serde(default, skip_serializing_if = "Option::is_none")] pub phone_number: Option, /**The counterparty type. @@ -31,7 +32,7 @@ pub struct Counterparty { `payment_terminal`: a point-of-sale payment terminal (e.g Square, Toast) `income_source`: the payer in an income transaction (e.g., an employer, client, or government agency)*/ #[serde(rename = "type")] - pub type_: String, + pub type_: CounterpartyType, ///The website associated with the counterparty. #[serde(default, skip_serializing_if = "Option::is_none")] pub website: Option, @@ -40,4 +41,4 @@ impl std::fmt::Display for Counterparty { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/counterparty_insights.rs b/src/model/counterparty_insights.rs index db73752c..6d733e84 100644 --- a/src/model/counterparty_insights.rs +++ b/src/model/counterparty_insights.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for CounterpartyInsights { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/counterparty_type.rs b/src/model/counterparty_type.rs new file mode 100644 index 00000000..781fbae5 --- /dev/null +++ b/src/model/counterparty_type.rs @@ -0,0 +1,24 @@ +use serde::{Serialize, Deserialize}; +/**The counterparty type. + +`merchant`: a provider of goods or services for purchase +`financial_institution`: a financial entity (bank, credit union, BNPL, fintech) +`payment_app`: a transfer or P2P app (e.g. Zelle) +`marketplace`: a marketplace (e.g DoorDash, Google Play Store) +`payment_terminal`: a point-of-sale payment terminal (e.g Square, Toast) +`income_source`: the payer in an income transaction (e.g., an employer, client, or government agency)*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CounterpartyType { + #[serde(rename = "merchant")] + Merchant, + #[serde(rename = "financial_institution")] + FinancialInstitution, + #[serde(rename = "payment_app")] + PaymentApp, + #[serde(rename = "marketplace")] + Marketplace, + #[serde(rename = "payment_terminal")] + PaymentTerminal, + #[serde(rename = "income_source")] + IncomeSource, +} diff --git a/src/model/country_code.rs b/src/model/country_code.rs new file mode 100644 index 00000000..c460d9c2 --- /dev/null +++ b/src/model/country_code.rs @@ -0,0 +1,41 @@ +use serde::{Serialize, Deserialize}; +///ISO-3166-1 alpha-2 country code standard. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CountryCode { + #[serde(rename = "US")] + Us, + #[serde(rename = "GB")] + Gb, + #[serde(rename = "ES")] + Es, + #[serde(rename = "NL")] + Nl, + #[serde(rename = "FR")] + Fr, + #[serde(rename = "IE")] + Ie, + #[serde(rename = "CA")] + Ca, + #[serde(rename = "DE")] + De, + #[serde(rename = "IT")] + It, + #[serde(rename = "PL")] + Pl, + #[serde(rename = "DK")] + Dk, + #[serde(rename = "NO")] + No, + #[serde(rename = "SE")] + Se, + #[serde(rename = "EE")] + Ee, + #[serde(rename = "LT")] + Lt, + #[serde(rename = "LV")] + Lv, + #[serde(rename = "PT")] + Pt, + #[serde(rename = "BE")] + Be, +} diff --git a/src/model/cra_bank_income.rs b/src/model/cra_bank_income.rs index 2d56d741..cc279b10 100644 --- a/src/model/cra_bank_income.rs +++ b/src/model/cra_bank_income.rs @@ -1,24 +1,24 @@ use serde::{Serialize, Deserialize}; use super::{CraBankIncomeItem, CraBankIncomeSummary, CraBankIncomeWarning}; -///The report of the Bank Income data for an end user. +///The report of the Plaid Check Income Insights data for an end user. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct CraBankIncome { - ///The unique identifier associated with the Bank Income Report. + ///The unique identifier associated with the report. #[serde(default, skip_serializing_if = "Option::is_none")] pub bank_income_id: Option, - ///Summary for bank income across all income sources and items (max history of 730 days). + ///Summary for income across all income sources and items (max history of 730 days). #[serde(default, skip_serializing_if = "Option::is_none")] pub bank_income_summary: Option, - ///The number of days requested by the customer for the Bank Income Report. + ///The number of days requested by the customer for the report. #[serde(default, skip_serializing_if = "Option::is_none")] pub days_requested: Option, - ///The time when the Bank Income Report was generated. + ///The time when the report was generated. #[serde(default, skip_serializing_if = "Option::is_none")] pub generated_time: Option>, ///The list of Items in the report along with the associated metadata about the Item. #[serde(default, skip_serializing_if = "Option::is_none")] pub items: Option>, - ///If data from the Bank Income report was unable to be retrieved, the warnings will contain information about the error that caused the data to be incomplete. + ///If data from the report was unable to be retrieved, the warnings object will contain information about the error that caused the data to be incomplete. #[serde(default, skip_serializing_if = "Option::is_none")] pub warnings: Option>, } @@ -26,4 +26,4 @@ impl std::fmt::Display for CraBankIncome { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_account.rs b/src/model/cra_bank_income_account.rs index aa87ed80..3b5219b9 100644 --- a/src/model/cra_bank_income_account.rs +++ b/src/model/cra_bank_income_account.rs @@ -1,12 +1,24 @@ use serde::{Serialize, Deserialize}; -use super::Owner; +use super::{ + CraBankIncomeAccountMetadata, CreditBankIncomeAccountType, DepositoryAccountSubtype, + Owner, +}; ///The Item's bank accounts that have the selected data. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CraBankIncomeAccount { + /**Plaid’s unique identifier for the account. This value will not change unless Plaid can't reconcile the account with the data returned by the financial institution. This may occur, for example, when the name of the account changes. If this happens a new `account_id` will be assigned to the account. + +If an account with a specific `account_id` disappears instead of changing, the account is likely closed. Closed accounts are not returned by the Plaid API. + +Like all Plaid identifiers, the `account_id` is case sensitive.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, /**The last 2-4 alphanumeric characters of an account's official account number. Note that the mask may be non-unique between an Item's accounts, and it may also not match the mask that the bank displays to the user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub mask: Option, + ///An object containing metadata about the extracted account. + pub metadata: CraBankIncomeAccountMetadata, ///The name of the bank account. pub name: String, ///The official name of the bank account. @@ -16,13 +28,13 @@ Note that the mask may be non-unique between an Item's accounts, and it may also #[serde(default, skip_serializing_if = "Vec::is_empty")] pub owners: Vec, ///Valid account subtypes for depository accounts. For a list containing descriptions of each subtype, see [Account schemas](https://plaid.com/docs/api/accounts/#StandaloneAccountType-depository). - pub subtype: String, + pub subtype: DepositoryAccountSubtype, ///The account type. This will always be `depository`. #[serde(rename = "type")] - pub type_: String, + pub type_: CreditBankIncomeAccountType, } impl std::fmt::Display for CraBankIncomeAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_account_metadata.rs b/src/model/cra_bank_income_account_metadata.rs new file mode 100644 index 00000000..b032ade0 --- /dev/null +++ b/src/model/cra_bank_income_account_metadata.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///An object containing metadata about the extracted account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraBankIncomeAccountMetadata { + ///The date of the most recent extracted transaction, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ("yyyy-mm-dd"). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + ///The date of the earliest extracted transaction, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ("yyyy-mm-dd"). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, +} +impl std::fmt::Display for CraBankIncomeAccountMetadata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_bank_income_bonus_type.rs b/src/model/cra_bank_income_bonus_type.rs new file mode 100644 index 00000000..2d08fef1 --- /dev/null +++ b/src/model/cra_bank_income_bonus_type.rs @@ -0,0 +1,3 @@ +use serde::{Serialize, Deserialize}; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraBankIncomeBonusType(pub serde_json::Value); diff --git a/src/model/cra_bank_income_cause.rs b/src/model/cra_bank_income_cause.rs index fd7f2f4a..bda196bb 100644 --- a/src/model/cra_bank_income_cause.rs +++ b/src/model/cra_bank_income_cause.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::CreditBankIncomeErrorType; ///An error object and associated `item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CraBankIncomeCause { /**A user-friendly representation of the error code. null if the error is not related to user action. This may change over time and is not safe for programmatic use.*/ @@ -10,10 +11,10 @@ This may change over time and is not safe for programmatic use.*/ ///A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use. pub error_message: String, ///A broad categorization of the error. Safe for programmatic use. - pub error_type: String, + pub error_type: CreditBankIncomeErrorType, } impl std::fmt::Display for CraBankIncomeCause { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_complete_result.rs b/src/model/cra_bank_income_complete_result.rs new file mode 100644 index 00000000..6526428e --- /dev/null +++ b/src/model/cra_bank_income_complete_result.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**The result of the bank income report generation + +`SUCCESS`: The bank income report was successfully generated and can be retrieved via `/cra/bank_income/get`. + +`FAILURE`: The bank income report failed to be generated*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CraBankIncomeCompleteResult { + #[serde(rename = "SUCCESS")] + Success, + #[serde(rename = "FAILURE")] + Failure, +} diff --git a/src/model/cra_bank_income_complete_webhook.rs b/src/model/cra_bank_income_complete_webhook.rs index e9e41575..a3ac4147 100644 --- a/src/model/cra_bank_income_complete_webhook.rs +++ b/src/model/cra_bank_income_complete_webhook.rs @@ -1,15 +1,17 @@ use serde::{Serialize, Deserialize}; +use super::{CraBankIncomeCompleteResult, WebhookEnvironmentValues}; ///Fired when a bank income report has finished generating or failed to generate, triggered by calling `/cra/bank_income/get`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CraBankIncomeCompleteWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, /**The result of the bank income report generation `SUCCESS`: The bank income report was successfully generated and can be retrieved via `/cra/bank_income/get`. `FAILURE`: The bank income report failed to be generated*/ - pub result: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option, ///The `user_id` corresponding to the user the webhook has fired for. pub user_id: String, ///`BANK_INCOME_COMPLETE` @@ -21,4 +23,4 @@ impl std::fmt::Display for CraBankIncomeCompleteWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_create_response.rs b/src/model/cra_bank_income_create_response.rs new file mode 100644 index 00000000..8a7828b0 --- /dev/null +++ b/src/model/cra_bank_income_create_response.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///CraBankIncomeCreateRequest defines the response schema for `/cra/bank_income/create`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraBankIncomeCreateResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_id: Option, +} +impl std::fmt::Display for CraBankIncomeCreateResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_bank_income_employer.rs b/src/model/cra_bank_income_employer.rs index 9a247651..256c7b39 100644 --- a/src/model/cra_bank_income_employer.rs +++ b/src/model/cra_bank_income_employer.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for CraBankIncomeEmployer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_error_webhook.rs b/src/model/cra_bank_income_error_webhook.rs new file mode 100644 index 00000000..4fb5d295 --- /dev/null +++ b/src/model/cra_bank_income_error_webhook.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; +///Fired when a bank income report has failed to generate +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraBankIncomeErrorWebhook { + ///The Plaid environment the webhook was sent from + pub environment: WebhookEnvironmentValues, + ///The `user_id` corresponding to the user the webhook has fired for. + pub user_id: String, + ///`ERROR` + pub webhook_code: String, + ///`CRA_INCOME` + pub webhook_type: String, +} +impl std::fmt::Display for CraBankIncomeErrorWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_bank_income_get_response.rs b/src/model/cra_bank_income_get_response.rs index 4cef7d62..e5867a3c 100644 --- a/src/model/cra_bank_income_get_response.rs +++ b/src/model/cra_bank_income_get_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for CraBankIncomeGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_historical_summary.rs b/src/model/cra_bank_income_historical_summary.rs index 5fca4192..71e292e8 100644 --- a/src/model/cra_bank_income_historical_summary.rs +++ b/src/model/cra_bank_income_historical_summary.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for CraBankIncomeHistoricalSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_item.rs b/src/model/cra_bank_income_item.rs index 44f8465b..a0d0ff40 100644 --- a/src/model/cra_bank_income_item.rs +++ b/src/model/cra_bank_income_item.rs @@ -3,18 +3,21 @@ use super::{CraBankIncomeAccount, CraBankIncomeSource}; ///The details and metadata for an end user's Item. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct CraBankIncomeItem { - ///The Item's accounts that have Bank Income data. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bank_income_accounts: Option>, + ///The Item's accounts that have bank income data. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub bank_income_accounts: Vec, ///The income sources for this Item. Each entry in the array is a single income source. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bank_income_sources: Option>, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub bank_income_sources: Vec, ///The unique identifier of the institution associated with the Item. #[serde(default, skip_serializing_if = "Option::is_none")] pub institution_id: Option, ///The name of the institution associated with the Item. #[serde(default, skip_serializing_if = "Option::is_none")] pub institution_name: Option, + ///The `item_id` of the Item associated with this webhook, warning, or error + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item_id: Option, ///The time when this Item's data was last retrieved from the financial institution. #[serde(default, skip_serializing_if = "Option::is_none")] pub last_updated_time: Option>, @@ -23,4 +26,4 @@ impl std::fmt::Display for CraBankIncomeItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_source.rs b/src/model/cra_bank_income_source.rs index 5f1f708f..03ab7ded 100644 --- a/src/model/cra_bank_income_source.rs +++ b/src/model/cra_bank_income_source.rs @@ -1,8 +1,14 @@ use serde::{Serialize, Deserialize}; -use super::{CraBankIncomeEmployer, CraBankIncomeHistoricalSummary}; +use super::{ + CraBankIncomeEmployer, CraBankIncomeHistoricalSummary, CraPredictionInterval, + CreditBankIncomeCategory, CreditBankIncomePayFrequency, +}; ///Detailed information for the income source. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CraBankIncomeSource { + ///The account ID with which this income source is associated. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, ///The object containing employer data. #[serde(default, skip_serializing_if = "Option::is_none")] pub employer: Option, @@ -13,6 +19,11 @@ The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ ///The predicted average monthly net income amount for the income source(s). #[serde(default, skip_serializing_if = "Option::is_none")] pub forecasted_average_monthly_income: Option, + ///The prediction interval(s) for the forecasted average monthly income. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub forecasted_average_monthly_income_prediction_intervals: Vec< + CraPredictionInterval, + >, ///An estimate of the average gross monthly income based on the historical net amount and income category for the income source(s). #[serde(default, skip_serializing_if = "Option::is_none")] pub historical_average_monthly_gross_income: Option, @@ -21,9 +32,24 @@ The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ pub historical_average_monthly_income: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub historical_summary: Option>, - ///The income category. Note that the `CASH` value has been deprecated and is used only for existing legacy implementations. It has been replaced by the new categories `CASH_DEPOSIT` (representing cash or check deposits) and `TRANSFER_FROM_APPLICATION` (representing cash transfers originating from apps, such as Zelle or Venmo). - #[serde(default, skip_serializing_if = "Option::is_none")] - pub income_category: Option, + /**The income category. +`BANK_INTEREST`: Interest earned from a bank account. +`BENEFIT_OTHER`: Government benefits other than retirement, unemployment, child support, or disability. Currently used only in the UK, to represent benefits such as Cost of Living Payments. +`CASH`: Deprecated and used only for existing legacy implementations. Has been replaced by `CASH_DEPOSIT` and `TRANSFER_FROM_APPLICATION`. +`CASH_DEPOSIT`: A cash or check deposit. +`CHILD_SUPPORT`: Child support payments received. +`GIG_ECONOMY`: Income earned as a gig economy worker, e.g. driving for Uber, Lyft, Postmates, DoorDash, etc. +`LONG_TERM_DISABILITY`: Disability payments, including Social Security disability benefits. +`OTHER`: Income that could not be categorized as any other income category. +`MILITARY`: Veterans benefits. Income earned as salary for serving in the military (e.g. through DFAS) will be classified as `SALARY` rather than `MILITARY`. +`RENTAL`: Income earned from a rental property. Income may be identified as rental when the payment is received through a rental platform, e.g. Airbnb; rent paid directly by the tenant to the property owner (e.g. via cash, check, or ACH) will typically not be classified as rental income. +`RETIREMENT`: Payments from private retirement systems, pensions, and government retirement programs, including Social Security retirement benefits. +`SALARY`: Payment from an employer to an earner or other form of permanent employment. +`TAX_REFUND`: A tax refund. +`TRANSFER_FROM_APPLICATION`: Deposits from a money transfer app, such as Venmo, Cash App, or Zelle. +`UNEMPLOYMENT`: Unemployment benefits. In the UK, includes certain low-income benefits such as the Universal Credit.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub income_category: Option, ///The most common name or original description for the underlying income transactions. #[serde(default, skip_serializing_if = "Option::is_none")] pub income_description: Option, @@ -39,7 +65,7 @@ The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ pub next_payment_date: Option, ///The income pay frequency. #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_frequency: Option, + pub pay_frequency: Option, /**Minimum of all dates within the specific income sources in the user's bank account for days requested by the client. The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ #[serde(default, skip_serializing_if = "Option::is_none")] @@ -59,4 +85,4 @@ impl std::fmt::Display for CraBankIncomeSource { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_summary.rs b/src/model/cra_bank_income_summary.rs index e23578c3..67cf612d 100644 --- a/src/model/cra_bank_income_summary.rs +++ b/src/model/cra_bank_income_summary.rs @@ -1,15 +1,24 @@ use serde::{Serialize, Deserialize}; use super::{CraBankIncomeHistoricalSummary, CreditAmountWithCurrency}; -///Summary for bank income across all income sources and items (max history of 730 days). +///Summary for income across all income sources and items (max history of 730 days). #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct CraBankIncomeSummary { /**The latest date in which all income sources identified by Plaid appear in the user's account. The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub end_date: Option, + ///The predicted average annual income amount for the income source(s). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub forecasted_annual_income: Option>, ///The predicted average monthly income amount for the income source(s). #[serde(default, skip_serializing_if = "Option::is_none")] pub forecasted_average_monthly_income: Option>, + ///An estimate of the annual gross income based on the historical net amount and income category for the income source(s). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub historical_annual_gross_income: Option>, + ///The annual income amount estimated based on the historical data for the income source(s). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub historical_annual_income: Option>, ///An estimate of the average gross monthly income based on the historical net amount and income category for the income source(s). #[serde(default, skip_serializing_if = "Option::is_none")] pub historical_average_monthly_gross_income: Option>, @@ -40,4 +49,4 @@ impl std::fmt::Display for CraBankIncomeSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_transaction.rs b/src/model/cra_bank_income_transaction.rs index 45c9ee3e..87066d5d 100644 --- a/src/model/cra_bank_income_transaction.rs +++ b/src/model/cra_bank_income_transaction.rs @@ -1,19 +1,23 @@ use serde::{Serialize, Deserialize}; +use super::CraBankIncomeBonusType; ///The transactions data for the end user's income source(s). #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct CraBankIncomeTransaction { - /**The settled value of the transaction, denominated in the transactions's currency as stated in `iso_currency_code` or `unofficial_currency_code`. + /**The settled value of the transaction, denominated in the transaction's currency as stated in `iso_currency_code` or `unofficial_currency_code`. Positive values when money moves out of the account; negative values when money moves in. For example, credit card purchases are positive; credit card payment, direct deposits, and refunds are negative.*/ + pub amount: f64, + /**The type of bonus that this transaction represents, if it is a bonus. +`BONUS_INCLUDED`: Bonus is included in this transaction along with the normal pay +`BONUS_ONLY`: This transaction is a standalone bonus*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub amount: Option, + pub bonus_type: Option, ///The check number of the transaction. This field is only populated for check transactions. #[serde(default, skip_serializing_if = "Option::is_none")] pub check_number: Option, /**For pending transactions, the date that the transaction occurred; for posted transactions, the date that the transaction posted. Both dates are returned in an ISO 8601 format (YYYY-MM-DD).*/ - #[serde(default, skip_serializing_if = "Option::is_none")] - pub date: Option, + pub date: chrono::NaiveDate, ///The ISO 4217 currency code of the amount or balance. #[serde(default, skip_serializing_if = "Option::is_none")] pub iso_currency_code: Option, @@ -25,8 +29,9 @@ Both dates are returned in an ISO 8601 format (YYYY-MM-DD).*/ pub original_description: Option, /**When true, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled.*/ - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pending: Option, + pub pending: bool, + ///The unique ID of the transaction. Like all Plaid identifiers, the `transaction_id` is case sensitive. + pub transaction_id: String, /**The unofficial currency code associated with the amount or balance. Always `null` if `iso_currency_code` is non-null. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.*/ #[serde(default, skip_serializing_if = "Option::is_none")] @@ -36,4 +41,4 @@ impl std::fmt::Display for CraBankIncomeTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_warning.rs b/src/model/cra_bank_income_warning.rs index d7f30993..636ed490 100644 --- a/src/model/cra_bank_income_warning.rs +++ b/src/model/cra_bank_income_warning.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::CraBankIncomeCause; -///The warning associated with the data that was unavailable for the Bank Income Report. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::{CraBankIncomeCause, CraBankIncomeWarningCode, CreditBankIncomeWarningType}; +///The warning associated with the data that was unavailable. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CraBankIncomeWarning { ///An error object and associated `item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -12,13 +12,13 @@ pub struct CraBankIncomeWarning { `REPORT_DELETED`: Report deleted due to customer or consumer request `DATA_UNAVAILABLE`: No relevant data was found for the Item*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub warning_code: Option, + pub warning_code: Option, ///The warning type which will always be `BANK_INCOME_WARNING`. #[serde(default, skip_serializing_if = "Option::is_none")] - pub warning_type: Option, + pub warning_type: Option, } impl std::fmt::Display for CraBankIncomeWarning { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_bank_income_warning_code.rs b/src/model/cra_bank_income_warning_code.rs new file mode 100644 index 00000000..7c2c2b46 --- /dev/null +++ b/src/model/cra_bank_income_warning_code.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**The warning code identifies a specific kind of warning. +`IDENTITY_UNAVAILABLE`: Unable to extract identity for the Item +`TRANSACTIONS_UNAVAILABLE`: Unable to extract transactions for the Item +`REPORT_DELETED`: Report deleted due to customer or consumer request +`DATA_UNAVAILABLE`: No relevant data was found for the Item*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CraBankIncomeWarningCode { + #[serde(rename = "IDENTITY_UNAVAILABLE")] + IdentityUnavailable, + #[serde(rename = "TRANSACTIONS_UNAVAILABLE")] + TransactionsUnavailable, + #[serde(rename = "REPORT_DELETED")] + ReportDeleted, + #[serde(rename = "DATA_UNAVAILABLE")] + DataUnavailable, +} diff --git a/src/model/cra_base_report_create_response.rs b/src/model/cra_base_report_create_response.rs new file mode 100644 index 00000000..180daca8 --- /dev/null +++ b/src/model/cra_base_report_create_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///CraBaseReportCreateResponse defines the response schema for `cra/base_report/create` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraBaseReportCreateResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraBaseReportCreateResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/base_report_get_response.rs b/src/model/cra_base_report_get_response.rs similarity index 72% rename from src/model/base_report_get_response.rs rename to src/model/cra_base_report_get_response.rs index 569e39f9..88d8ad10 100644 --- a/src/model/base_report_get_response.rs +++ b/src/model/cra_base_report_get_response.rs @@ -1,18 +1,18 @@ use serde::{Serialize, Deserialize}; use super::{BaseReport, BaseReportWarning}; -///BaseReportGetResponse defines the response schema for `/cra/base_report/get` +///CraBaseReportGetResponse defines the response schema for `/cra/base_report/get` #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct BaseReportGetResponse { +pub struct CraBaseReportGetResponse { ///An object representing a Base Report pub report: BaseReport, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, ///If the Base Report generation was successful but identity information cannot be returned, this array will contain information about the errors causing identity information to be missing - #[serde(default, skip_serializing_if = "Option::is_none")] - pub warnings: Option>, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub warnings: Vec, } -impl std::fmt::Display for BaseReportGetResponse { +impl std::fmt::Display for CraBaseReportGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/cra_check_report_base_report_get_response.rs b/src/model/cra_check_report_base_report_get_response.rs new file mode 100644 index 00000000..96565a2f --- /dev/null +++ b/src/model/cra_check_report_base_report_get_response.rs @@ -0,0 +1,18 @@ +use serde::{Serialize, Deserialize}; +use super::{BaseReport, BaseReportWarning}; +///CraCheckReportBaseReportGetResponse defines the response schema for `/cra/check_report/base_report/get` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraCheckReportBaseReportGetResponse { + ///An object representing a Base Report + pub report: BaseReport, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, + ///If the Base Report generation was successful but identity information cannot be returned, this array will contain information about the errors causing identity information to be missing + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub warnings: Vec, +} +impl std::fmt::Display for CraCheckReportBaseReportGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_check_report_create_response.rs b/src/model/cra_check_report_create_response.rs new file mode 100644 index 00000000..b071e645 --- /dev/null +++ b/src/model/cra_check_report_create_response.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///CraCheckReportCreateResponse defines the response schema for `/cra/check_report/create`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraCheckReportCreateResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_id: Option, +} +impl std::fmt::Display for CraCheckReportCreateResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_check_report_failed_webhook.rs b/src/model/cra_check_report_failed_webhook.rs new file mode 100644 index 00000000..57d6247d --- /dev/null +++ b/src/model/cra_check_report_failed_webhook.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; +///Fired when a Check Report has failed to generate +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraCheckReportFailedWebhook { + ///The Plaid environment the webhook was sent from + pub environment: WebhookEnvironmentValues, + ///The `user_id` corresponding to the user the webhook has fired for. + pub user_id: String, + ///`CHECK_REPORT_FAILED` + pub webhook_code: String, + ///`CHECK_REPORT` + pub webhook_type: String, +} +impl std::fmt::Display for CraCheckReportFailedWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_check_report_income_insights_get_response.rs b/src/model/cra_check_report_income_insights_get_response.rs new file mode 100644 index 00000000..e95ad6d1 --- /dev/null +++ b/src/model/cra_check_report_income_insights_get_response.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::CraIncomeInsights; +///CraCheckReportIncomeInsightsGetResponse defines the response schema for `/cra/check_report/income_insights/get`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraCheckReportIncomeInsightsGetResponse { + ///The Check Income Insights Report for an end user. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub report: Option, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraCheckReportIncomeInsightsGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_check_report_network_insights_get_response.rs b/src/model/cra_check_report_network_insights_get_response.rs new file mode 100644 index 00000000..fe9d1a18 --- /dev/null +++ b/src/model/cra_check_report_network_insights_get_response.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::CraNetworkInsightsReport; +///CraCheckReportNetworkInsightsGetResponse defines the response schema for `/cra/check_report/network_attributes/get`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraCheckReportNetworkInsightsGetResponse { + ///Contains data for the CRA Network Attributes Report. + pub report: CraNetworkInsightsReport, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraCheckReportNetworkInsightsGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_check_report_partner_insights_get_options.rs b/src/model/cra_check_report_partner_insights_get_options.rs new file mode 100644 index 00000000..6c149d67 --- /dev/null +++ b/src/model/cra_check_report_partner_insights_get_options.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::{PrismProduct, PrismVersions}; +///Defines configuration options to generate Partner Insights +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraCheckReportPartnerInsightsGetOptions { + ///The specific Prism Data products to return. If none are passed in, then all products will be returned. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub prism_products: Option>, + ///The versions of Prism products to evaluate + #[serde(default, skip_serializing_if = "Option::is_none")] + pub prism_versions: Option, +} +impl std::fmt::Display for CraCheckReportPartnerInsightsGetOptions { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_check_report_partner_insights_get_response.rs b/src/model/cra_check_report_partner_insights_get_response.rs new file mode 100644 index 00000000..c7303d52 --- /dev/null +++ b/src/model/cra_check_report_partner_insights_get_response.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::CraPartnerInsights; +///CraPartnerInsightsGetResponse defines the response schema for `/cra/partner_insights/get`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraCheckReportPartnerInsightsGetResponse { + ///The Partner Insights report of the bank data for an end user. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub report: Option, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraCheckReportPartnerInsightsGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_check_report_ready_webhook.rs b/src/model/cra_check_report_ready_webhook.rs new file mode 100644 index 00000000..8ec4dc17 --- /dev/null +++ b/src/model/cra_check_report_ready_webhook.rs @@ -0,0 +1,22 @@ +use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; +///Fired when the Check Report are ready to be retrieved. Once this webhook has fired, the report will be available to retrieve for 24 hours. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraCheckReportReadyWebhook { + ///The Plaid environment the webhook was sent from + pub environment: WebhookEnvironmentValues, + ///A list of `item_ids` that is included in the Check Report. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item_ids: Option>, + ///The `user_id` corresponding to the user the webhook has fired for. + pub user_id: String, + ///`CHECK_REPORT_READY` + pub webhook_code: String, + ///`CHECK_REPORT` + pub webhook_type: String, +} +impl std::fmt::Display for CraCheckReportReadyWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_income_insights.rs b/src/model/cra_income_insights.rs new file mode 100644 index 00000000..385ac573 --- /dev/null +++ b/src/model/cra_income_insights.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +use super::{CraBankIncomeItem, CraBankIncomeSummary, CraBankIncomeWarning}; +///The Check Income Insights Report for an end user. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraIncomeInsights { + ///Summary for income across all income sources and items (max history of 730 days). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bank_income_summary: Option, + ///The number of days requested by the customer for the Check Income Insights Report. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_requested: Option, + ///The time when the Check Income Insights Report was generated. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub generated_time: Option>, + ///The list of Items in the report along with the associated metadata about the Item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub items: Option>, + ///The unique identifier associated with the Check Income Insights Report. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub report_id: Option, + ///If data from the report was unable to be retrieved, the warnings object will contain information about the error that caused the data to be incomplete. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub warnings: Option>, +} +impl std::fmt::Display for CraIncomeInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_application.rs b/src/model/cra_loan_application.rs new file mode 100644 index 00000000..2222e704 --- /dev/null +++ b/src/model/cra_loan_application.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +use super::{CraLoanApplicationDecision, CraLoanType}; +///Contains loan application data. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoanApplication { + ///The date the user applied for the loan. The date should be in ISO 8601 format (YYYY-MM-DD). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub application_date: Option, + /**A unique identifier for the loan application. +Personally identifiable information, such as an email address or phone number, should not be used in the `application_id`.*/ + pub application_id: String, + ///The decision of the loan application. + pub decision: CraLoanApplicationDecision, + ///The date when the loan application's decision was made. The date should be in ISO 8601 format (YYYY-MM-DD). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub decision_date: Option, + ///The type of loan the user applied for. + #[serde(rename = "type")] + pub type_: CraLoanType, + ///The user token for the user associated with the loan. + pub user_token: String, +} +impl std::fmt::Display for CraLoanApplication { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_application_decision.rs b/src/model/cra_loan_application_decision.rs new file mode 100644 index 00000000..623f2f52 --- /dev/null +++ b/src/model/cra_loan_application_decision.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///The decision of the loan application. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CraLoanApplicationDecision { + #[serde(rename = "APPROVED")] + Approved, + #[serde(rename = "DECLINED")] + Declined, + #[serde(rename = "OTHER")] + Other, +} diff --git a/src/model/cra_loan_closed_status.rs b/src/model/cra_loan_closed_status.rs new file mode 100644 index 00000000..187eaf42 --- /dev/null +++ b/src/model/cra_loan_closed_status.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::CraLoanStatus; +///Contains the status and date information of the loan when unregistering. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoanClosedStatus { + ///The effective date for the status of the loan. The date should be in ISO 8601 format (YYYY-MM-DD). + pub date: chrono::NaiveDate, + ///The status of the loan. + pub status: CraLoanStatus, +} +impl std::fmt::Display for CraLoanClosedStatus { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_opened_status.rs b/src/model/cra_loan_opened_status.rs new file mode 100644 index 00000000..e63fc756 --- /dev/null +++ b/src/model/cra_loan_opened_status.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::CraLoanStatus; +///Contains the status and date information of the loan when registering. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoanOpenedStatus { + ///The effective date for the status of the loan. The date should be in ISO 8601 format (YYYY-MM-DD). + pub date: chrono::NaiveDate, + ///The status of the loan. + pub status: CraLoanStatus, +} +impl std::fmt::Display for CraLoanOpenedStatus { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_payment_history.rs b/src/model/cra_loan_payment_history.rs new file mode 100644 index 00000000..d0e2ad0a --- /dev/null +++ b/src/model/cra_loan_payment_history.rs @@ -0,0 +1,26 @@ +use serde::{Serialize, Deserialize}; +///Contains the payment information for a loan payment period. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraLoanPaymentHistory { + ///The amount past due or the charge-off amount of the loan at the end of the payment period. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub amount_past_due: Option, + ///The balance remaining on the loan at the end of the payment period. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub balance_remaining: Option, + /**The number of days the loan was delinquent at the end of the pay period. +If specified, should be greater of equal to 0.*/ + pub days_past_due: i64, + ///The payment due date or end date of the payment period. The date should be in ISO 8601 format (YYYY-MM-DD). + pub due_date: chrono::NaiveDate, + /**The index to identify the loan's payment period, starting from 1. +For example: + 1 means the period between the loan's opening date and the 1st payment due date. + 2 means the period between the loan's 1st payment due date and 2nd payment due date.*/ + pub period: i64, +} +impl std::fmt::Display for CraLoanPaymentHistory { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_payment_schedule.rs b/src/model/cra_loan_payment_schedule.rs new file mode 100644 index 00000000..e1b5d1a2 --- /dev/null +++ b/src/model/cra_loan_payment_schedule.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +/**The frequency of a loan's payment schedule. +`BIWEEKLY` represents one payment every two weeks.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CraLoanPaymentSchedule { + #[serde(rename = "DAILY")] + Daily, + #[serde(rename = "WEEKLY")] + Weekly, + #[serde(rename = "BIWEEKLY")] + Biweekly, + #[serde(rename = "MONTHLY")] + Monthly, + #[serde(rename = "QUARTERLY")] + Quarterly, + #[serde(rename = "ANNUALLY")] + Annually, + #[serde(rename = "OTHER")] + Other, +} diff --git a/src/model/cra_loan_register.rs b/src/model/cra_loan_register.rs new file mode 100644 index 00000000..56b24e28 --- /dev/null +++ b/src/model/cra_loan_register.rs @@ -0,0 +1,34 @@ +use serde::{Serialize, Deserialize}; +use super::{ + CraLoanOpenedStatus, CraLoanPaymentSchedule, CraLoanRegisterApplication, CraLoanType, +}; +///Contains loan data to register. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoanRegister { + ///Contains loan application data to register. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub application: Option, + ///The total amount of the approved loan. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub loan_amount: Option, + /**A unique identifier for the loan. +Personally identifiable information, such as an email address or phone number, should not be used in the `loan_id`.*/ + pub loan_id: String, + ///The date the loan account was opened. The date should be in ISO 8601 format (YYYY-MM-DD). + pub opened_date: chrono::NaiveDate, + ///Contains the status and date information of the loan when registering. + pub opened_with_status: CraLoanOpenedStatus, + /**The frequency of a loan's payment schedule. +`BIWEEKLY` represents one payment every two weeks.*/ + pub payment_schedule: CraLoanPaymentSchedule, + ///The type of loan the user applied for. + #[serde(rename = "type")] + pub type_: CraLoanType, + ///The user token for the user associated with the loan. + pub user_token: String, +} +impl std::fmt::Display for CraLoanRegister { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_register_application.rs b/src/model/cra_loan_register_application.rs new file mode 100644 index 00000000..9f092db7 --- /dev/null +++ b/src/model/cra_loan_register_application.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +///Contains loan application data to register. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraLoanRegisterApplication { + ///The date the user applied for the loan. The date should be in ISO 8601 format (YYYY-MM-DD). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub application_date: Option, + /**A unique identifier for the loan application. +Personally identifiable information, such as an email address or phone number, should not be used in the `application_id`.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub application_id: Option, +} +impl std::fmt::Display for CraLoanRegisterApplication { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_status.rs b/src/model/cra_loan_status.rs new file mode 100644 index 00000000..43932abe --- /dev/null +++ b/src/model/cra_loan_status.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +///The status of the loan. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CraLoanStatus { + #[serde(rename = "APPROVED")] + Approved, + #[serde(rename = "DECLINED")] + Declined, + #[serde(rename = "BOOKED")] + Booked, + #[serde(rename = "CURRENT")] + Current, + #[serde(rename = "DELINQUENT")] + Delinquent, + #[serde(rename = "DEFAULT")] + Default, + #[serde(rename = "CHARGED_OFF")] + ChargedOff, + #[serde(rename = "TRANSFERRED")] + Transferred, + #[serde(rename = "PAID_OFF")] + PaidOff, + #[serde(rename = "OTHER")] + Other, +} diff --git a/src/model/cra_loan_status_history_update.rs b/src/model/cra_loan_status_history_update.rs new file mode 100644 index 00000000..df0bb2b8 --- /dev/null +++ b/src/model/cra_loan_status_history_update.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::CraLoanStatus; +///Contains the status and date of an update to the loan. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoanStatusHistoryUpdate { + ///The effective date for the status of the loan. The date should be in ISO 8601 format (YYYY-MM-DD). + pub date: chrono::NaiveDate, + ///The status of the loan. + pub status: CraLoanStatus, +} +impl std::fmt::Display for CraLoanStatusHistoryUpdate { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_type.rs b/src/model/cra_loan_type.rs new file mode 100644 index 00000000..b7659a33 --- /dev/null +++ b/src/model/cra_loan_type.rs @@ -0,0 +1,23 @@ +use serde::{Serialize, Deserialize}; +///The type of loan the user applied for. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CraLoanType { + #[serde(rename = "PERSONAL")] + Personal, + #[serde(rename = "CREDIT_CARD")] + CreditCard, + #[serde(rename = "BUSINESS")] + Business, + #[serde(rename = "MORTGAGE")] + Mortgage, + #[serde(rename = "AUTO")] + Auto, + #[serde(rename = "PAYDAY")] + Payday, + #[serde(rename = "STUDENT")] + Student, + #[serde(rename = "HOME_EQUITY")] + HomeEquity, + #[serde(rename = "OTHER")] + Other, +} diff --git a/src/model/cra_loan_unregister.rs b/src/model/cra_loan_unregister.rs new file mode 100644 index 00000000..87e70d12 --- /dev/null +++ b/src/model/cra_loan_unregister.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::CraLoanClosedStatus; +///Contains loan data for the loan being unregistered. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoanUnregister { + ///Contains the status and date information of the loan when unregistering. + pub closed_with_status: CraLoanClosedStatus, + /**A unique identifier for the loan. +Personally identifiable information, such as an email address or phone number, should not be used in the `loan_id`.*/ + pub loan_id: String, +} +impl std::fmt::Display for CraLoanUnregister { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_unregister_response.rs b/src/model/cra_loan_unregister_response.rs new file mode 100644 index 00000000..b447eb4d --- /dev/null +++ b/src/model/cra_loan_unregister_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///CraLoanUnregisterResponse defines the response schema for `/cra/loans/unregister`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraLoanUnregisterResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraLoanUnregisterResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loan_update.rs b/src/model/cra_loan_update.rs new file mode 100644 index 00000000..ee1cabe2 --- /dev/null +++ b/src/model/cra_loan_update.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +use super::{CraLoanPaymentHistory, CraLoanStatusHistoryUpdate}; +///Contains loan data to update. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraLoanUpdate { + /**A unique identifier for the loan. +Personally identifiable information, such as an email address or phone number, should not be used in the `loan_id`.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub loan_id: Option, + ///The updates to the payment history for the loan. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub payment_history: Option>, + ///A list of status update history of the loan. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status_history: Option>, +} +impl std::fmt::Display for CraLoanUpdate { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loans_applications_register_response.rs b/src/model/cra_loans_applications_register_response.rs new file mode 100644 index 00000000..f223e383 --- /dev/null +++ b/src/model/cra_loans_applications_register_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///CraLoansApplicationsRegisterResponse defines the response schema for `/cra/loans/applications/register`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraLoansApplicationsRegisterResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraLoansApplicationsRegisterResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loans_register_response.rs b/src/model/cra_loans_register_response.rs new file mode 100644 index 00000000..1455add6 --- /dev/null +++ b/src/model/cra_loans_register_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///CraLoansRegisterResponse defines the response schema for `/cra/loans/register`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraLoansRegisterResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraLoansRegisterResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_loans_update_response.rs b/src/model/cra_loans_update_response.rs new file mode 100644 index 00000000..6cfdd94d --- /dev/null +++ b/src/model/cra_loans_update_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///CraLoansUpdateResponse defines the response schema for `/cra/loans/update`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraLoansUpdateResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraLoansUpdateResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_monitoring_insights_get_response.rs b/src/model/cra_monitoring_insights_get_response.rs new file mode 100644 index 00000000..9e33eff8 --- /dev/null +++ b/src/model/cra_monitoring_insights_get_response.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::CraMonitoringInsightsItem; +///CraMonitoringInsightsGetResponse defines the response schema for `cra/monitoring_insights/get` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraMonitoringInsightsGetResponse { + ///An array of Monitoring Insights Items associated with the user. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub items: Vec, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraMonitoringInsightsGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_monitoring_insights_item.rs b/src/model/cra_monitoring_insights_item.rs new file mode 100644 index 00000000..e55fcd02 --- /dev/null +++ b/src/model/cra_monitoring_insights_item.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +use super::{MonitoringInsights, MonitoringInsightsItemStatus}; +///An object representing a Monitoring Insights Item +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraMonitoringInsightsItem { + ///The date and time when the specific insights were generated (per-item), in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (e.g. "2018-04-12T03:32:11Z"). + pub date_generated: chrono::DateTime, + ///An object representing the Monitoring Insights for the given Item + #[serde(default, skip_serializing_if = "Option::is_none")] + pub insights: Option, + ///The `item_id` of the Item associated with the insights + pub item_id: String, + ///An object with details of the Monitoring Insights Item's status. + pub status: MonitoringInsightsItemStatus, +} +impl std::fmt::Display for CraMonitoringInsightsItem { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_monitoring_insights_subscribe_response.rs b/src/model/cra_monitoring_insights_subscribe_response.rs new file mode 100644 index 00000000..5773fe0d --- /dev/null +++ b/src/model/cra_monitoring_insights_subscribe_response.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///CraMonitoringInsightsSubscribeResponse defines the response schema for `cra/monitoring_insights/subscribe` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraMonitoringInsightsSubscribeResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, + ///A unique identifier for the subscription. + pub subscription_id: String, +} +impl std::fmt::Display for CraMonitoringInsightsSubscribeResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_monitoring_insights_unsubscribe_response.rs b/src/model/cra_monitoring_insights_unsubscribe_response.rs new file mode 100644 index 00000000..b2e4d90d --- /dev/null +++ b/src/model/cra_monitoring_insights_unsubscribe_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///CraMonitoringInsightsUnsubscribeResponse defines the response schema for `cra/monitoring_insights/unsubscribe` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraMonitoringInsightsUnsubscribeResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraMonitoringInsightsUnsubscribeResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_network_insights_item.rs b/src/model/cra_network_insights_item.rs new file mode 100644 index 00000000..7671478e --- /dev/null +++ b/src/model/cra_network_insights_item.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///Contains data about the connected Item. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraNetworkInsightsItem { + ///The ID for the institution the user linked. + pub institution_id: String, + ///The name of the institution the user linked. + pub institution_name: String, + ///The identifier for the Item. + pub item_id: String, +} +impl std::fmt::Display for CraNetworkInsightsItem { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_network_insights_report.rs b/src/model/cra_network_insights_report.rs new file mode 100644 index 00000000..832551d5 --- /dev/null +++ b/src/model/cra_network_insights_report.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +use super::{CraNetworkInsightsItem, NetworkInsightsSchema}; +///Contains data for the CRA Network Attributes Report. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraNetworkInsightsReport { + ///The time when the Network Attributes Report was generated. + pub generated_time: chrono::DateTime, + ///The Items the end user connected in Link. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub items: Vec, + ///A map of network attributes, where the key is a string, and the value is a float, int, or boolean. + pub network_attributes: NetworkInsightsSchema, + ///The unique identifier associated with the Network Attributes report object. + pub report_id: String, +} +impl std::fmt::Display for CraNetworkInsightsReport { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_partner_insights.rs b/src/model/cra_partner_insights.rs new file mode 100644 index 00000000..03905739 --- /dev/null +++ b/src/model/cra_partner_insights.rs @@ -0,0 +1,23 @@ +use serde::{Serialize, Deserialize}; +use super::{CraPartnerInsightsItem, CraPartnerInsightsPrism}; +///The Partner Insights report of the bank data for an end user. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraPartnerInsights { + ///The time when the Partner Insights report was generated. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub generated_time: Option>, + ///The list of Items used in the report along with the associated metadata about the Item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub items: Option>, + ///The Prism Data insights for the user. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub prism: Option, + ///A unique identifier associated with the Partner Insights object. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub report_id: Option, +} +impl std::fmt::Display for CraPartnerInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_partner_insights_complete_webhook.rs b/src/model/cra_partner_insights_complete_webhook.rs new file mode 100644 index 00000000..8d4471c5 --- /dev/null +++ b/src/model/cra_partner_insights_complete_webhook.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; +///Fired when a partner insights report has finished generating and results are available +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraPartnerInsightsCompleteWebhook { + ///The Plaid environment the webhook was sent from + pub environment: WebhookEnvironmentValues, + ///The `user_id` corresponding to the user the webhook has fired for. + pub user_id: String, + ///`PARTNER_INSIGHTS_COMPLETE` + pub webhook_code: String, + ///`CRA_INSIGHTS` + pub webhook_type: String, +} +impl std::fmt::Display for CraPartnerInsightsCompleteWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_partner_insights_error_webhook.rs b/src/model/cra_partner_insights_error_webhook.rs new file mode 100644 index 00000000..d9c47bc6 --- /dev/null +++ b/src/model/cra_partner_insights_error_webhook.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; +///Fired when a partner insights report has failed to generate +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraPartnerInsightsErrorWebhook { + ///The Plaid environment the webhook was sent from + pub environment: WebhookEnvironmentValues, + ///The `user_id` corresponding to the user the webhook has fired for. + pub user_id: String, + ///`PARTNER_INSIGHTS_ERROR` + pub webhook_code: String, + ///`CRA_INSIGHTS` + pub webhook_type: String, +} +impl std::fmt::Display for CraPartnerInsightsErrorWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_partner_insights_get_response.rs b/src/model/cra_partner_insights_get_response.rs new file mode 100644 index 00000000..f5b37a18 --- /dev/null +++ b/src/model/cra_partner_insights_get_response.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::CraPartnerInsights; +///CraPartnerInsightsGetResponse defines the response schema for `/cra/partner_insights/get`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraPartnerInsightsGetResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub report: Option>, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for CraPartnerInsightsGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_partner_insights_item.rs b/src/model/cra_partner_insights_item.rs new file mode 100644 index 00000000..8ae55e71 --- /dev/null +++ b/src/model/cra_partner_insights_item.rs @@ -0,0 +1,23 @@ +use serde::{Serialize, Deserialize}; +use super::CraPartnerInsightsItemAccount; +///The details and metadata for an end user's Item. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraPartnerInsightsItem { + ///A list of accounts in the item + #[serde(default, skip_serializing_if = "Option::is_none")] + pub accounts: Option>, + ///The ID for the institution that the user linked. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution_id: Option, + ///The name of the institution the user linked. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution_name: Option, + ///The identifier for the item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item_id: Option, +} +impl std::fmt::Display for CraPartnerInsightsItem { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_partner_insights_item_account.rs b/src/model/cra_partner_insights_item_account.rs new file mode 100644 index 00000000..c16c056a --- /dev/null +++ b/src/model/cra_partner_insights_item_account.rs @@ -0,0 +1,41 @@ +use serde::{Serialize, Deserialize}; +use super::{ + CraPartnerInsightsItemAccountMetadata, CreditBankIncomeAccountType, + DepositoryAccountSubtype, Owner, +}; +///Account data corresponding to the item from which Partner Insights were generated from +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraPartnerInsightsItemAccount { + /**Plaid's unique identifier for the account. This value will not change unless Plaid can't reconcile the account with the data returned by the financial institution. This may occur, for example, when the name of the account changes. If this happens a new `account_id` will be assigned to the account. + +If an account with a specific `account_id` disappears instead of changing, the account is likely closed. Closed accounts are not returned by the Plaid API. + +Like all Plaid identifiers, the `account_id` is case sensitive.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_id: Option, + /**The last 2-4 alphanumeric characters of an account's official account number. +Note that the mask may be non-unique between an Item's accounts, and it may also +not match the mask that the bank displays to the user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mask: Option, + ///An object containing metadata about the extracted account. + pub metadata: CraPartnerInsightsItemAccountMetadata, + ///The name of the account + pub name: String, + ///The official name of the bank account. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub official_name: Option, + ///Data returned by the financial institution about the account owner or owners. Identity information is optional, so field may return an empty array. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub owners: Vec, + ///Valid account subtypes for depository accounts. For a list containing descriptions of each subtype, see [Account schemas](https://plaid.com/docs/api/accounts/#StandaloneAccountType-depository). + pub subtype: DepositoryAccountSubtype, + ///The account type. This will always be `depository`. + #[serde(rename = "type")] + pub type_: CreditBankIncomeAccountType, +} +impl std::fmt::Display for CraPartnerInsightsItemAccount { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_partner_insights_item_account_metadata.rs b/src/model/cra_partner_insights_item_account_metadata.rs new file mode 100644 index 00000000..c03b00b9 --- /dev/null +++ b/src/model/cra_partner_insights_item_account_metadata.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///An object containing metadata about the extracted account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraPartnerInsightsItemAccountMetadata { + ///The date of the most recent extracted transaction, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ("yyyy-mm-dd"). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + ///The date of the earliest extracted transaction, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ("yyyy-mm-dd"). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, +} +impl std::fmt::Display for CraPartnerInsightsItemAccountMetadata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_partner_insights_prism.rs b/src/model/cra_partner_insights_prism.rs new file mode 100644 index 00000000..9910d6f5 --- /dev/null +++ b/src/model/cra_partner_insights_prism.rs @@ -0,0 +1,22 @@ +use serde::{Serialize, Deserialize}; +use super::{PrismCashScore, PrismFirstDetect, PrismInsights}; +///The Prism Data insights for the user. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraPartnerInsightsPrism { + ///The data from the CashScore® product returned by Prism Data. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cash_score: Option, + ///The data from the FirstDetect product returned by Prism Data. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_detect: Option, + ///The data from the Insights product returned by Prism Data. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub insights: Option, + ///Details on whether the Prism Data attributes succeeded or failed to be generated. + pub status: String, +} +impl std::fmt::Display for CraPartnerInsightsPrism { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/cra_pdf_add_ons.rs b/src/model/cra_pdf_add_ons.rs new file mode 100644 index 00000000..54c8371f --- /dev/null +++ b/src/model/cra_pdf_add_ons.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +/**A list of add-ons that can be included in the PDF. + +`cra_income_insights`: Include Income Insights report in the PDF.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CraPdfAddOns { + #[serde(rename = "cra_income_insights")] + CraIncomeInsights, +} diff --git a/src/model/cra_prediction_interval.rs b/src/model/cra_prediction_interval.rs new file mode 100644 index 00000000..41038928 --- /dev/null +++ b/src/model/cra_prediction_interval.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +///The object containing prediction interval data. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CraPredictionInterval { + ///The lower bound of the predicted attribute for the given probability. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lower_bound: Option, + /**The probability of the actual value of the attribute falling within the upper and lower bound. +This is a percentage represented as a value between 0 and 1.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub probability: Option, + ///The upper bound of the predicted attribute for the given probability. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub upper_bound: Option, +} +impl std::fmt::Display for CraPredictionInterval { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/credit1099.rs b/src/model/credit1099.rs index 0505a23c..f93aec5c 100644 --- a/src/model/credit1099.rs +++ b/src/model/credit1099.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; use super::{ Credit1099Filer, Credit1099Payer, Credit1099Recipient, CreditDocumentMetadata, + Form1099Type, }; ///An object representing an end user's 1099 tax form -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Credit1099 { ///Amount reported for April. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -44,7 +45,7 @@ pub struct Credit1099 { ///Form 1099 Type #[serde(rename = "form_1099_type")] #[serde(default, skip_serializing_if = "Option::is_none")] - pub form1099_type: Option, + pub form1099_type: Option, ///Gross amount reported. #[serde(default, skip_serializing_if = "Option::is_none")] pub gross_amount: Option, @@ -174,4 +175,4 @@ impl std::fmt::Display for Credit1099 { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit1099_filer.rs b/src/model/credit1099_filer.rs index dd57d259..e982f235 100644 --- a/src/model/credit1099_filer.rs +++ b/src/model/credit1099_filer.rs @@ -21,4 +21,4 @@ impl std::fmt::Display for Credit1099Filer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit1099_payer.rs b/src/model/credit1099_payer.rs index ebb26857..4e4209d9 100644 --- a/src/model/credit1099_payer.rs +++ b/src/model/credit1099_payer.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for Credit1099Payer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit1099_recipient.rs b/src/model/credit1099_recipient.rs index da73fe16..6ae8920c 100644 --- a/src/model/credit1099_recipient.rs +++ b/src/model/credit1099_recipient.rs @@ -26,4 +26,4 @@ impl std::fmt::Display for Credit1099Recipient { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_account_subtype.rs b/src/model/credit_account_subtype.rs new file mode 100644 index 00000000..125ed0a5 --- /dev/null +++ b/src/model/credit_account_subtype.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Valid account subtypes for credit accounts. For a list containing descriptions of each subtype, see [Account schemas](https://plaid.com/docs/api/accounts/#StandaloneAccountType-credit). +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditAccountSubtype { + #[serde(rename = "credit card")] + CreditCard, + #[serde(rename = "paypal")] + Paypal, + #[serde(rename = "all")] + All, +} diff --git a/src/model/credit_account_subtypes.rs b/src/model/credit_account_subtypes.rs new file mode 100644 index 00000000..31198418 --- /dev/null +++ b/src/model/credit_account_subtypes.rs @@ -0,0 +1,4 @@ +use serde::{Serialize, Deserialize}; +use super::CreditAccountSubtype; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CreditAccountSubtypes(pub Vec); diff --git a/src/model/credit_ach_class.rs b/src/model/credit_ach_class.rs new file mode 100644 index 00000000..3b8b7a70 --- /dev/null +++ b/src/model/credit_ach_class.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**Specifies the use case of the transfer. Required for transfers on an ACH network. + +`"ccd"` - Corporate Credit or Debit - fund transfer between two corporate bank accounts + +`"ppd"` - Prearranged Payment or Deposit - the transfer is part of a pre-existing relationship with a consumer, eg. bill payment + +`"web"` - A credit Entry initiated by or on behalf of a holder of a Consumer Account that is intended for a Consumer Account of a Receiver*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditAchClass { + #[serde(rename = "ccd")] + Ccd, + #[serde(rename = "ppd")] + Ppd, + #[serde(rename = "web")] + Web, +} diff --git a/src/model/credit_amount_with_currency.rs b/src/model/credit_amount_with_currency.rs index e2e875a9..fd704b32 100644 --- a/src/model/credit_amount_with_currency.rs +++ b/src/model/credit_amount_with_currency.rs @@ -3,8 +3,7 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct CreditAmountWithCurrency { ///Value of amount with up to 2 decimal places. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub amount: Option, + pub amount: f64, ///The ISO 4217 currency code of the amount or balance. #[serde(default, skip_serializing_if = "Option::is_none")] pub iso_currency_code: Option, @@ -17,4 +16,4 @@ impl std::fmt::Display for CreditAmountWithCurrency { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_audit_copy_token_create_response.rs b/src/model/credit_audit_copy_token_create_response.rs index 04302cdf..b5a0e5d5 100644 --- a/src/model/credit_audit_copy_token_create_response.rs +++ b/src/model/credit_audit_copy_token_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditAuditCopyTokenCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_audit_copy_token_remove_response.rs b/src/model/credit_audit_copy_token_remove_response.rs index c26863c8..da08cf2b 100644 --- a/src/model/credit_audit_copy_token_remove_response.rs +++ b/src/model/credit_audit_copy_token_remove_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditAuditCopyTokenRemoveResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_audit_copy_token_update_response.rs b/src/model/credit_audit_copy_token_update_response.rs index 639dc245..fc1d0f0c 100644 --- a/src/model/credit_audit_copy_token_update_response.rs +++ b/src/model/credit_audit_copy_token_update_response.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///CreditAuditCopyTokenUpdateResponse defines the response schema for `/credit/audit_copy_token/update` +///Defines the response schema for `/credit/audit_copy_token/update` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct CreditAuditCopyTokenUpdateResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditAuditCopyTokenUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_employer.rs b/src/model/credit_bank_employer.rs index 9805465c..356fd8cb 100644 --- a/src/model/credit_bank_employer.rs +++ b/src/model/credit_bank_employer.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for CreditBankEmployer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_employment.rs b/src/model/credit_bank_employment.rs index 3caaa95a..7e160b77 100644 --- a/src/model/credit_bank_employment.rs +++ b/src/model/credit_bank_employment.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for CreditBankEmployment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_employment_get_response.rs b/src/model/credit_bank_employment_get_response.rs index a59724ed..6e19be89 100644 --- a/src/model/credit_bank_employment_get_response.rs +++ b/src/model/credit_bank_employment_get_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CreditBankEmploymentGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_employment_item.rs b/src/model/credit_bank_employment_item.rs index 323d5680..38003f9e 100644 --- a/src/model/credit_bank_employment_item.rs +++ b/src/model/credit_bank_employment_item.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for CreditBankEmploymentItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_employment_report.rs b/src/model/credit_bank_employment_report.rs index b5626519..b68f1a57 100644 --- a/src/model/credit_bank_employment_report.rs +++ b/src/model/credit_bank_employment_report.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for CreditBankEmploymentReport { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_employment_warning.rs b/src/model/credit_bank_employment_warning.rs index 9eb2af77..dd792e42 100644 --- a/src/model/credit_bank_employment_warning.rs +++ b/src/model/credit_bank_employment_warning.rs @@ -1,7 +1,9 @@ use serde::{Serialize, Deserialize}; -use super::CreditBankIncomeCause; +use super::{ + CreditBankEmploymentWarningType, CreditBankIncomeCause, CreditBankIncomeWarningCode, +}; ///The warning associated with the data that was unavailable for the Bank Employment Report. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditBankEmploymentWarning { ///An error object and associated `item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items. pub cause: CreditBankIncomeCause, @@ -11,12 +13,12 @@ pub struct CreditBankEmploymentWarning { `ITEM_UNAPPROVED`: User exited flow before giving permission to share data for the Item `REPORT_DELETED`: Report deleted due to customer or consumer request `DATA_UNAVAILABLE`: No relevant data was found for the Item*/ - pub warning_code: String, + pub warning_code: CreditBankIncomeWarningCode, ///The warning type which will always be `BANK_EMPLOYMENT_WARNING`. - pub warning_type: String, + pub warning_type: CreditBankEmploymentWarningType, } impl std::fmt::Display for CreditBankEmploymentWarning { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_employment_warning_type.rs b/src/model/credit_bank_employment_warning_type.rs new file mode 100644 index 00000000..f33ca15b --- /dev/null +++ b/src/model/credit_bank_employment_warning_type.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///The warning type which will always be `BANK_EMPLOYMENT_WARNING`. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditBankEmploymentWarningType { + #[serde(rename = "BANK_EMPLOYMENT_WARNING")] + BankEmploymentWarning, +} diff --git a/src/model/credit_bank_income.rs b/src/model/credit_bank_income.rs index 27527299..f7e33eae 100644 --- a/src/model/credit_bank_income.rs +++ b/src/model/credit_bank_income.rs @@ -9,16 +9,16 @@ pub struct CreditBankIncome { ///Summary for bank income across all income sources and items (max history of 730 days). #[serde(default, skip_serializing_if = "Option::is_none")] pub bank_income_summary: Option, - ///The number of days requested by the customer for the Bank Income Report. + ///The number of days requested by the customer for the report. #[serde(default, skip_serializing_if = "Option::is_none")] pub days_requested: Option, - ///The time when the Bank Income Report was generated. + ///The time when the report was generated. #[serde(default, skip_serializing_if = "Option::is_none")] pub generated_time: Option>, ///The list of Items in the report along with the associated metadata about the Item. #[serde(default, skip_serializing_if = "Option::is_none")] pub items: Option>, - ///If data from the Bank Income report was unable to be retrieved, the warnings will contain information about the error that caused the data to be incomplete. + ///If data from the report was unable to be retrieved, the warnings will contain information about the error that caused the data to be incomplete. #[serde(default, skip_serializing_if = "Option::is_none")] pub warnings: Option>, } @@ -26,4 +26,4 @@ impl std::fmt::Display for CreditBankIncome { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_account.rs b/src/model/credit_bank_income_account.rs index 88f2f03e..11c2833d 100644 --- a/src/model/credit_bank_income_account.rs +++ b/src/model/credit_bank_income_account.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::Owner; +use super::{CreditBankIncomeAccountType, DepositoryAccountSubtype, Owner}; ///The Item's bank accounts that have the selected data. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditBankIncomeAccount { ///Plaid's unique identifier for the account. pub account_id: String, @@ -18,13 +18,13 @@ Note that the mask may be non-unique between an Item's accounts, and it may also #[serde(default, skip_serializing_if = "Vec::is_empty")] pub owners: Vec, ///Valid account subtypes for depository accounts. For a list containing descriptions of each subtype, see [Account schemas](https://plaid.com/docs/api/accounts/#StandaloneAccountType-depository). - pub subtype: String, + pub subtype: DepositoryAccountSubtype, ///The account type. This will always be `depository`. #[serde(rename = "type")] - pub type_: String, + pub type_: CreditBankIncomeAccountType, } impl std::fmt::Display for CreditBankIncomeAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_account_type.rs b/src/model/credit_bank_income_account_type.rs new file mode 100644 index 00000000..bfa1b58c --- /dev/null +++ b/src/model/credit_bank_income_account_type.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///The account type. This will always be `depository`. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditBankIncomeAccountType { + #[serde(rename = "depository")] + Depository, +} diff --git a/src/model/credit_bank_income_category.rs b/src/model/credit_bank_income_category.rs new file mode 100644 index 00000000..202fed1a --- /dev/null +++ b/src/model/credit_bank_income_category.rs @@ -0,0 +1,50 @@ +use serde::{Serialize, Deserialize}; +/**The income category. +`BANK_INTEREST`: Interest earned from a bank account. +`BENEFIT_OTHER`: Government benefits other than retirement, unemployment, child support, or disability. Currently used only in the UK, to represent benefits such as Cost of Living Payments. +`CASH`: Deprecated and used only for existing legacy implementations. Has been replaced by `CASH_DEPOSIT` and `TRANSFER_FROM_APPLICATION`. +`CASH_DEPOSIT`: A cash or check deposit. +`CHILD_SUPPORT`: Child support payments received. +`GIG_ECONOMY`: Income earned as a gig economy worker, e.g. driving for Uber, Lyft, Postmates, DoorDash, etc. +`LONG_TERM_DISABILITY`: Disability payments, including Social Security disability benefits. +`OTHER`: Income that could not be categorized as any other income category. +`MILITARY`: Veterans benefits. Income earned as salary for serving in the military (e.g. through DFAS) will be classified as `SALARY` rather than `MILITARY`. +`RENTAL`: Income earned from a rental property. Income may be identified as rental when the payment is received through a rental platform, e.g. Airbnb; rent paid directly by the tenant to the property owner (e.g. via cash, check, or ACH) will typically not be classified as rental income. +`RETIREMENT`: Payments from private retirement systems, pensions, and government retirement programs, including Social Security retirement benefits. +`SALARY`: Payment from an employer to an earner or other form of permanent employment. +`TAX_REFUND`: A tax refund. +`TRANSFER_FROM_APPLICATION`: Deposits from a money transfer app, such as Venmo, Cash App, or Zelle. +`UNEMPLOYMENT`: Unemployment benefits. In the UK, includes certain low-income benefits such as the Universal Credit.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditBankIncomeCategory { + #[serde(rename = "SALARY")] + Salary, + #[serde(rename = "UNEMPLOYMENT")] + Unemployment, + #[serde(rename = "CASH")] + Cash, + #[serde(rename = "GIG_ECONOMY")] + GigEconomy, + #[serde(rename = "RENTAL")] + Rental, + #[serde(rename = "CHILD_SUPPORT")] + ChildSupport, + #[serde(rename = "MILITARY")] + Military, + #[serde(rename = "RETIREMENT")] + Retirement, + #[serde(rename = "LONG_TERM_DISABILITY")] + LongTermDisability, + #[serde(rename = "BANK_INTEREST")] + BankInterest, + #[serde(rename = "CASH_DEPOSIT")] + CashDeposit, + #[serde(rename = "TRANSFER_FROM_APPLICATION")] + TransferFromApplication, + #[serde(rename = "TAX_REFUND")] + TaxRefund, + #[serde(rename = "BENEFIT_OTHER")] + BenefitOther, + #[serde(rename = "OTHER")] + Other, +} diff --git a/src/model/credit_bank_income_cause.rs b/src/model/credit_bank_income_cause.rs index dbcf41b2..e4282728 100644 --- a/src/model/credit_bank_income_cause.rs +++ b/src/model/credit_bank_income_cause.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::CreditBankIncomeErrorType; ///An error object and associated `item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditBankIncomeCause { /**A user-friendly representation of the error code. null if the error is not related to user action. This may change over time and is not safe for programmatic use.*/ @@ -10,7 +11,7 @@ This may change over time and is not safe for programmatic use.*/ ///A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use. pub error_message: String, ///A broad categorization of the error. Safe for programmatic use. - pub error_type: String, + pub error_type: CreditBankIncomeErrorType, ///The `item_id` of the Item associated with this warning. pub item_id: String, } @@ -18,4 +19,4 @@ impl std::fmt::Display for CreditBankIncomeCause { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_error_type.rs b/src/model/credit_bank_income_error_type.rs new file mode 100644 index 00000000..be6fb837 --- /dev/null +++ b/src/model/credit_bank_income_error_type.rs @@ -0,0 +1,37 @@ +use serde::{Serialize, Deserialize}; +///A broad categorization of the error. Safe for programmatic use. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditBankIncomeErrorType { + #[serde(rename = "INTERNAL_SERVER_ERROR")] + InternalServerError, + #[serde(rename = "INSUFFICIENT_CREDENTIALS")] + InsufficientCredentials, + #[serde(rename = "ITEM_LOCKED")] + ItemLocked, + #[serde(rename = "USER_SETUP_REQUIRED")] + UserSetupRequired, + #[serde(rename = "COUNTRY_NOT_SUPPORTED")] + CountryNotSupported, + #[serde(rename = "INSTITUTION_DOWN")] + InstitutionDown, + #[serde(rename = "INSTITUTION_NO_LONGER_SUPPORTED")] + InstitutionNoLongerSupported, + #[serde(rename = "INSTITUTION_NOT_RESPONDING")] + InstitutionNotResponding, + #[serde(rename = "INVALID_CREDENTIALS")] + InvalidCredentials, + #[serde(rename = "INVALID_MFA")] + InvalidMfa, + #[serde(rename = "INVALID_SEND_METHOD")] + InvalidSendMethod, + #[serde(rename = "ITEM_LOGIN_REQUIRED")] + ItemLoginRequired, + #[serde(rename = "MFA_NOT_SUPPORTED")] + MfaNotSupported, + #[serde(rename = "NO_ACCOUNTS")] + NoAccounts, + #[serde(rename = "ITEM_NOT_SUPPORTED")] + ItemNotSupported, + #[serde(rename = "ACCESS_NOT_GRANTED")] + AccessNotGranted, +} diff --git a/src/model/credit_bank_income_get_request_options.rs b/src/model/credit_bank_income_get_request_options.rs index 6c8f4196..b15afae5 100644 --- a/src/model/credit_bank_income_get_request_options.rs +++ b/src/model/credit_bank_income_get_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for CreditBankIncomeGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_get_response.rs b/src/model/credit_bank_income_get_response.rs index a6d7133d..eaaac865 100644 --- a/src/model/credit_bank_income_get_response.rs +++ b/src/model/credit_bank_income_get_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for CreditBankIncomeGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_historical_summary.rs b/src/model/credit_bank_income_historical_summary.rs index e73294f2..0a0e3502 100644 --- a/src/model/credit_bank_income_historical_summary.rs +++ b/src/model/credit_bank_income_historical_summary.rs @@ -38,4 +38,4 @@ impl std::fmt::Display for CreditBankIncomeHistoricalSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_item.rs b/src/model/credit_bank_income_item.rs index 4f0292c8..d0ad61dd 100644 --- a/src/model/credit_bank_income_item.rs +++ b/src/model/credit_bank_income_item.rs @@ -26,4 +26,4 @@ impl std::fmt::Display for CreditBankIncomeItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_pay_frequency.rs b/src/model/credit_bank_income_pay_frequency.rs new file mode 100644 index 00000000..1d6609a3 --- /dev/null +++ b/src/model/credit_bank_income_pay_frequency.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +///The income pay frequency. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditBankIncomePayFrequency { + #[serde(rename = "WEEKLY")] + Weekly, + #[serde(rename = "BIWEEKLY")] + Biweekly, + #[serde(rename = "SEMI_MONTHLY")] + SemiMonthly, + #[serde(rename = "MONTHLY")] + Monthly, + #[serde(rename = "DAILY")] + Daily, + #[serde(rename = "UNKNOWN")] + Unknown, +} diff --git a/src/model/credit_bank_income_refresh_request_options.rs b/src/model/credit_bank_income_refresh_request_options.rs index cdf4aeb5..1dc181ef 100644 --- a/src/model/credit_bank_income_refresh_request_options.rs +++ b/src/model/credit_bank_income_refresh_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for CreditBankIncomeRefreshRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_refresh_response.rs b/src/model/credit_bank_income_refresh_response.rs index c687b370..fc5dfbe6 100644 --- a/src/model/credit_bank_income_refresh_response.rs +++ b/src/model/credit_bank_income_refresh_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for CreditBankIncomeRefreshResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_source.rs b/src/model/credit_bank_income_source.rs index 820dbc1f..35b73aa1 100644 --- a/src/model/credit_bank_income_source.rs +++ b/src/model/credit_bank_income_source.rs @@ -1,7 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::CreditBankIncomeHistoricalSummary; +use super::{ + CreditBankIncomeCategory, CreditBankIncomeHistoricalSummary, + CreditBankIncomePayFrequency, +}; ///Detailed information for the income source. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditBankIncomeSource { ///Plaid's unique identifier for the account. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -12,9 +15,24 @@ The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ pub end_date: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub historical_summary: Option>, - ///The income category. Note that the `CASH` value has been deprecated and is used only for existing legacy implementations. It has been replaced by the new categories `CASH_DEPOSIT` (representing cash or check deposits) and `TRANSFER_FROM_APPLICATION` (representing cash transfers originating from apps, such as Zelle or Venmo). - #[serde(default, skip_serializing_if = "Option::is_none")] - pub income_category: Option, + /**The income category. +`BANK_INTEREST`: Interest earned from a bank account. +`BENEFIT_OTHER`: Government benefits other than retirement, unemployment, child support, or disability. Currently used only in the UK, to represent benefits such as Cost of Living Payments. +`CASH`: Deprecated and used only for existing legacy implementations. Has been replaced by `CASH_DEPOSIT` and `TRANSFER_FROM_APPLICATION`. +`CASH_DEPOSIT`: A cash or check deposit. +`CHILD_SUPPORT`: Child support payments received. +`GIG_ECONOMY`: Income earned as a gig economy worker, e.g. driving for Uber, Lyft, Postmates, DoorDash, etc. +`LONG_TERM_DISABILITY`: Disability payments, including Social Security disability benefits. +`OTHER`: Income that could not be categorized as any other income category. +`MILITARY`: Veterans benefits. Income earned as salary for serving in the military (e.g. through DFAS) will be classified as `SALARY` rather than `MILITARY`. +`RENTAL`: Income earned from a rental property. Income may be identified as rental when the payment is received through a rental platform, e.g. Airbnb; rent paid directly by the tenant to the property owner (e.g. via cash, check, or ACH) will typically not be classified as rental income. +`RETIREMENT`: Payments from private retirement systems, pensions, and government retirement programs, including Social Security retirement benefits. +`SALARY`: Payment from an employer to an earner or other form of permanent employment. +`TAX_REFUND`: A tax refund. +`TRANSFER_FROM_APPLICATION`: Deposits from a money transfer app, such as Venmo, Cash App, or Zelle. +`UNEMPLOYMENT`: Unemployment benefits. In the UK, includes certain low-income benefits such as the Universal Credit.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub income_category: Option, ///The most common name or original description for the underlying income transactions. #[serde(default, skip_serializing_if = "Option::is_none")] pub income_description: Option, @@ -23,7 +41,7 @@ The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ pub income_source_id: Option, ///The income pay frequency. #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_frequency: Option, + pub pay_frequency: Option, /**Minimum of all dates within the specific income sources in the user's bank account for days requested by the client. The date will be returned in an ISO 8601 format (YYYY-MM-DD).*/ #[serde(default, skip_serializing_if = "Option::is_none")] @@ -39,4 +57,4 @@ impl std::fmt::Display for CreditBankIncomeSource { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_summary.rs b/src/model/credit_bank_income_summary.rs index 683f094f..451a1fd9 100644 --- a/src/model/credit_bank_income_summary.rs +++ b/src/model/credit_bank_income_summary.rs @@ -45,4 +45,4 @@ impl std::fmt::Display for CreditBankIncomeSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_transaction.rs b/src/model/credit_bank_income_transaction.rs index ee5f14bd..3cf84297 100644 --- a/src/model/credit_bank_income_transaction.rs +++ b/src/model/credit_bank_income_transaction.rs @@ -39,4 +39,4 @@ impl std::fmt::Display for CreditBankIncomeTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_warning.rs b/src/model/credit_bank_income_warning.rs index d68d6a1f..6aeb53a7 100644 --- a/src/model/credit_bank_income_warning.rs +++ b/src/model/credit_bank_income_warning.rs @@ -1,7 +1,9 @@ use serde::{Serialize, Deserialize}; -use super::CreditBankIncomeCause; +use super::{ + CreditBankIncomeCause, CreditBankIncomeWarningCode, CreditBankIncomeWarningType, +}; ///The warning associated with the data that was unavailable for the Bank Income Report. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditBankIncomeWarning { ///An error object and associated `item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -13,13 +15,13 @@ pub struct CreditBankIncomeWarning { `REPORT_DELETED`: Report deleted due to customer or consumer request `DATA_UNAVAILABLE`: No relevant data was found for the Item*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub warning_code: Option, + pub warning_code: Option, ///The warning type which will always be `BANK_INCOME_WARNING`. #[serde(default, skip_serializing_if = "Option::is_none")] - pub warning_type: Option, + pub warning_type: Option, } impl std::fmt::Display for CreditBankIncomeWarning { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_income_warning_code.rs b/src/model/credit_bank_income_warning_code.rs new file mode 100644 index 00000000..e455a09e --- /dev/null +++ b/src/model/credit_bank_income_warning_code.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +/**The warning code identifies a specific kind of warning. +`IDENTITY_UNAVAILABLE`: Unable to extract identity for the Item +`TRANSACTIONS_UNAVAILABLE`: Unable to extract transactions for the Item +`ITEM_UNAPPROVED`: User exited flow before giving permission to share data for the Item +`REPORT_DELETED`: Report deleted due to customer or consumer request +`DATA_UNAVAILABLE`: No relevant data was found for the Item*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditBankIncomeWarningCode { + #[serde(rename = "IDENTITY_UNAVAILABLE")] + IdentityUnavailable, + #[serde(rename = "TRANSACTIONS_UNAVAILABLE")] + TransactionsUnavailable, + #[serde(rename = "ITEM_UNAPPROVED")] + ItemUnapproved, + #[serde(rename = "REPORT_DELETED")] + ReportDeleted, + #[serde(rename = "DATA_UNAVAILABLE")] + DataUnavailable, +} diff --git a/src/model/credit_bank_income_warning_type.rs b/src/model/credit_bank_income_warning_type.rs new file mode 100644 index 00000000..82a1214f --- /dev/null +++ b/src/model/credit_bank_income_warning_type.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///The warning type which will always be `BANK_INCOME_WARNING`. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditBankIncomeWarningType { + #[serde(rename = "BANK_INCOME_WARNING")] + BankIncomeWarning, +} diff --git a/src/model/credit_bank_income_webhook_update_response.rs b/src/model/credit_bank_income_webhook_update_response.rs index d5e52874..25a86349 100644 --- a/src/model/credit_bank_income_webhook_update_response.rs +++ b/src/model/credit_bank_income_webhook_update_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for CreditBankIncomeWebhookUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_statement_upload_account_owner.rs b/src/model/credit_bank_statement_upload_account_owner.rs index 7575a3a6..44b29742 100644 --- a/src/model/credit_bank_statement_upload_account_owner.rs +++ b/src/model/credit_bank_statement_upload_account_owner.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CreditBankStatementUploadAccountOwner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_statement_upload_account_owner_address.rs b/src/model/credit_bank_statement_upload_account_owner_address.rs index 53cb2bfb..e616c512 100644 --- a/src/model/credit_bank_statement_upload_account_owner_address.rs +++ b/src/model/credit_bank_statement_upload_account_owner_address.rs @@ -23,4 +23,4 @@ impl std::fmt::Display for CreditBankStatementUploadAccountOwnerAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_statement_upload_bank_account.rs b/src/model/credit_bank_statement_upload_bank_account.rs index 6629e545..af1f8477 100644 --- a/src/model/credit_bank_statement_upload_bank_account.rs +++ b/src/model/credit_bank_statement_upload_bank_account.rs @@ -30,4 +30,4 @@ impl std::fmt::Display for CreditBankStatementUploadBankAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_statement_upload_bank_account_period.rs b/src/model/credit_bank_statement_upload_bank_account_period.rs index 529c1e33..00055e5f 100644 --- a/src/model/credit_bank_statement_upload_bank_account_period.rs +++ b/src/model/credit_bank_statement_upload_bank_account_period.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for CreditBankStatementUploadBankAccountPeriod { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_statement_upload_item.rs b/src/model/credit_bank_statement_upload_item.rs index ef17e09c..9dac1494 100644 --- a/src/model/credit_bank_statement_upload_item.rs +++ b/src/model/credit_bank_statement_upload_item.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for CreditBankStatementUploadItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_statement_upload_object.rs b/src/model/credit_bank_statement_upload_object.rs index 7d387d2a..bbf9e4e8 100644 --- a/src/model/credit_bank_statement_upload_object.rs +++ b/src/model/credit_bank_statement_upload_object.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for CreditBankStatementUploadObject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_statement_upload_transaction.rs b/src/model/credit_bank_statement_upload_transaction.rs index 66835609..fb228bc4 100644 --- a/src/model/credit_bank_statement_upload_transaction.rs +++ b/src/model/credit_bank_statement_upload_transaction.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for CreditBankStatementUploadTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_bank_statements_uploads_get_request_options.rs b/src/model/credit_bank_statements_uploads_get_request_options.rs new file mode 100644 index 00000000..760c8c99 --- /dev/null +++ b/src/model/credit_bank_statements_uploads_get_request_options.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///An optional object for `/credit/bank_statements/uploads/get` request options. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CreditBankStatementsUploadsGetRequestOptions { + ///An array of `item_id`s whose bank statements information is returned. Each `item_id` should uniquely identify a bank statements uploaded item. If this field is not provided, all `item_id`s associated with the `user_token` will returned in the response. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item_ids: Option>, +} +impl std::fmt::Display for CreditBankStatementsUploadsGetRequestOptions { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/credit_bank_statements_uploads_get_response.rs b/src/model/credit_bank_statements_uploads_get_response.rs index 07220feb..ea41d805 100644 --- a/src/model/credit_bank_statements_uploads_get_response.rs +++ b/src/model/credit_bank_statements_uploads_get_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CreditBankStatementsUploadsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_card_liability.rs b/src/model/credit_card_liability.rs index 5bdfb49d..5e353cbb 100644 --- a/src/model/credit_card_liability.rs +++ b/src/model/credit_card_liability.rs @@ -35,4 +35,4 @@ impl std::fmt::Display for CreditCardLiability { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_category.rs b/src/model/credit_category.rs index 3678a120..970aa7ef 100644 --- a/src/model/credit_category.rs +++ b/src/model/credit_category.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CreditCategory { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_document_metadata.rs b/src/model/credit_document_metadata.rs index 1598fa2a..c6d4e492 100644 --- a/src/model/credit_document_metadata.rs +++ b/src/model/credit_document_metadata.rs @@ -14,7 +14,7 @@ pub struct CreditDocumentMetadata { `US_MILITARY_LES`: A Leave and Earnings Statement (LES) issued by the US military. -`US_MILITARY_CLES`: A Civilian Leave and Earnings Statment (CLES) issued by the US military. +`US_MILITARY_CLES`: A Civilian Leave and Earnings Statement (CLES) issued by the US military. `GIG`: Used to indicate that the income is related to gig work. Does not necessarily correspond to a specific document type. @@ -25,11 +25,16 @@ pub struct CreditDocumentMetadata { `UNKNOWN`: Document type could not be determined.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub document_type: Option, - /**Signed URL to retrieve the underlying file. For Payroll Income, the file type will always be PDF, and the file may not be available, in which case the field will be `null`. If you would like Plaid to generate a PDF if the original is not available, contact your Account Manager. For Document Income, this field will not be `null`, and the file type will be the original file type uploaded by the user. For more details on available file types, see the [Document Income](https://www.plaid.com/docs/income/payroll-income) documentation. + /**Signed URL to retrieve the underlying file. For Payroll Income, the file type will always be PDF, and the file may not be available, in which case the field will be `null`. If you would like Plaid to generate a PDF if the original is not available, contact your Account Manager. [Example generated pay stub](https://www.plaid.com/documents/plaid-generated-mock-paystub.pdf). + +For Document Income, this field will not be `null`, and the file type will be the original file type uploaded by the user. For more details on available file types, see the [Document Income](https://www.plaid.com/docs/income/payroll-income) documentation. This download URL can only be used once and expires after two minutes. To generate a new download URL, call `/credit/payroll_income/get` again.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub download_url: Option, + ///The reason why a failure occurred during document processing (if available). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_message: Option, ///The name of the document. pub name: String, ///The number of pages of the uploaded document (if available). @@ -49,4 +54,4 @@ impl std::fmt::Display for CreditDocumentMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_employer_verification.rs b/src/model/credit_employer_verification.rs index 7fb4c2db..e26e2237 100644 --- a/src/model/credit_employer_verification.rs +++ b/src/model/credit_employer_verification.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for CreditEmployerVerification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_employment_get_response.rs b/src/model/credit_employment_get_response.rs index d4a9cd2a..bdb6ca11 100644 --- a/src/model/credit_employment_get_response.rs +++ b/src/model/credit_employment_get_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CreditEmploymentGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_employment_item.rs b/src/model/credit_employment_item.rs index 845466e7..36bd120a 100644 --- a/src/model/credit_employment_item.rs +++ b/src/model/credit_employment_item.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for CreditEmploymentItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_employment_verification.rs b/src/model/credit_employment_verification.rs index b2272209..d7fee8b1 100644 --- a/src/model/credit_employment_verification.rs +++ b/src/model/credit_employment_verification.rs @@ -38,4 +38,4 @@ impl std::fmt::Display for CreditEmploymentVerification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_filter.rs b/src/model/credit_filter.rs index 4d967c86..5b594fb6 100644 --- a/src/model/credit_filter.rs +++ b/src/model/credit_filter.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; +use super::CreditAccountSubtypes; ///A filter to apply to `credit`-type accounts #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct CreditFilter { ///An array of account subtypes to display in Link. If not specified, all account subtypes will be shown. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub account_subtypes: Vec, + pub account_subtypes: CreditAccountSubtypes, } impl std::fmt::Display for CreditFilter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_asset.rs b/src/model/credit_freddie_mac_asset.rs index 9788674c..995661c7 100644 --- a/src/model/credit_freddie_mac_asset.rs +++ b/src/model/credit_freddie_mac_asset.rs @@ -4,7 +4,7 @@ use super::{ ValidationSources, }; ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditFreddieMacAsset { ///Details about an asset. #[serde(rename = "ASSET_DETAIL")] @@ -26,4 +26,4 @@ impl std::fmt::Display for CreditFreddieMacAsset { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_asset_transaction.rs b/src/model/credit_freddie_mac_asset_transaction.rs index 1d244bd6..5ceebf97 100644 --- a/src/model/credit_freddie_mac_asset_transaction.rs +++ b/src/model/credit_freddie_mac_asset_transaction.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AssetTransactionDescription, AssetTransactionDetail}; ///An object representing... -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditFreddieMacAssetTransaction { ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. #[serde(rename = "ASSET_TRANSACTION_DESCRIPTION")] @@ -15,4 +15,4 @@ impl std::fmt::Display for CreditFreddieMacAssetTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_asset_transactions.rs b/src/model/credit_freddie_mac_asset_transactions.rs index 357e406f..af9463ad 100644 --- a/src/model/credit_freddie_mac_asset_transactions.rs +++ b/src/model/credit_freddie_mac_asset_transactions.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditFreddieMacAssetTransactions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_assets.rs b/src/model/credit_freddie_mac_assets.rs index 28bfe697..19371a0e 100644 --- a/src/model/credit_freddie_mac_assets.rs +++ b/src/model/credit_freddie_mac_assets.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for CreditFreddieMacAssets { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_individual_name.rs b/src/model/credit_freddie_mac_individual_name.rs index 206392d7..c31132ee 100644 --- a/src/model/credit_freddie_mac_individual_name.rs +++ b/src/model/credit_freddie_mac_individual_name.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for CreditFreddieMacIndividualName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_loan.rs b/src/model/credit_freddie_mac_loan.rs index 56acadf7..98cae21c 100644 --- a/src/model/credit_freddie_mac_loan.rs +++ b/src/model/credit_freddie_mac_loan.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for CreditFreddieMacLoan { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_loan_identifiers.rs b/src/model/credit_freddie_mac_loan_identifiers.rs index ed93e90c..90edd0da 100644 --- a/src/model/credit_freddie_mac_loan_identifiers.rs +++ b/src/model/credit_freddie_mac_loan_identifiers.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditFreddieMacLoanIdentifiers { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_loans.rs b/src/model/credit_freddie_mac_loans.rs index 95f10468..89e65a39 100644 --- a/src/model/credit_freddie_mac_loans.rs +++ b/src/model/credit_freddie_mac_loans.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditFreddieMacLoans { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_parties.rs b/src/model/credit_freddie_mac_parties.rs index d77f9c12..6b9d8f23 100644 --- a/src/model/credit_freddie_mac_parties.rs +++ b/src/model/credit_freddie_mac_parties.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditFreddieMacParties { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_party.rs b/src/model/credit_freddie_mac_party.rs index 3b4fe801..05417196 100644 --- a/src/model/credit_freddie_mac_party.rs +++ b/src/model/credit_freddie_mac_party.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{CreditFreddieMacPartyIndividual, Roles, TaxpayerIdentifiers}; ///A collection of information about a single party to a transaction. Included direct participants like the borrower and seller as well as indirect participants such as the flood certificate provider. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditFreddieMacParty { ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. #[serde(rename = "INDIVIDUAL")] @@ -17,4 +17,4 @@ impl std::fmt::Display for CreditFreddieMacParty { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_party_individual.rs b/src/model/credit_freddie_mac_party_individual.rs index baa71f2b..3efe023b 100644 --- a/src/model/credit_freddie_mac_party_individual.rs +++ b/src/model/credit_freddie_mac_party_individual.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditFreddieMacPartyIndividual { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_reporting_information.rs b/src/model/credit_freddie_mac_reporting_information.rs index f1e51078..c2eb3e55 100644 --- a/src/model/credit_freddie_mac_reporting_information.rs +++ b/src/model/credit_freddie_mac_reporting_information.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for CreditFreddieMacReportingInformation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_reports_get_response.rs b/src/model/credit_freddie_mac_reports_get_response.rs index 45d6f361..08a2d714 100644 --- a/src/model/credit_freddie_mac_reports_get_response.rs +++ b/src/model/credit_freddie_mac_reports_get_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for CreditFreddieMacReportsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_service.rs b/src/model/credit_freddie_mac_service.rs index 769b7ff3..d19f2f7d 100644 --- a/src/model/credit_freddie_mac_service.rs +++ b/src/model/credit_freddie_mac_service.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for CreditFreddieMacService { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_services.rs b/src/model/credit_freddie_mac_services.rs index 38ee3920..178b3cf4 100644 --- a/src/model/credit_freddie_mac_services.rs +++ b/src/model/credit_freddie_mac_services.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditFreddieMacServices { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_verification_of_asset.rs b/src/model/credit_freddie_mac_verification_of_asset.rs index 8e678cd4..c0895e48 100644 --- a/src/model/credit_freddie_mac_verification_of_asset.rs +++ b/src/model/credit_freddie_mac_verification_of_asset.rs @@ -4,7 +4,7 @@ use super::{ ServiceProductFulfillment, }; ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditFreddieMacVerificationOfAsset { ///Information about an report identifier and a report name. #[serde(rename = "REPORTING_INFORMATION")] @@ -20,4 +20,4 @@ impl std::fmt::Display for CreditFreddieMacVerificationOfAsset { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_verification_of_asset_response.rs b/src/model/credit_freddie_mac_verification_of_asset_response.rs index 7e517a72..51233494 100644 --- a/src/model/credit_freddie_mac_verification_of_asset_response.rs +++ b/src/model/credit_freddie_mac_verification_of_asset_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditFreddieMacVerificationOfAssetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_freddie_mac_verification_of_assets_deal.rs b/src/model/credit_freddie_mac_verification_of_assets_deal.rs index 3e0dbfa2..eaaf26c2 100644 --- a/src/model/credit_freddie_mac_verification_of_assets_deal.rs +++ b/src/model/credit_freddie_mac_verification_of_assets_deal.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for CreditFreddieMacVerificationOfAssetsDeal { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_pay_stub.rs b/src/model/credit_pay_stub.rs index 4c30186c..e8058d9b 100644 --- a/src/model/credit_pay_stub.rs +++ b/src/model/credit_pay_stub.rs @@ -5,7 +5,7 @@ use super::{ PayStubPayPeriodDetails, }; ///An object representing an end user's pay stub. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditPayStub { ///An object with the deduction information found on a pay stub. pub deductions: CreditPayStubDeductions, @@ -29,4 +29,4 @@ impl std::fmt::Display for CreditPayStub { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_pay_stub_address.rs b/src/model/credit_pay_stub_address.rs index ffc28b77..c012bc56 100644 --- a/src/model/credit_pay_stub_address.rs +++ b/src/model/credit_pay_stub_address.rs @@ -23,4 +23,4 @@ impl std::fmt::Display for CreditPayStubAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_pay_stub_deductions.rs b/src/model/credit_pay_stub_deductions.rs index a81ad62c..834be06c 100644 --- a/src/model/credit_pay_stub_deductions.rs +++ b/src/model/credit_pay_stub_deductions.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for CreditPayStubDeductions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_pay_stub_earnings.rs b/src/model/credit_pay_stub_earnings.rs index d1d0c904..ef53ed6f 100644 --- a/src/model/credit_pay_stub_earnings.rs +++ b/src/model/credit_pay_stub_earnings.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for CreditPayStubEarnings { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_pay_stub_employee.rs b/src/model/credit_pay_stub_employee.rs index 9df1660c..4a5f76ac 100644 --- a/src/model/credit_pay_stub_employee.rs +++ b/src/model/credit_pay_stub_employee.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for CreditPayStubEmployee { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_pay_stub_employer.rs b/src/model/credit_pay_stub_employer.rs index 6f32366a..3eda2c4f 100644 --- a/src/model/credit_pay_stub_employer.rs +++ b/src/model/credit_pay_stub_employer.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CreditPayStubEmployer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_pay_stub_net_pay.rs b/src/model/credit_pay_stub_net_pay.rs index 913f1dcf..4d6b264e 100644 --- a/src/model/credit_pay_stub_net_pay.rs +++ b/src/model/credit_pay_stub_net_pay.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for CreditPayStubNetPay { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_pay_stub_pay_basis_type.rs b/src/model/credit_pay_stub_pay_basis_type.rs new file mode 100644 index 00000000..2454a9db --- /dev/null +++ b/src/model/credit_pay_stub_pay_basis_type.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///The explicit pay basis on the paystub (if present). +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditPayStubPayBasisType { + #[serde(rename = "SALARY")] + Salary, + #[serde(rename = "HOURLY")] + Hourly, + #[serde(rename = "COMMISSION")] + Commission, +} diff --git a/src/model/credit_payroll_income_get_request_options.rs b/src/model/credit_payroll_income_get_request_options.rs new file mode 100644 index 00000000..ff255287 --- /dev/null +++ b/src/model/credit_payroll_income_get_request_options.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///An optional object for `/credit/payroll_income/get` request options. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct CreditPayrollIncomeGetRequestOptions { + ///An array of `item_id`s whose payroll information is returned. Each `item_id` should uniquely identify a payroll income item. If this field is not provided, all `item_id`s associated with the `user_token` will returned in the response. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item_ids: Option>, +} +impl std::fmt::Display for CreditPayrollIncomeGetRequestOptions { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/credit_payroll_income_get_response.rs b/src/model/credit_payroll_income_get_response.rs index 4f09cbe0..6a0c3005 100644 --- a/src/model/credit_payroll_income_get_response.rs +++ b/src/model/credit_payroll_income_get_response.rs @@ -1,9 +1,9 @@ use serde::{Serialize, Deserialize}; use super::{PayrollItem, PlaidError}; ///Defines the response body for `/credit/payroll_income/get`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditPayrollIncomeGetResponse { - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///Array of payroll items. @@ -16,4 +16,4 @@ impl std::fmt::Display for CreditPayrollIncomeGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_payroll_income_parsing_config_update_response.rs b/src/model/credit_payroll_income_parsing_config_update_response.rs index 9876ee1b..aa4a3b9a 100644 --- a/src/model/credit_payroll_income_parsing_config_update_response.rs +++ b/src/model/credit_payroll_income_parsing_config_update_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for CreditPayrollIncomeParsingConfigUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_payroll_income_precheck_response.rs b/src/model/credit_payroll_income_precheck_response.rs index 75bedb41..ccc52266 100644 --- a/src/model/credit_payroll_income_precheck_response.rs +++ b/src/model/credit_payroll_income_precheck_response.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::IncomeVerificationPrecheckConfidence; ///Defines the response schema for `/credit/payroll_income/precheck`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditPayrollIncomePrecheckResponse { /**The confidence that Plaid can support the user in the digital income verification flow instead of requiring a manual paystub upload. One of the following: @@ -9,7 +10,7 @@ pub struct CreditPayrollIncomePrecheckResponse { "`LOW`": It is unlikely that this user can use the digital income verification flow. `"UNKNOWN"`: It was not possible to determine if the user is supportable with the information passed.*/ - pub confidence: String, + pub confidence: IncomeVerificationPrecheckConfidence, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, } @@ -17,4 +18,4 @@ impl std::fmt::Display for CreditPayrollIncomePrecheckResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_payroll_income_refresh_request_options.rs b/src/model/credit_payroll_income_refresh_request_options.rs index cd1c4c9f..528e337c 100644 --- a/src/model/credit_payroll_income_refresh_request_options.rs +++ b/src/model/credit_payroll_income_refresh_request_options.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CreditPayrollIncomeRefreshRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_payroll_income_refresh_response.rs b/src/model/credit_payroll_income_refresh_response.rs index 628c0373..a0aa8795 100644 --- a/src/model/credit_payroll_income_refresh_response.rs +++ b/src/model/credit_payroll_income_refresh_response.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for CreditPayrollIncomeRefreshResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_payroll_income_risk_signals_get_response.rs b/src/model/credit_payroll_income_risk_signals_get_response.rs index 9b6d2a56..55ee3149 100644 --- a/src/model/credit_payroll_income_risk_signals_get_response.rs +++ b/src/model/credit_payroll_income_risk_signals_get_response.rs @@ -1,9 +1,9 @@ use serde::{Serialize, Deserialize}; use super::{PayrollRiskSignalsItem, PlaidError}; ///CreditPayrollIncomeRiskSignalsGetRequest defines the response schema for `/credit/payroll_income/risk_signals/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditPayrollIncomeRiskSignalsGetResponse { - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///Array of payroll items. @@ -16,4 +16,4 @@ impl std::fmt::Display for CreditPayrollIncomeRiskSignalsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_platform_ids.rs b/src/model/credit_platform_ids.rs index b8d27b81..5aa36d3c 100644 --- a/src/model/credit_platform_ids.rs +++ b/src/model/credit_platform_ids.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for CreditPlatformIds { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_relay_create_response.rs b/src/model/credit_relay_create_response.rs index 1112a1ac..2959b652 100644 --- a/src/model/credit_relay_create_response.rs +++ b/src/model/credit_relay_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditRelayCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_relay_refresh_response.rs b/src/model/credit_relay_refresh_response.rs index 3842df0c..b274a10e 100644 --- a/src/model/credit_relay_refresh_response.rs +++ b/src/model/credit_relay_refresh_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CreditRelayRefreshResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_relay_remove_response.rs b/src/model/credit_relay_remove_response.rs index 11a55f07..856f57e5 100644 --- a/src/model/credit_relay_remove_response.rs +++ b/src/model/credit_relay_remove_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for CreditRelayRemoveResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_session.rs b/src/model/credit_session.rs index 9fb1c167..90b81a27 100644 --- a/src/model/credit_session.rs +++ b/src/model/credit_session.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for CreditSession { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_session_bank_employment_result.rs b/src/model/credit_session_bank_employment_result.rs index 87501e47..db85f4a7 100644 --- a/src/model/credit_session_bank_employment_result.rs +++ b/src/model/credit_session_bank_employment_result.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::CreditSessionBankEmploymentStatus; ///The details of a bank employment verification in Link. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditSessionBankEmploymentResult { ///The Plaid Institution ID associated with the Item. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -20,10 +21,10 @@ pub struct CreditSessionBankEmploymentResult { `INTERNAL_ERROR`: The user encountered an internal error.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, + pub status: Option, } impl std::fmt::Display for CreditSessionBankEmploymentResult { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_session_bank_employment_status.rs b/src/model/credit_session_bank_employment_status.rs new file mode 100644 index 00000000..9857aef6 --- /dev/null +++ b/src/model/credit_session_bank_employment_status.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +/**Status of the Bank Employment Link session. + +`APPROVED`: User has approved and verified their employment. + +`NO_EMPLOYMENTS_FOUND`: We attempted, but were unable to find any employment in the connected account. + +`EMPLOYER_NOT_LISTED`: The user explicitly indicated that they did not see their current or previous employer in the list of employer names found. + +`STARTED`: The user began the bank income portion of the link flow. + +`INTERNAL_ERROR`: The user encountered an internal error.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditSessionBankEmploymentStatus { + #[serde(rename = "APPROVED")] + Approved, + #[serde(rename = "NO_EMPLOYERS_FOUND")] + NoEmployersFound, + #[serde(rename = "EMPLOYER_NOT_LISTED")] + EmployerNotListed, +} diff --git a/src/model/credit_session_bank_income_result.rs b/src/model/credit_session_bank_income_result.rs index 9fcd5080..c0b1d65d 100644 --- a/src/model/credit_session_bank_income_result.rs +++ b/src/model/credit_session_bank_income_result.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::CreditSessionBankIncomeStatus; ///The details of a bank income verification in Link -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditSessionBankIncomeResult { ///The Plaid Institution ID associated with the Item. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -20,10 +21,10 @@ pub struct CreditSessionBankIncomeResult { `INTERNAL_ERROR`: The user encountered an internal error.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, + pub status: Option, } impl std::fmt::Display for CreditSessionBankIncomeResult { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_session_bank_income_status.rs b/src/model/credit_session_bank_income_status.rs new file mode 100644 index 00000000..9f6fa5a3 --- /dev/null +++ b/src/model/credit_session_bank_income_status.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +/**Status of the Bank Income Link session. + +`APPROVED`: User has approved and verified their income + +`NO_DEPOSITS_FOUND`: We attempted, but were unable to find any income in the connected account. + +`USER_REPORTED_NO_INCOME`: The user explicitly indicated that they don't receive income in the connected account. + +`STARTED`: The user began the bank income portion of the link flow. + +`INTERNAL_ERROR`: The user encountered an internal error.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum CreditSessionBankIncomeStatus { + #[serde(rename = "APPROVED")] + Approved, + #[serde(rename = "NO_DEPOSITS_FOUND")] + NoDepositsFound, + #[serde(rename = "USER_REPORTED_NO_INCOME")] + UserReportedNoIncome, +} diff --git a/src/model/credit_session_document_income_result.rs b/src/model/credit_session_document_income_result.rs index e60116c7..0dd46f72 100644 --- a/src/model/credit_session_document_income_result.rs +++ b/src/model/credit_session_document_income_result.rs @@ -2,6 +2,9 @@ use serde::{Serialize, Deserialize}; ///The details of a document income verification in Link #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct CreditSessionDocumentIncomeResult { + ///The number of 1099s uploaded by the user + #[serde(rename = "num_1099s_uploaded")] + pub num1099_s_uploaded: i64, ///The number of bank statements uploaded by the user. pub num_bank_statements_uploaded: i64, ///The number of paystubs uploaded by the user. @@ -14,4 +17,4 @@ impl std::fmt::Display for CreditSessionDocumentIncomeResult { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_session_error.rs b/src/model/credit_session_error.rs index 26760dd8..2ad38008 100644 --- a/src/model/credit_session_error.rs +++ b/src/model/credit_session_error.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for CreditSessionError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_session_item_add_result.rs b/src/model/credit_session_item_add_result.rs index da9a08a5..79a282a7 100644 --- a/src/model/credit_session_item_add_result.rs +++ b/src/model/credit_session_item_add_result.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for CreditSessionItemAddResult { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_session_payroll_income_result.rs b/src/model/credit_session_payroll_income_result.rs index ca146891..b085bb99 100644 --- a/src/model/credit_session_payroll_income_result.rs +++ b/src/model/credit_session_payroll_income_result.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for CreditSessionPayrollIncomeResult { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_session_results.rs b/src/model/credit_session_results.rs index 69597d4d..62ac0d43 100644 --- a/src/model/credit_session_results.rs +++ b/src/model/credit_session_results.rs @@ -27,4 +27,4 @@ impl std::fmt::Display for CreditSessionResults { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_sessions_get_response.rs b/src/model/credit_sessions_get_response.rs index 4b2d4509..bc607b69 100644 --- a/src/model/credit_sessions_get_response.rs +++ b/src/model/credit_sessions_get_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for CreditSessionsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/credit_w2.rs b/src/model/credit_w2.rs index 61fef2a5..80614b9c 100644 --- a/src/model/credit_w2.rs +++ b/src/model/credit_w2.rs @@ -76,4 +76,4 @@ impl std::fmt::Display for CreditW2 { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/customer_initiated_return_risk.rs b/src/model/customer_initiated_return_risk.rs index 31d51a1c..1a4a18ff 100644 --- a/src/model/customer_initiated_return_risk.rs +++ b/src/model/customer_initiated_return_risk.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for CustomerInitiatedReturnRisk { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/dashboard_user.rs b/src/model/dashboard_user.rs index d6435fb9..fcd84fdb 100644 --- a/src/model/dashboard_user.rs +++ b/src/model/dashboard_user.rs @@ -1,18 +1,19 @@ use serde::{Serialize, Deserialize}; +use super::DashboardUserStatus; ///Account information associated with a team member with access to the Plaid dashboard. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DashboardUser { ///An ISO8601 formatted timestamp. pub created_at: chrono::DateTime, - ///A valid email address. + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). pub email_address: String, - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. pub id: String, ///The current status of the user. - pub status: String, + pub status: DashboardUserStatus, } impl std::fmt::Display for DashboardUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/dashboard_user_get_response.rs b/src/model/dashboard_user_get_response.rs index 2dd5253d..596208b3 100644 --- a/src/model/dashboard_user_get_response.rs +++ b/src/model/dashboard_user_get_response.rs @@ -1,20 +1,21 @@ use serde::{Serialize, Deserialize}; +use super::DashboardUserStatus; ///Account information associated with a team member with access to the Plaid dashboard. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DashboardUserGetResponse { ///An ISO8601 formatted timestamp. pub created_at: chrono::DateTime, - ///A valid email address. + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). pub email_address: String, - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. pub id: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, ///The current status of the user. - pub status: String, + pub status: DashboardUserStatus, } impl std::fmt::Display for DashboardUserGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/dashboard_user_list_response.rs b/src/model/dashboard_user_list_response.rs index f89d957b..dfe575a5 100644 --- a/src/model/dashboard_user_list_response.rs +++ b/src/model/dashboard_user_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for DashboardUserListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/dashboard_user_status.rs b/src/model/dashboard_user_status.rs new file mode 100644 index 00000000..c8770942 --- /dev/null +++ b/src/model/dashboard_user_status.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///The current status of the user. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum DashboardUserStatus { + #[serde(rename = "invited")] + Invited, + #[serde(rename = "active")] + Active, + #[serde(rename = "deactivated")] + Deactivated, +} diff --git a/src/model/data_sources.rs b/src/model/data_sources.rs new file mode 100644 index 00000000..102ea7da --- /dev/null +++ b/src/model/data_sources.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +/**A description of the source of data for a given product/data type. + +`INSTITUTION`: The institution supports this product, and the data was provided by the institution. +`INSTITUTION_MASK`: The user manually provided the full account number, which was matched to the account mask provided by the institution. Only applicable to the `numbers` data type. +`USER`: The institution does not support this product, and the data was manually provided by the user.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum DataSources { + #[serde(rename = "INSTITUTION")] + Institution, + #[serde(rename = "INSTITUTION_MASK")] + InstitutionMask, + #[serde(rename = "USER")] + User, +} diff --git a/src/model/date_range.rs b/src/model/date_range.rs index 5b72430b..a5a5960c 100644 --- a/src/model/date_range.rs +++ b/src/model/date_range.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for DateRange { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deductions.rs b/src/model/deductions.rs index ee4c8620..4b1b083c 100644 --- a/src/model/deductions.rs +++ b/src/model/deductions.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for Deductions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deductions_breakdown.rs b/src/model/deductions_breakdown.rs index a56b0f49..7b7c869c 100644 --- a/src/model/deductions_breakdown.rs +++ b/src/model/deductions_breakdown.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for DeductionsBreakdown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deductions_total.rs b/src/model/deductions_total.rs index 1a02f931..e8643933 100644 --- a/src/model/deductions_total.rs +++ b/src/model/deductions_total.rs @@ -21,4 +21,4 @@ impl std::fmt::Display for DeductionsTotal { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/default_update_webhook.rs b/src/model/default_update_webhook.rs index ed9bf23c..29d3fd3d 100644 --- a/src/model/default_update_webhook.rs +++ b/src/model/default_update_webhook.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; /**Fired when new transaction data is available for an Item. Plaid will typically check for new transaction data several times a day. This webhook is intended for use with `/transactions/get`; if you are using the newer `/transactions/sync` endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the `SYNC_UPDATES_AVAILABLE` webhook instead.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DefaultUpdateWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item the webhook relates to. @@ -23,4 +23,4 @@ impl std::fmt::Display for DefaultUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deposit_switch_address_data.rs b/src/model/deposit_switch_address_data.rs index d17cb4b1..eaf08c6d 100644 --- a/src/model/deposit_switch_address_data.rs +++ b/src/model/deposit_switch_address_data.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///The user's address. +///(Deprecated) The user's address. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DepositSwitchAddressData { ///The full city name @@ -19,4 +19,4 @@ impl std::fmt::Display for DepositSwitchAddressData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deposit_switch_alt_create_response.rs b/src/model/deposit_switch_alt_create_response.rs index ed839862..5c34505c 100644 --- a/src/model/deposit_switch_alt_create_response.rs +++ b/src/model/deposit_switch_alt_create_response.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///DepositSwitchAltCreateResponse defines the response schema for `/deposit_switch/alt/create` +///(Deprecated) DepositSwitchAltCreateResponse defines the response schema for `/deposit_switch/alt/create` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DepositSwitchAltCreateResponse { ///ID of the deposit switch. This ID is persisted throughout the lifetime of the deposit switch. @@ -11,4 +11,4 @@ impl std::fmt::Display for DepositSwitchAltCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deposit_switch_create_request_options.rs b/src/model/deposit_switch_create_request_options.rs index 99eda9f0..b4dc2314 100644 --- a/src/model/deposit_switch_create_request_options.rs +++ b/src/model/deposit_switch_create_request_options.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///Options to configure the `/deposit_switch/create` request. If provided, cannot be `null`. +///(Deprecated) Options to configure the `/deposit_switch/create` request. If provided, cannot be `null`. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DepositSwitchCreateRequestOptions { ///An array of access tokens corresponding to transaction items to use when attempting to match the user to their Payroll Provider. These tokens must be created by the same client id as the one creating the switch, and have access to the transactions product. @@ -13,4 +13,4 @@ impl std::fmt::Display for DepositSwitchCreateRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deposit_switch_create_response.rs b/src/model/deposit_switch_create_response.rs index 7ed2d551..559bd479 100644 --- a/src/model/deposit_switch_create_response.rs +++ b/src/model/deposit_switch_create_response.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///DepositSwitchCreateResponse defines the response schema for `/deposit_switch/create` +///(Deprecated) DepositSwitchCreateResponse defines the response schema for `/deposit_switch/create` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DepositSwitchCreateResponse { ///ID of the deposit switch. This ID is persisted throughout the lifetime of the deposit switch. @@ -11,4 +11,4 @@ impl std::fmt::Display for DepositSwitchCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deposit_switch_get_response.rs b/src/model/deposit_switch_get_response.rs index 30edd69b..8f46241b 100644 --- a/src/model/deposit_switch_get_response.rs +++ b/src/model/deposit_switch_get_response.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///DepositSwitchGetResponse defines the response schema for `/deposit_switch/get` +///(Deprecated) DepositSwitchGetResponse defines the response schema for `/deposit_switch/get` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DepositSwitchGetResponse { ///When `true`, user’s direct deposit goes to multiple banks. When false, user’s direct deposit only goes to the target account. Always `null` if the deposit switch has not been completed. @@ -65,4 +65,4 @@ impl std::fmt::Display for DepositSwitchGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deposit_switch_state_update_webhook.rs b/src/model/deposit_switch_state_update_webhook.rs index d2b70384..57f9207c 100644 --- a/src/model/deposit_switch_state_update_webhook.rs +++ b/src/model/deposit_switch_state_update_webhook.rs @@ -1,13 +1,14 @@ use serde::{Serialize, Deserialize}; -///Fired when the status of a deposit switch request has changed. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::WebhookEnvironmentValues; +///(Deprecated) Fired when the status of a deposit switch request has changed. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DepositSwitchStateUpdateWebhook { ///The ID of the deposit switch. #[serde(default, skip_serializing_if = "Option::is_none")] pub deposit_switch_id: Option, ///The Plaid environment the webhook was sent from #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option, + pub environment: Option, /**The state, or status, of the deposit switch. `initialized`: The deposit switch has been initialized with the user entering the information required to submit the deposit switch request. @@ -32,4 +33,4 @@ impl std::fmt::Display for DepositSwitchStateUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deposit_switch_target_account.rs b/src/model/deposit_switch_target_account.rs index 53b61984..ed901a48 100644 --- a/src/model/deposit_switch_target_account.rs +++ b/src/model/deposit_switch_target_account.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///The deposit switch destination account +///(Deprecated) The deposit switch destination account #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DepositSwitchTargetAccount { ///The name of the deposit switch destination account, as it will be displayed to the end user in the Deposit Switch interface. It is not required to match the name used in online banking. @@ -15,4 +15,4 @@ impl std::fmt::Display for DepositSwitchTargetAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deposit_switch_target_user.rs b/src/model/deposit_switch_target_user.rs index 3b1ae971..aa3ac803 100644 --- a/src/model/deposit_switch_target_user.rs +++ b/src/model/deposit_switch_target_user.rs @@ -1,9 +1,9 @@ use serde::{Serialize, Deserialize}; use super::DepositSwitchAddressData; -///The deposit switch target user +///(Deprecated) The deposit switch target user #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DepositSwitchTargetUser { - ///The user's address. + ///(Deprecated) The user's address. #[serde(default, skip_serializing_if = "Option::is_none")] pub address: Option, ///The email address of the user. @@ -22,4 +22,4 @@ impl std::fmt::Display for DepositSwitchTargetUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/deposit_switch_token_create_response.rs b/src/model/deposit_switch_token_create_response.rs index 5ae5b099..514653c2 100644 --- a/src/model/deposit_switch_token_create_response.rs +++ b/src/model/deposit_switch_token_create_response.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///DepositSwitchTokenCreateResponse defines the response schema for `/deposit_switch/token/create` +///(Deprecated) DepositSwitchTokenCreateResponse defines the response schema for `/deposit_switch/token/create` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DepositSwitchTokenCreateResponse { ///Deposit switch token, used to initialize Link for the Deposit Switch product @@ -13,4 +13,4 @@ impl std::fmt::Display for DepositSwitchTokenCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/depository_account_subtype.rs b/src/model/depository_account_subtype.rs new file mode 100644 index 00000000..2c8b967d --- /dev/null +++ b/src/model/depository_account_subtype.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +///Valid account subtypes for depository accounts. For a list containing descriptions of each subtype, see [Account schemas](https://plaid.com/docs/api/accounts/#StandaloneAccountType-depository). +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum DepositoryAccountSubtype { + #[serde(rename = "checking")] + Checking, + #[serde(rename = "savings")] + Savings, + #[serde(rename = "hsa")] + Hsa, + #[serde(rename = "cd")] + Cd, + #[serde(rename = "money market")] + MoneyMarket, + #[serde(rename = "paypal")] + Paypal, + #[serde(rename = "prepaid")] + Prepaid, + #[serde(rename = "cash management")] + CashManagement, + #[serde(rename = "ebt")] + Ebt, + #[serde(rename = "all")] + All, +} diff --git a/src/model/depository_account_subtypes.rs b/src/model/depository_account_subtypes.rs new file mode 100644 index 00000000..3e8e843c --- /dev/null +++ b/src/model/depository_account_subtypes.rs @@ -0,0 +1,4 @@ +use serde::{Serialize, Deserialize}; +use super::DepositoryAccountSubtype; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct DepositoryAccountSubtypes(pub Vec); diff --git a/src/model/depository_filter.rs b/src/model/depository_filter.rs index cc2484e9..42cc3875 100644 --- a/src/model/depository_filter.rs +++ b/src/model/depository_filter.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; +use super::DepositoryAccountSubtypes; ///A filter to apply to `depository`-type accounts #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DepositoryFilter { ///An array of account subtypes to display in Link. If not specified, all account subtypes will be shown. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub account_subtypes: Vec, + pub account_subtypes: DepositoryAccountSubtypes, } impl std::fmt::Display for DepositoryFilter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/detailed_originator.rs b/src/model/detailed_originator.rs index 4cd6d9f4..ca89e09a 100644 --- a/src/model/detailed_originator.rs +++ b/src/model/detailed_originator.rs @@ -1,14 +1,18 @@ use serde::{Serialize, Deserialize}; +use super::{TransferDiligenceStatus, TransferPlatformRequirement}; ///Originator and their status. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DetailedOriginator { ///The company name of the end customer. pub company_name: String, + ///List of outstanding requirements for scaled platform originators. Only populated when `transfer_diligence_status` is `more_information_required`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outstanding_requirements: Option>, ///Originator’s diligence status. - pub transfer_diligence_status: String, + pub transfer_diligence_status: TransferDiligenceStatus, } impl std::fmt::Display for DetailedOriginator { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/detected_account.rs b/src/model/detected_account.rs index 7db9c9bd..9be879a7 100644 --- a/src/model/detected_account.rs +++ b/src/model/detected_account.rs @@ -28,4 +28,4 @@ impl std::fmt::Display for DetectedAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/distribution_breakdown.rs b/src/model/distribution_breakdown.rs index 5960e1cc..dfb6bd45 100644 --- a/src/model/distribution_breakdown.rs +++ b/src/model/distribution_breakdown.rs @@ -1,4 +1,5 @@ use serde::{Serialize, Deserialize}; +use super::Pay; ///Information about the accounts that the payment was distributed to. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DistributionBreakdown { @@ -8,12 +9,15 @@ pub struct DistributionBreakdown { ///The name of the bank that the payment is being deposited to. #[serde(default, skip_serializing_if = "Option::is_none")] pub bank_name: Option, - ///The ISO-4217 currency code of the net pay. Always `null` if `unofficial_currency_code` is non-null. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub currency: Option, ///The amount distributed to this account. #[serde(default, skip_serializing_if = "Option::is_none")] pub current_amount: Option, + ///An object representing a monetary amount. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current_pay: Option, + ///The ISO-4217 currency code of the net pay. Always `null` if `unofficial_currency_code` is non-null. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, ///The last 2-4 alphanumeric characters of an account's official account number. #[serde(default, skip_serializing_if = "Option::is_none")] pub mask: Option, @@ -21,9 +25,14 @@ pub struct DistributionBreakdown { #[serde(rename = "type")] #[serde(default, skip_serializing_if = "Option::is_none")] pub type_: Option, + /**The unofficial currency code associated with the net pay. Always `null` if `iso_currency_code` is non-`null`. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. + +See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `iso_currency_code`s.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, } impl std::fmt::Display for DistributionBreakdown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/doc_type.rs b/src/model/doc_type.rs new file mode 100644 index 00000000..90130a99 --- /dev/null +++ b/src/model/doc_type.rs @@ -0,0 +1,49 @@ +use serde::{Serialize, Deserialize}; +/**The type of document. + +`DOCUMENT_TYPE_PAYSTUB`: A paystub. + +`DOCUMENT_TYPE_BANK_STATEMENT`: A bank statement. + +`DOCUMENT_TYPE_US_TAX_W2`: A W-2 wage and tax statement provided by a US employer reflecting wages earned by the employee. + +`DOCUMENT_TYPE_US_MILITARY_ERAS`: An electronic Retirement Account Statement (eRAS) issued by the US military. + +`DOCUMENT_TYPE_US_MILITARY_LES`: A Leave and Earnings Statement (LES) issued by the US military. + +`DOCUMENT_TYPE_US_MILITARY_CLES`: A Civilian Leave and Earnings Statement (CLES) issued by the US military. + +`DOCUMENT_TYPE_GIG`: Used to indicate that the income is related to gig work. Does not necessarily correspond to a specific document type. + +`DOCUMENT_TYPE_NONE`: Used to indicate that there is no underlying document for the data. + +`DOCUMENT_TYPE_PLAID_GENERATED_PAYSTUB_PDF`: Used to indicate that the PDF for the paystub was generated by Plaid. + +`UNKNOWN`: Document type could not be determined.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum DocType { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "DOCUMENT_TYPE_PAYSTUB")] + DocumentTypePaystub, + #[serde(rename = "DOCUMENT_TYPE_BANK_STATEMENT")] + DocumentTypeBankStatement, + #[serde(rename = "DOCUMENT_TYPE_US_TAX_W2")] + DocumentTypeUsTaxW2, + #[serde(rename = "DOCUMENT_TYPE_US_MILITARY_ERAS")] + DocumentTypeUsMilitaryEras, + #[serde(rename = "DOCUMENT_TYPE_US_MILITARY_LES")] + DocumentTypeUsMilitaryLes, + #[serde(rename = "DOCUMENT_TYPE_US_MILITARY_CLES")] + DocumentTypeUsMilitaryCles, + #[serde(rename = "DOCUMENT_TYPE_GIG")] + DocumentTypeGig, + #[serde(rename = "DOCUMENT_TYPE_NONE")] + DocumentTypeNone, + #[serde(rename = "DOCUMENT_TYPE_US_TAX_1099_MISC")] + DocumentTypeUsTax1099Misc, + #[serde(rename = "DOCUMENT_TYPE_US_TAX_1099_K")] + DocumentTypeUsTax1099K, + #[serde(rename = "DOCUMENT_TYPE_PLAID_GENERATED_PAYSTUB_PDF")] + DocumentTypePlaidGeneratedPaystubPdf, +} diff --git a/src/model/document_analysis.rs b/src/model/document_analysis.rs index 567ab3a1..209a01c5 100644 --- a/src/model/document_analysis.rs +++ b/src/model/document_analysis.rs @@ -1,7 +1,9 @@ use serde::{Serialize, Deserialize}; -use super::PhysicalDocumentExtractedDataAnalysis; +use super::{ + DocumentAuthenticityMatchCode, ImageQuality, PhysicalDocumentExtractedDataAnalysis, +}; ///High level descriptions of how the associated document was processed. If a document fails verification, the details in the `analysis` object should help clarify why the document was rejected. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DocumentAnalysis { /**High level summary of whether the document in the provided image matches the formatting rules and security checks for the associated jurisdiction. @@ -20,7 +22,7 @@ The informational fields (name, date of birth, ID number, etc.) must be colored Security features like watermarks and background patterns must be present So a `match` status for this field indicates that the document in the provided image seems to conform to the various formatting and security rules associated with the detected document.*/ - pub authenticity: String, + pub authenticity: DocumentAuthenticityMatchCode, ///Analysis of the data extracted from the submitted document. #[serde(default, skip_serializing_if = "Option::is_none")] pub extracted_data: Option, @@ -29,10 +31,10 @@ So a `match` status for this field indicates that the document in the provided i For example, an image that is blurry, distorted by glare from a nearby light source, or improperly framed might be marked as low or medium quality. Poor quality images are more likely to fail OCR and/or template conformity checks. Note: By default, Plaid will let a user recapture document images twice before failing the entire session if we attribute the failure to low image quality.*/ - pub image_quality: String, + pub image_quality: ImageQuality, } impl std::fmt::Display for DocumentAnalysis { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/document_authenticity_match_code.rs b/src/model/document_authenticity_match_code.rs new file mode 100644 index 00000000..2102a7d9 --- /dev/null +++ b/src/model/document_authenticity_match_code.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +/**High level summary of whether the document in the provided image matches the formatting rules and security checks for the associated jurisdiction. + +For example, most identity documents have formatting rules like the following: + + +The image of the person's face must have a certain contrast in order to highlight skin tone + + +The subject in the document's image must remove eye glasses and pose in a certain way + + +The informational fields (name, date of birth, ID number, etc.) must be colored and aligned according to specific rules + + +Security features like watermarks and background patterns must be present + +So a `match` status for this field indicates that the document in the provided image seems to conform to the various formatting and security rules associated with the detected document.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum DocumentAuthenticityMatchCode { + #[serde(rename = "match")] + Match, + #[serde(rename = "partial_match")] + PartialMatch, + #[serde(rename = "no_match")] + NoMatch, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/document_date_of_birth_match_code.rs b/src/model/document_date_of_birth_match_code.rs new file mode 100644 index 00000000..ec2382aa --- /dev/null +++ b/src/model/document_date_of_birth_match_code.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///A match summary describing the cross comparison between the subject's date of birth, extracted from the document image, and the date of birth they separately provided to the identity verification attempt. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum DocumentDateOfBirthMatchCode { + #[serde(rename = "match")] + Match, + #[serde(rename = "partial_match")] + PartialMatch, + #[serde(rename = "no_match")] + NoMatch, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/document_metadata.rs b/src/model/document_metadata.rs index eb33b960..4279d2b0 100644 --- a/src/model/document_metadata.rs +++ b/src/model/document_metadata.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::DocType; ///An object representing metadata from the end user's uploaded document. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DocumentMetadata { ///An identifier of the document that is also present in the paystub response. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -27,7 +28,7 @@ pub struct DocumentMetadata { `UNKNOWN`: Document type could not be determined.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub doc_type: Option, + pub doc_type: Option, ///The name of the document. #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -45,4 +46,4 @@ impl std::fmt::Display for DocumentMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/document_name_match_code.rs b/src/model/document_name_match_code.rs new file mode 100644 index 00000000..5f515832 --- /dev/null +++ b/src/model/document_name_match_code.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///A match summary describing the cross comparison between the subject's name, extracted from the document image, and the name they separately provided to identity verification attempt. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum DocumentNameMatchCode { + #[serde(rename = "match")] + Match, + #[serde(rename = "partial_match")] + PartialMatch, + #[serde(rename = "no_match")] + NoMatch, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/document_risk_signal.rs b/src/model/document_risk_signal.rs index c4b9af82..efbe9e9e 100644 --- a/src/model/document_risk_signal.rs +++ b/src/model/document_risk_signal.rs @@ -18,13 +18,13 @@ pub struct DocumentRiskSignal { ///An object which contains additional metadata about the institution used to compute the verification attribute #[serde(default, skip_serializing_if = "Option::is_none")] pub institution_metadata: Option, - ///The relevant page associated with the risk signal + ///The relevant page associated with the risk signal. If the risk signal is not associated with a specific page, the value will be 0. #[serde(default, skip_serializing_if = "Option::is_none")] pub page_number: Option, ///A human-readable explanation providing more detail into the particular risk signal #[serde(default, skip_serializing_if = "Option::is_none")] pub signal_description: Option, - ///The result from the risk signal check. + ///The type of risk found in the risk signal check. #[serde(rename = "type")] #[serde(default, skip_serializing_if = "Option::is_none")] pub type_: Option, @@ -33,4 +33,4 @@ impl std::fmt::Display for DocumentRiskSignal { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/document_risk_signal_institution_metadata.rs b/src/model/document_risk_signal_institution_metadata.rs index bb34c1d7..812653e2 100644 --- a/src/model/document_risk_signal_institution_metadata.rs +++ b/src/model/document_risk_signal_institution_metadata.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for DocumentRiskSignalInstitutionMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/document_risk_signals_object.rs b/src/model/document_risk_signals_object.rs index 59b45b43..aa1500c7 100644 --- a/src/model/document_risk_signals_object.rs +++ b/src/model/document_risk_signals_object.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for DocumentRiskSignalsObject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/document_risk_summary.rs b/src/model/document_risk_summary.rs index 0a741ce0..9e0970cb 100644 --- a/src/model/document_risk_summary.rs +++ b/src/model/document_risk_summary.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; ///A summary across all risk signals associated with a document #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct DocumentRiskSummary { - ///A number between 0 and 100, inclusive, where a score closer to 0 indicates a document is likely to be trustworthy and a score closer to 100 indicates a document is likely to be fraudulent + ///A number between 0 and 100, inclusive, where a score closer to 0 indicates a document is likely to be trustworthy and a score closer to 100 indicates a document is likely to be fraudulent. You can automatically reject documents with a high risk score, automatically accept documents with a low risk score, and manually review documents in between. We suggest starting with a threshold of 80 for auto-rejection and 20 for auto-acceptance. As you gather more data points on typical risk scores for your use case, you can tune these parameters to reduce the number of documents undergoing manual review. #[serde(default, skip_serializing_if = "Option::is_none")] pub risk_score: Option, } @@ -10,4 +10,4 @@ impl std::fmt::Display for DocumentRiskSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/document_status.rs b/src/model/document_status.rs new file mode 100644 index 00000000..e8825fb3 --- /dev/null +++ b/src/model/document_status.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///An outcome status for this specific document submission. Distinct from the overall `documentary_verification.status` that summarizes the verification outcome from one or more documents. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum DocumentStatus { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "manually_approved")] + ManuallyApproved, +} diff --git a/src/model/documentary_verification.rs b/src/model/documentary_verification.rs index 4bd64fcb..7e6542b1 100644 --- a/src/model/documentary_verification.rs +++ b/src/model/documentary_verification.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for DocumentaryVerification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/documentary_verification_document.rs b/src/model/documentary_verification_document.rs index cea7a891..2d33a546 100644 --- a/src/model/documentary_verification_document.rs +++ b/src/model/documentary_verification_document.rs @@ -1,7 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::{DocumentAnalysis, PhysicalDocumentExtractedData, PhysicalDocumentImages}; +use super::{ + DocumentAnalysis, DocumentStatus, PhysicalDocumentExtractedData, + PhysicalDocumentImages, +}; ///Images, extracted data, and analysis from a user's identity document -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct DocumentaryVerificationDocument { ///High level descriptions of how the associated document was processed. If a document fails verification, the details in the `analysis` object should help clarify why the document was rejected. pub analysis: DocumentAnalysis, @@ -16,10 +19,10 @@ pub struct DocumentaryVerificationDocument { #[serde(default, skip_serializing_if = "Option::is_none")] pub redacted_at: Option>, ///An outcome status for this specific document submission. Distinct from the overall `documentary_verification.status` that summarizes the verification outcome from one or more documents. - pub status: String, + pub status: DocumentStatus, } impl std::fmt::Display for DocumentaryVerificationDocument { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/earnings.rs b/src/model/earnings.rs index 0310186c..6e0d4c80 100644 --- a/src/model/earnings.rs +++ b/src/model/earnings.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for Earnings { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/earnings_breakdown.rs b/src/model/earnings_breakdown.rs index 440a4047..dac45326 100644 --- a/src/model/earnings_breakdown.rs +++ b/src/model/earnings_breakdown.rs @@ -34,4 +34,4 @@ impl std::fmt::Display for EarningsBreakdown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/earnings_breakdown_canonical_description.rs b/src/model/earnings_breakdown_canonical_description.rs index 6bf1f782..34be6eee 100644 --- a/src/model/earnings_breakdown_canonical_description.rs +++ b/src/model/earnings_breakdown_canonical_description.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct EarningsBreakdownCanonicalDescription(pub serde_json::Value); \ No newline at end of file +pub struct EarningsBreakdownCanonicalDescription(pub serde_json::Value); diff --git a/src/model/earnings_total.rs b/src/model/earnings_total.rs index 002bc334..7afe9f54 100644 --- a/src/model/earnings_total.rs +++ b/src/model/earnings_total.rs @@ -31,4 +31,4 @@ impl std::fmt::Display for EarningsTotal { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/email.rs b/src/model/email.rs index 7db7ccc3..bd3a2660 100644 --- a/src/model/email.rs +++ b/src/model/email.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for Email { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/email_address_match_score.rs b/src/model/email_address_match_score.rs index 9bf018a3..2403b31c 100644 --- a/src/model/email_address_match_score.rs +++ b/src/model/email_address_match_score.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for EmailAddressMatchScore { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/employee.rs b/src/model/employee.rs index 55b66c69..490dfff2 100644 --- a/src/model/employee.rs +++ b/src/model/employee.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for Employee { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/employer.rs b/src/model/employer.rs index f3a31714..e3a6e24e 100644 --- a/src/model/employer.rs +++ b/src/model/employer.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for Employer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/employer_verification.rs b/src/model/employer_verification.rs index 1b883f49..288ea458 100644 --- a/src/model/employer_verification.rs +++ b/src/model/employer_verification.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for EmployerVerification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/employers_search_response.rs b/src/model/employers_search_response.rs index 0f19713b..ff95722e 100644 --- a/src/model/employers_search_response.rs +++ b/src/model/employers_search_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for EmployersSearchResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/employment_details.rs b/src/model/employment_details.rs index be05f619..6e6bcf8a 100644 --- a/src/model/employment_details.rs +++ b/src/model/employment_details.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for EmploymentDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/employment_source_type.rs b/src/model/employment_source_type.rs new file mode 100644 index 00000000..91582722 --- /dev/null +++ b/src/model/employment_source_type.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The types of source employment data that users should be able to share +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum EmploymentSourceType { + #[serde(rename = "bank")] + Bank, + #[serde(rename = "payroll")] + Payroll, +} diff --git a/src/model/employment_verification.rs b/src/model/employment_verification.rs index 6fb32cd7..9d263698 100644 --- a/src/model/employment_verification.rs +++ b/src/model/employment_verification.rs @@ -26,4 +26,4 @@ impl std::fmt::Display for EmploymentVerification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/employment_verification_get_response.rs b/src/model/employment_verification_get_response.rs index aa948d7b..e75fa33d 100644 --- a/src/model/employment_verification_get_response.rs +++ b/src/model/employment_verification_get_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for EmploymentVerificationGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/employment_verification_status.rs b/src/model/employment_verification_status.rs index cc4b012b..b06d4938 100644 --- a/src/model/employment_verification_status.rs +++ b/src/model/employment_verification_status.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct EmploymentVerificationStatus(pub serde_json::Value); \ No newline at end of file +pub struct EmploymentVerificationStatus(pub serde_json::Value); diff --git a/src/model/enhancements.rs b/src/model/enhancements.rs index e26f3640..2b938f00 100644 --- a/src/model/enhancements.rs +++ b/src/model/enhancements.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{Counterparty, Location, PersonalFinanceCategory}; +use super::{Counterparty, Location, PaymentChannel, PersonalFinanceCategory}; ///A grouping of the Plaid produced transaction enhancement fields. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Enhancements { ///A hierarchical array of the categories to which this transaction belongs. For a full list of categories, see [`/categories/get`](https://plaid.com/docs/api/products/transactions/#categoriesget). #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -29,7 +29,7 @@ pub struct Enhancements { `in store:` transactions that were made at a physical location. `other:` transactions that relate to banks, e.g. fees or deposits.*/ - pub payment_channel: String, + pub payment_channel: PaymentChannel, /**Information describing the intent of the transaction. Most relevant for personal finance use cases, but not limited to such use cases. See the [`taxonomy CSV file`](https://plaid.com/documents/transactions-personal-finance-category-taxonomy.csv) for a full list of personal finance categories. If you are migrating to personal finance categories from the legacy categories, also refer to the [`migration guide`](https://plaid.com/docs/transactions/pfc-migration/).*/ @@ -46,4 +46,4 @@ impl std::fmt::Display for Enhancements { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/enrich_transaction_direction.rs b/src/model/enrich_transaction_direction.rs new file mode 100644 index 00000000..98421998 --- /dev/null +++ b/src/model/enrich_transaction_direction.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**The direction of the transaction from the perspective of the account holder: + +`OUTFLOW` - Includes outgoing transfers, purchases, and fees. (Typically represented as a negative value on checking accounts and debit cards and a positive value on credit cards.) + +`INFLOW` - Includes incoming transfers, refunds, and income. (Typically represented as a positive value on checking accounts and debit cards and a negative value on credit cards.)*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum EnrichTransactionDirection { + #[serde(rename = "INFLOW")] + Inflow, + #[serde(rename = "OUTFLOW")] + Outflow, +} diff --git a/src/model/enrichments.rs b/src/model/enrichments.rs index d8cf3926..95520369 100644 --- a/src/model/enrichments.rs +++ b/src/model/enrichments.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{Counterparty, Location, PersonalFinanceCategory, Recurrence}; +use super::{Counterparty, Location, PaymentChannel, PersonalFinanceCategory, Recurrence}; ///A grouping of the Plaid produced transaction enrichment fields. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Enrichments { ///The check number of the transaction. This field is only populated for check transactions. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -36,7 +36,7 @@ We recommend using the `personal_finance_category` for transaction categorizatio `in store:` transactions that were made at a physical location. `other:` transactions that relate to banks, e.g. fees or deposits.*/ - pub payment_channel: String, + pub payment_channel: PaymentChannel, /**Information describing the intent of the transaction. Most relevant for personal finance use cases, but not limited to such use cases. See the [`taxonomy CSV file`](https://plaid.com/documents/transactions-personal-finance-category-taxonomy.csv) for a full list of personal finance categories. If you are migrating to personal finance categories from the legacy categories, also refer to the [`migration guide`](https://plaid.com/docs/transactions/pfc-migration/).*/ @@ -44,7 +44,7 @@ See the [`taxonomy CSV file`](https://plaid.com/documents/transactions-personal- pub personal_finance_category: Option, ///The URL of an icon associated with the primary personal finance category. The icon will always be 100×100 pixel PNG file. pub personal_finance_category_icon_url: String, - ///The phone number associated with the primary_counterparty in E. 164 format. If there is a location match (i.e. a street address is returned in the location object), the phone number will be location specific. + ///The phone number associated with the counterparty in E. 164 format. If there is a location match (i.e. a street address is returned in the location object), the phone number will be location specific. #[serde(default, skip_serializing_if = "Option::is_none")] pub phone_number: Option, /**Insights relating to expenses and deposits that are predicted to occur on a scheduled basis, such as biweekly, monthly, or annually. @@ -62,4 +62,4 @@ impl std::fmt::Display for Enrichments { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_document.rs b/src/model/entity_document.rs index 70f23fbe..7013d5b8 100644 --- a/src/model/entity_document.rs +++ b/src/model/entity_document.rs @@ -1,8 +1,9 @@ use serde::{Serialize, Deserialize}; +use super::EntityDocumentType; ///An official document, usually issued by a governing body or institution, with an associated identifier. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityDocument { - ///The numeric or alphanumeric identifier associated with this document. + ///The numeric or alphanumeric identifier associated with this document. Must be between 4 and 32 characters long, and cannot have leading or trailing spaces. pub number: String, /**The kind of official document represented by this object. @@ -18,10 +19,10 @@ pub struct EntityDocument { `tax_id` - Identification issued for the purpose of collecting taxes*/ #[serde(rename = "type")] - pub type_: String, + pub type_: EntityDocumentType, } impl std::fmt::Display for EntityDocument { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_document_type.rs b/src/model/entity_document_type.rs new file mode 100644 index 00000000..932d29b2 --- /dev/null +++ b/src/model/entity_document_type.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +/**The kind of official document represented by this object. + +`bik` - Russian bank code + +`business_number` - A number that uniquely identifies the business within a category of businesses + +`imo` - Number assigned to the entity by the International Maritime Organization + +`other` - Any document not covered by other categories + +`swift` - Number identifying a bank and branch. + +`tax_id` - Identification issued for the purpose of collecting taxes*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum EntityDocumentType { + #[serde(rename = "bik")] + Bik, + #[serde(rename = "business_number")] + BusinessNumber, + #[serde(rename = "imo")] + Imo, + #[serde(rename = "other")] + Other, + #[serde(rename = "swift")] + Swift, + #[serde(rename = "tax_id")] + TaxId, +} diff --git a/src/model/entity_screening_hit_analysis.rs b/src/model/entity_screening_hit_analysis.rs index 4adde01f..a2fea773 100644 --- a/src/model/entity_screening_hit_analysis.rs +++ b/src/model/entity_screening_hit_analysis.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::MatchSummaryCode; ///Analysis information describing why a screening hit matched the provided entity information -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityScreeningHitAnalysis { /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -15,7 +16,7 @@ pub struct EntityScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub documents: Option, + pub documents: Option, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -29,7 +30,7 @@ pub struct EntityScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub email_addresses: Option, + pub email_addresses: Option, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -43,7 +44,7 @@ pub struct EntityScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub locations: Option, + pub locations: Option, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -57,7 +58,7 @@ pub struct EntityScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub names: Option, + pub names: Option, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -71,7 +72,7 @@ pub struct EntityScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone_numbers: Option, + pub phone_numbers: Option, ///The version of the entity screening's `search_terms` that were compared when the entity screening hit was added. entity screening hits are immutable once they have been reviewed. If changes are detected due to updates to the entity screening's `search_terms`, the associated entity program, or the list's source data prior to review, the entity screening hit will be updated to reflect those changes. pub search_terms_version: i64, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -87,10 +88,10 @@ pub struct EntityScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub urls: Option, + pub urls: Option, } impl std::fmt::Display for EntityScreeningHitAnalysis { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hit_data.rs b/src/model/entity_screening_hit_data.rs index 76e26b28..75af0cd7 100644 --- a/src/model/entity_screening_hit_data.rs +++ b/src/model/entity_screening_hit_data.rs @@ -30,4 +30,4 @@ impl std::fmt::Display for EntityScreeningHitData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hit_documents_items.rs b/src/model/entity_screening_hit_documents_items.rs index 7987c6b2..3ff6b575 100644 --- a/src/model/entity_screening_hit_documents_items.rs +++ b/src/model/entity_screening_hit_documents_items.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{EntityDocument, MatchSummary}; ///Analyzed documents for the associated hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityScreeningHitDocumentsItems { ///Summary object reflecting the match result of the associated data #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for EntityScreeningHitDocumentsItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hit_emails.rs b/src/model/entity_screening_hit_emails.rs index 4d68497d..1c48a4ea 100644 --- a/src/model/entity_screening_hit_emails.rs +++ b/src/model/entity_screening_hit_emails.rs @@ -2,11 +2,11 @@ use serde::{Serialize, Deserialize}; ///Email address information for the associated entity watchlist hit #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct EntityScreeningHitEmails { - ///A valid email address. + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). pub email_address: String, } impl std::fmt::Display for EntityScreeningHitEmails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hit_emails_items.rs b/src/model/entity_screening_hit_emails_items.rs index 37e417b4..a18675dd 100644 --- a/src/model/entity_screening_hit_emails_items.rs +++ b/src/model/entity_screening_hit_emails_items.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{EntityScreeningHitEmails, MatchSummary}; ///Analyzed emails for the associated hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityScreeningHitEmailsItems { ///Summary object reflecting the match result of the associated data #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for EntityScreeningHitEmailsItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hit_names.rs b/src/model/entity_screening_hit_names.rs index 4a043eaf..28c16f64 100644 --- a/src/model/entity_screening_hit_names.rs +++ b/src/model/entity_screening_hit_names.rs @@ -1,16 +1,17 @@ use serde::{Serialize, Deserialize}; +use super::WeakAliasDetermination; ///Name information for the associated entity watchlist hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityScreeningHitNames { ///The full name of the entity. pub full: String, ///Primary names are those most commonly used to refer to this entity. Only one name will ever be marked as primary. pub is_primary: bool, ///Names that are explicitly marked as low quality either by their `source` list, or by `plaid` by a series of additional checks done by Plaid. Plaid does not ever surface a hit as a result of a weak name alone. If a name has no quality issues, this value will be `none`. - pub weak_alias_determination: String, + pub weak_alias_determination: WeakAliasDetermination, } impl std::fmt::Display for EntityScreeningHitNames { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hit_names_items.rs b/src/model/entity_screening_hit_names_items.rs index 2bae97ae..5f76d4b9 100644 --- a/src/model/entity_screening_hit_names_items.rs +++ b/src/model/entity_screening_hit_names_items.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{EntityScreeningHitNames, MatchSummary}; ///Analyzed names for the associated hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityScreeningHitNamesItems { ///Summary object reflecting the match result of the associated data #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for EntityScreeningHitNamesItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hit_phone_numbers.rs b/src/model/entity_screening_hit_phone_numbers.rs index 5f76113e..5beda1da 100644 --- a/src/model/entity_screening_hit_phone_numbers.rs +++ b/src/model/entity_screening_hit_phone_numbers.rs @@ -1,15 +1,16 @@ use serde::{Serialize, Deserialize}; +use super::PhoneType; ///Phone number information associated with the entity screening hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityScreeningHitPhoneNumbers { ///A phone number in E.164 format. pub phone_number: String, ///An enum indicating whether a phone number is a phone line or a fax line. #[serde(rename = "type")] - pub type_: String, + pub type_: PhoneType, } impl std::fmt::Display for EntityScreeningHitPhoneNumbers { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hit_urls.rs b/src/model/entity_screening_hit_urls.rs index a9ca9eef..78d3e097 100644 --- a/src/model/entity_screening_hit_urls.rs +++ b/src/model/entity_screening_hit_urls.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for EntityScreeningHitUrls { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hit_urls_items.rs b/src/model/entity_screening_hit_urls_items.rs index cf54ac3b..8c352ef2 100644 --- a/src/model/entity_screening_hit_urls_items.rs +++ b/src/model/entity_screening_hit_urls_items.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{EntityScreeningHitUrls, MatchSummary}; ///Analyzed URLs for the associated hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityScreeningHitUrlsItems { ///Summary object reflecting the match result of the associated data #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for EntityScreeningHitUrlsItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_hits_phone_number_items.rs b/src/model/entity_screening_hits_phone_number_items.rs index e6a96853..82c4cdd9 100644 --- a/src/model/entity_screening_hits_phone_number_items.rs +++ b/src/model/entity_screening_hits_phone_number_items.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{EntityScreeningHitPhoneNumbers, MatchSummary}; ///Analyzed phone numbers for the associated hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityScreeningHitsPhoneNumberItems { ///Summary object reflecting the match result of the associated data #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for EntityScreeningHitsPhoneNumberItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_screening_status_updated_webhook.rs b/src/model/entity_screening_status_updated_webhook.rs index 61bff4ee..3da6fd84 100644 --- a/src/model/entity_screening_status_updated_webhook.rs +++ b/src/model/entity_screening_status_updated_webhook.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when an entity screening status has changed, which can occur manually via the dashboard or during ongoing monitoring. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityScreeningStatusUpdatedWebhook { + ///The ID of the associated entity screening. + pub entity_screening_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, - ///The ID of the associated screening. - pub screening_id: String, + pub environment: WebhookEnvironmentValues, ///`STATUS_UPDATED` pub webhook_code: String, ///`ENTITY_SCREENING` @@ -15,4 +16,4 @@ impl std::fmt::Display for EntityScreeningStatusUpdatedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_watchlist_code.rs b/src/model/entity_watchlist_code.rs new file mode 100644 index 00000000..dbed52bc --- /dev/null +++ b/src/model/entity_watchlist_code.rs @@ -0,0 +1,47 @@ +use serde::{Serialize, Deserialize}; +/**Shorthand identifier for a specific screening list for entities. + `AU_CON`: Australia Department of Foreign Affairs and Trade Consolidated List + `CA_CON`: Government of Canada Consolidated List of Sanctions + `EU_CON`: European External Action Service Consolidated List + `IZ_SOE`: State Owned Enterprise List + `IZ_UNC`: United Nations Consolidated Sanctions + `IZ_WBK`: World Bank Listing of Ineligible Firms and Individuals + `US_CAP`: US OFAC Correspondent Account or Payable-Through Account Sanctions + `US_FSE`: US OFAC Foreign Sanctions Evaders + `US_MBS`: US Non-SDN Menu-Based Sanctions + `US_SDN`: US Specially Designated Nationals List + `US_SSI`: US OFAC Sectoral Sanctions Identifications + `US_CMC`: US OFAC Non-SDN Chinese Military-Industrial Complex List + `US_UVL`: Bureau of Industry and Security Unverified List + `UK_HMC`: UK HM Treasury Consolidated List*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum EntityWatchlistCode { + #[serde(rename = "CA_CON")] + CaCon, + #[serde(rename = "EU_CON")] + EuCon, + #[serde(rename = "IZ_SOE")] + IzSoe, + #[serde(rename = "IZ_UNC")] + IzUnc, + #[serde(rename = "IZ_WBK")] + IzWbk, + #[serde(rename = "US_CAP")] + UsCap, + #[serde(rename = "US_FSE")] + UsFse, + #[serde(rename = "US_MBS")] + UsMbs, + #[serde(rename = "US_SDN")] + UsSdn, + #[serde(rename = "US_SSI")] + UsSsi, + #[serde(rename = "US_CMC")] + UsCmc, + #[serde(rename = "US_UVL")] + UsUvl, + #[serde(rename = "AU_CON")] + AuCon, + #[serde(rename = "UK_HMC")] + UkHmc, +} diff --git a/src/model/entity_watchlist_program.rs b/src/model/entity_watchlist_program.rs index 74069fbe..c4b2494a 100644 --- a/src/model/entity_watchlist_program.rs +++ b/src/model/entity_watchlist_program.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::WatchlistScreeningAuditTrail; +use super::{EntityWatchlistCode, ProgramNameSensitivity, WatchlistScreeningAuditTrail}; ///A program that configures the active lists, search parameters, and other behavior for initial and ongoing screening of entities. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityWatchlistProgram { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: WatchlistScreeningAuditTrail, @@ -15,7 +15,7 @@ pub struct EntityWatchlistProgram { pub is_rescanning_enabled: bool, ///Watchlists enabled for the associated program #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub lists_enabled: Vec, + pub lists_enabled: Vec, ///A name for the entity program to define its purpose. For example, "High Risk Organizations" or "Applicants". pub name: String, /**The valid name matching sensitivity configurations for a screening program. Note that while certain matching techniques may be more prevalent on less strict settings, all matching algorithms are enabled for every sensitivity. @@ -27,10 +27,10 @@ pub struct EntityWatchlistProgram { `strict` - Aggressive false positive reduction. This sensitivity will require names to be more similar than `coarse` and `balanced` settings, relying less on phonetics, while still accounting for character transpositions, missing tokens, and other common permutations. `exact` - Matches must be nearly exact. This sensitivity will only show hits with exact or nearly exact name matches with only basic correction such as extraneous symbols and capitalization. This setting is generally not recommended unless you have a very specific use case.*/ - pub name_sensitivity: String, + pub name_sensitivity: ProgramNameSensitivity, } impl std::fmt::Display for EntityWatchlistProgram { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_watchlist_screening.rs b/src/model/entity_watchlist_screening.rs index 267bf900..1439074d 100644 --- a/src/model/entity_watchlist_screening.rs +++ b/src/model/entity_watchlist_screening.rs @@ -1,9 +1,12 @@ use serde::{Serialize, Deserialize}; -use super::{EntityWatchlistScreeningSearchTerms, WatchlistScreeningAuditTrail}; +use super::{ + EntityWatchlistScreeningSearchTerms, WatchlistScreeningAuditTrail, + WatchlistScreeningStatus, +}; ///The entity screening object allows you to represent an entity in your system, update its profile, and search for it on various watchlists. Note: Rejected entity screenings will not receive new hits, regardless of entity program configuration. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityWatchlistScreening { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. @@ -16,10 +19,10 @@ pub struct EntityWatchlistScreening { ///Search terms associated with an entity used for searching against watchlists pub search_terms: EntityWatchlistScreeningSearchTerms, ///A status enum indicating whether a screening is still pending review, has been rejected, or has been cleared. - pub status: String, + pub status: WatchlistScreeningStatus, } impl std::fmt::Display for EntityWatchlistScreening { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_watchlist_screening_hit.rs b/src/model/entity_watchlist_screening_hit.rs index 8326aef2..b01cb91c 100644 --- a/src/model/entity_watchlist_screening_hit.rs +++ b/src/model/entity_watchlist_screening_hit.rs @@ -1,7 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::{EntityScreeningHitAnalysis, EntityScreeningHitData}; +use super::{ + EntityScreeningHitAnalysis, EntityScreeningHitData, EntityWatchlistCode, + WatchlistScreeningHitStatus, +}; ///Data from a government watchlist that has been attached to the screening. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityWatchlistScreeningHit { ///Analysis information describing why a screening hit matched the provided entity information #[serde(default, skip_serializing_if = "Option::is_none")] @@ -34,11 +37,11 @@ pub struct EntityWatchlistScreeningHit { `US_CMC`: US OFAC Non-SDN Chinese Military-Industrial Complex List `US_UVL`: Bureau of Industry and Security Unverified List `UK_HMC`: UK HM Treasury Consolidated List*/ - pub list_code: String, + pub list_code: EntityWatchlistCode, ///A universal identifier for a watchlist individual that is stable across searches and updates. pub plaid_uid: String, ///The current state of review. All watchlist screening hits begin in a `pending_review` state but can be changed by creating a review. When a hit is in the `pending_review` state, it will always show the latest version of the watchlist data Plaid has available and be compared against the latest customer information saved in the watchlist screening. Once a hit has been marked as `confirmed` or `dismissed` it will no longer be updated so that the state is as it was when the review was first conducted. - pub review_status: String, + pub review_status: WatchlistScreeningHitStatus, ///The identifier provided by the source sanction or watchlist. When one is not provided by the source, this is `null`. #[serde(default, skip_serializing_if = "Option::is_none")] pub source_uid: Option, @@ -47,4 +50,4 @@ impl std::fmt::Display for EntityWatchlistScreeningHit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_watchlist_screening_review.rs b/src/model/entity_watchlist_screening_review.rs index fb635df1..d6519edc 100644 --- a/src/model/entity_watchlist_screening_review.rs +++ b/src/model/entity_watchlist_screening_review.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::WatchlistScreeningAuditTrail; /**A review submitted by a team member for an entity watchlist screening. A review can be either a comment on the current screening state, actions taken against hits attached to the watchlist screening, or both.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct EntityWatchlistScreeningReview { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: WatchlistScreeningAuditTrail, @@ -22,4 +22,4 @@ impl std::fmt::Display for EntityWatchlistScreeningReview { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_watchlist_screening_search_terms.rs b/src/model/entity_watchlist_screening_search_terms.rs index 499caa78..0edb7d3b 100644 --- a/src/model/entity_watchlist_screening_search_terms.rs +++ b/src/model/entity_watchlist_screening_search_terms.rs @@ -5,15 +5,15 @@ pub struct EntityWatchlistScreeningSearchTerms { ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. #[serde(default, skip_serializing_if = "Option::is_none")] pub country: Option, - ///The numeric or alphanumeric identifier associated with this document. + ///The numeric or alphanumeric identifier associated with this document. Must be between 4 and 32 characters long, and cannot have leading or trailing spaces. #[serde(default, skip_serializing_if = "Option::is_none")] pub document_number: Option, - ///A valid email address. + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, ///ID of the associated entity program. pub entity_watchlist_program_id: String, - ///The name of the organization being screened. + ///The name of the organization being screened. Must have at least one alphabetical character, have a maximum length of 100 characters, and not include leading or trailing spaces. pub legal_name: String, ///A phone number in E.164 format. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -28,4 +28,4 @@ impl std::fmt::Display for EntityWatchlistScreeningSearchTerms { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/entity_watchlist_search_terms.rs b/src/model/entity_watchlist_search_terms.rs index a2d3f62c..a3a1fcf4 100644 --- a/src/model/entity_watchlist_search_terms.rs +++ b/src/model/entity_watchlist_search_terms.rs @@ -5,15 +5,15 @@ pub struct EntityWatchlistSearchTerms { ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. #[serde(default, skip_serializing_if = "Option::is_none")] pub country: Option, - ///The numeric or alphanumeric identifier associated with this document. + ///The numeric or alphanumeric identifier associated with this document. Must be between 4 and 32 characters long, and cannot have leading or trailing spaces. #[serde(default, skip_serializing_if = "Option::is_none")] pub document_number: Option, - ///A valid email address. + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, ///ID of the associated entity program. pub entity_watchlist_program_id: String, - ///The name of the organization being screened. + ///The name of the organization being screened. Must have at least one alphabetical character, have a maximum length of 100 characters, and not include leading or trailing spaces. pub legal_name: String, ///A phone number in E.164 format. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -26,4 +26,4 @@ impl std::fmt::Display for EntityWatchlistSearchTerms { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/expiration_date.rs b/src/model/expiration_date.rs new file mode 100644 index 00000000..83e5a764 --- /dev/null +++ b/src/model/expiration_date.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**A description of whether the associated document was expired when the verification was performed. + +Note: In the case where an expiration date is not present on the document or failed to be extracted, this value will be `no_data`.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ExpirationDate { + #[serde(rename = "not_expired")] + NotExpired, + #[serde(rename = "expired")] + Expired, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/extended_recipient_metadata.rs b/src/model/extended_recipient_metadata.rs new file mode 100644 index 00000000..a2c1b47b --- /dev/null +++ b/src/model/extended_recipient_metadata.rs @@ -0,0 +1,31 @@ +use serde::{Serialize, Deserialize}; +use super::FdxRecipientMetadata; +///Plaid and FDX-defined recipient metadata fields +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ExtendedRecipientMetadata { + ///Recipient metadata fields that are defined by FDX + #[serde(flatten)] + pub fdx_recipient_metadata: FdxRecipientMetadata, + ///The category that the recipient falls under + pub category: String, + ///The number of Data Partner consumers that are connected to the recipient for the specific Data Partner + pub connection_count: i64, + ///The date at which the recipient gained production access to Plaid + pub joined_date: chrono::NaiveDate, +} +impl std::fmt::Display for ExtendedRecipientMetadata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} +impl std::ops::Deref for ExtendedRecipientMetadata { + type Target = FdxRecipientMetadata; + fn deref(&self) -> &Self::Target { + &self.fdx_recipient_metadata + } +} +impl std::ops::DerefMut for ExtendedRecipientMetadata { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.fdx_recipient_metadata + } +} diff --git a/src/model/external_payment_initiation_consent_options.rs b/src/model/external_payment_initiation_consent_options.rs index b683bdbe..bec8563c 100644 --- a/src/model/external_payment_initiation_consent_options.rs +++ b/src/model/external_payment_initiation_consent_options.rs @@ -1,6 +1,6 @@ use serde::{Serialize, Deserialize}; use super::RecipientBacs; -///Additional payment consent options +///(Deprecated) Additional payment consent options #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ExternalPaymentInitiationConsentOptions { ///An optional object used to restrict the accounts used for payments. If provided, the end user will be able to send payments only from the specified bank account. @@ -17,4 +17,4 @@ impl std::fmt::Display for ExternalPaymentInitiationConsentOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/external_payment_options.rs b/src/model/external_payment_options.rs index 14ff085c..e3fa0924 100644 --- a/src/model/external_payment_options.rs +++ b/src/model/external_payment_options.rs @@ -28,4 +28,4 @@ impl std::fmt::Display for ExternalPaymentOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/external_payment_refund_details.rs b/src/model/external_payment_refund_details.rs index 2999dd0d..66b5c1e5 100644 --- a/src/model/external_payment_refund_details.rs +++ b/src/model/external_payment_refund_details.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for ExternalPaymentRefundDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/external_payment_schedule_base.rs b/src/model/external_payment_schedule_base.rs index 01a42a67..e82b20f3 100644 --- a/src/model/external_payment_schedule_base.rs +++ b/src/model/external_payment_schedule_base.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::PaymentScheduleInterval; ///The schedule that the payment will be executed on. If a schedule is provided, the payment is automatically set up as a standing order. If no schedule is specified, the payment will be executed only once. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ExternalPaymentScheduleBase { ///The start date sent to the bank after adjusting for holidays or weekends. Will be provided in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). If the start date did not require adjustment, this field will be `null`. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -11,7 +12,7 @@ If the only `interval_execution_day` between the start date and the end date (in pub end_date: Option, ///The frequency interval of the payment. #[serde(default, skip_serializing_if = "Option::is_none")] - pub interval: Option, + pub interval: Option, /**The day of the interval on which to schedule the payment. If the payment interval is weekly, `interval_execution_day` should be an integer from 1 (Monday) to 7 (Sunday). @@ -29,4 +30,4 @@ impl std::fmt::Display for ExternalPaymentScheduleBase { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/external_payment_schedule_request.rs b/src/model/external_payment_schedule_request.rs index 694be403..2d5f8e7a 100644 --- a/src/model/external_payment_schedule_request.rs +++ b/src/model/external_payment_schedule_request.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; use super::ExternalPaymentScheduleBase; -pub type ExternalPaymentScheduleRequest = ExternalPaymentScheduleBase; \ No newline at end of file +pub type ExternalPaymentScheduleRequest = ExternalPaymentScheduleBase; diff --git a/src/model/fallback_auth_microdeposit_auto_verified_webhook.rs b/src/model/fallback_auth_microdeposit_auto_verified_webhook.rs index 7d6d46e1..168dbc9a 100644 --- a/src/model/fallback_auth_microdeposit_auto_verified_webhook.rs +++ b/src/model/fallback_auth_microdeposit_auto_verified_webhook.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fires when an account is automatically verified using micro-deposits -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct FallbackAuthMicrodepositAutoVerifiedWebhook { ///The external account ID associated with the micro-deposit pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The error code associated with the webhook. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, @@ -20,4 +21,4 @@ impl std::fmt::Display for FallbackAuthMicrodepositAutoVerifiedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/fallback_auth_microdeposit_verification_expired_webhook.rs b/src/model/fallback_auth_microdeposit_verification_expired_webhook.rs index be4b0d54..e1efaa9f 100644 --- a/src/model/fallback_auth_microdeposit_verification_expired_webhook.rs +++ b/src/model/fallback_auth_microdeposit_verification_expired_webhook.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fires when an account has an expired verification when using micro-deposits -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct FallbackAuthMicrodepositVerificationExpiredWebhook { ///The external account ID associated with the micro-deposit pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The error code associated with the webhook. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, @@ -20,4 +21,4 @@ impl std::fmt::Display for FallbackAuthMicrodepositVerificationExpiredWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/fdx_content_types.rs b/src/model/fdx_content_types.rs new file mode 100644 index 00000000..5c7d13d8 --- /dev/null +++ b/src/model/fdx_content_types.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +///Types of document formats. (Suggested values) +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum FdxContentTypes { + #[serde(rename = "application/pdf")] + ApplicationPdf, + #[serde(rename = "image/gif")] + ImageGif, + #[serde(rename = "image/jpeg")] + ImageJpeg, + #[serde(rename = "image/tiff")] + ImageTiff, + #[serde(rename = "image/png")] + ImagePng, + #[serde(rename = "application/json")] + ApplicationJson, +} diff --git a/src/model/fdx_fi_attribute.rs b/src/model/fdx_fi_attribute.rs index fea3fa4c..b271d72c 100644 --- a/src/model/fdx_fi_attribute.rs +++ b/src/model/fdx_fi_attribute.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for FdxFiAttribute { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/fdx_hateoas_link.rs b/src/model/fdx_hateoas_link.rs index bb17eafb..3e681c83 100644 --- a/src/model/fdx_hateoas_link.rs +++ b/src/model/fdx_hateoas_link.rs @@ -1,10 +1,11 @@ use serde::{Serialize, Deserialize}; +use super::{FdxContentTypes, FdxHateoasLinkAction}; ///REST application constraint (Hypermedia As The Engine Of Application State) -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct FdxHateoasLink { ///HTTP Method to use for the request #[serde(default, skip_serializing_if = "Option::is_none")] - pub action: Option, + pub action: Option, ///URL to invoke the action on the resource pub href: String, ///Relation of this link to its containing entity, as defined by and with many example relation values at [IETF RFC5988](https://datatracker.ietf.org/doc/html/rfc5988) @@ -12,10 +13,10 @@ pub struct FdxHateoasLink { pub rel: Option, ///Content-types that can be used in the Accept header #[serde(default, skip_serializing_if = "Option::is_none")] - pub types: Option>, + pub types: Option>, } impl std::fmt::Display for FdxHateoasLink { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/fdx_hateoas_link_action.rs b/src/model/fdx_hateoas_link_action.rs new file mode 100644 index 00000000..2e580fbb --- /dev/null +++ b/src/model/fdx_hateoas_link_action.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///HTTP Method to use for the request +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum FdxHateoasLinkAction { + #[serde(rename = "GET")] + Get, + #[serde(rename = "POST")] + Post, + #[serde(rename = "PATCH")] + Patch, + #[serde(rename = "DELETE")] + Delete, + #[serde(rename = "PUT")] + Put, +} diff --git a/src/model/fdx_notification_category.rs b/src/model/fdx_notification_category.rs new file mode 100644 index 00000000..e762f730 --- /dev/null +++ b/src/model/fdx_notification_category.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///Category of Notification +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum FdxNotificationCategory { + #[serde(rename = "SECURITY")] + Security, + #[serde(rename = "MAINTENANCE")] + Maintenance, + #[serde(rename = "FRAUD")] + Fraud, + #[serde(rename = "CONSENT")] + Consent, + #[serde(rename = "NEW_DATA")] + NewData, +} diff --git a/src/model/fdx_notification_payload.rs b/src/model/fdx_notification_payload.rs index 70648e91..bc0b074b 100644 --- a/src/model/fdx_notification_payload.rs +++ b/src/model/fdx_notification_payload.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::FdxFiAttribute; +use super::{FdxFiAttribute, FdxNotificationPayloadIdType}; ///Custom key-value pairs payload for a notification -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct FdxNotificationPayload { #[serde(rename = "customFields")] #[serde(default, skip_serializing_if = "Option::is_none")] @@ -12,10 +12,10 @@ pub struct FdxNotificationPayload { ///Type of entity causing origination of a notification #[serde(rename = "idType")] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id_type: Option, + pub id_type: Option, } impl std::fmt::Display for FdxNotificationPayload { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/fdx_notification_payload_id_type.rs b/src/model/fdx_notification_payload_id_type.rs new file mode 100644 index 00000000..3a68c0ff --- /dev/null +++ b/src/model/fdx_notification_payload_id_type.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///Type of entity causing origination of a notification +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum FdxNotificationPayloadIdType { + #[serde(rename = "ACCOUNT")] + Account, + #[serde(rename = "CUSTOMER")] + Customer, + #[serde(rename = "PARTY")] + Party, + #[serde(rename = "MAINTENANCE")] + Maintenance, + #[serde(rename = "CONSENT")] + Consent, +} diff --git a/src/model/fdx_notification_priority.rs b/src/model/fdx_notification_priority.rs new file mode 100644 index 00000000..63e6bf30 --- /dev/null +++ b/src/model/fdx_notification_priority.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Priority of notification +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum FdxNotificationPriority { + #[serde(rename = "HIGH")] + High, + #[serde(rename = "MEDIUM")] + Medium, + #[serde(rename = "LOW")] + Low, +} diff --git a/src/model/fdx_notification_severity.rs b/src/model/fdx_notification_severity.rs new file mode 100644 index 00000000..51925d69 --- /dev/null +++ b/src/model/fdx_notification_severity.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///Severity level of notification +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum FdxNotificationSeverity { + #[serde(rename = "EMERGENCY")] + Emergency, + #[serde(rename = "ALERT")] + Alert, + #[serde(rename = "WARNING")] + Warning, + #[serde(rename = "NOTICE")] + Notice, + #[serde(rename = "INFO")] + Info, +} diff --git a/src/model/fdx_notification_type.rs b/src/model/fdx_notification_type.rs new file mode 100644 index 00000000..26be870e --- /dev/null +++ b/src/model/fdx_notification_type.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +///Type of Notification +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum FdxNotificationType { + #[serde(rename = "CONSENT_REVOKED")] + ConsentRevoked, + #[serde(rename = "CONSENT_UPDATED")] + ConsentUpdated, + #[serde(rename = "CUSTOM")] + Custom, + #[serde(rename = "SERVICE")] + Service, + #[serde(rename = "BALANCE")] + Balance, + #[serde(rename = "PLANNED_OUTAGE")] + PlannedOutage, +} diff --git a/src/model/fdx_party.rs b/src/model/fdx_party.rs index 72d8df90..8ee516d5 100644 --- a/src/model/fdx_party.rs +++ b/src/model/fdx_party.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::{FdxPartyRegistry, FdxPartyType}; ///FDX Participant - an entity or person that is a part of a FDX API transaction -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct FdxParty { ///URI for party, where an end user could learn more about the company or application involved in the data sharing chain #[serde(rename = "homeUri")] @@ -22,13 +23,13 @@ pub struct FdxParty { pub registered_entity_name: Option, ///The registry containing the party’s registration with name and id #[serde(default, skip_serializing_if = "Option::is_none")] - pub registry: Option, + pub registry: Option, ///Identifies the type of a party #[serde(rename = "type")] - pub type_: String, + pub type_: FdxPartyType, } impl std::fmt::Display for FdxParty { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/fdx_party_registry.rs b/src/model/fdx_party_registry.rs new file mode 100644 index 00000000..94e12686 --- /dev/null +++ b/src/model/fdx_party_registry.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///The registry containing the party’s registration with name and id +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum FdxPartyRegistry { + #[serde(rename = "FDX")] + Fdx, + #[serde(rename = "GLEIF")] + Gleif, + #[serde(rename = "ICANN")] + Icann, + #[serde(rename = "PRIVATE")] + Private, +} diff --git a/src/model/fdx_party_type.rs b/src/model/fdx_party_type.rs new file mode 100644 index 00000000..47919592 --- /dev/null +++ b/src/model/fdx_party_type.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +///Identifies the type of a party +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum FdxPartyType { + #[serde(rename = "DATA_ACCESS_PLATFORM")] + DataAccessPlatform, + #[serde(rename = "DATA_PROVIDER")] + DataProvider, + #[serde(rename = "DATA_RECIPIENT")] + DataRecipient, + #[serde(rename = "INDIVIDUAL")] + Individual, + #[serde(rename = "MERCHANT")] + Merchant, + #[serde(rename = "VENDOR")] + Vendor, +} diff --git a/src/model/fdx_recipient_metadata.rs b/src/model/fdx_recipient_metadata.rs new file mode 100644 index 00000000..7b499e92 --- /dev/null +++ b/src/model/fdx_recipient_metadata.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Recipient metadata fields that are defined by FDX +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct FdxRecipientMetadata { + ///The recipient name displayed by the Data Provider during the consent flow + pub client_name: String, + ///Data Recipient Logo URL location + #[serde(default, skip_serializing_if = "Option::is_none")] + pub logo_uri: Option, + ///The recipient identifier + pub recipient_id: String, + ///The legal name of the recipient + pub third_party_legal_name: String, +} +impl std::fmt::Display for FdxRecipientMetadata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/financial_institution_insights.rs b/src/model/financial_institution_insights.rs index 9654e5c2..cd0bc88b 100644 --- a/src/model/financial_institution_insights.rs +++ b/src/model/financial_institution_insights.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for FinancialInstitutionInsights { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/forecasted_monthly_income.rs b/src/model/forecasted_monthly_income.rs new file mode 100644 index 00000000..b7727b0c --- /dev/null +++ b/src/model/forecasted_monthly_income.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///An object representing the predicted average monthly net income amount. This amount reflects the funds deposited into the account and may not include any withheld income such as taxes or other payroll deductions +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ForecastedMonthlyIncome { + ///The forecasted monthly income at the time of subscription + pub baseline_amount: f64, + ///The current forecasted monthly income + pub current_amount: f64, +} +impl std::fmt::Display for ForecastedMonthlyIncome { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/form1099_type.rs b/src/model/form1099_type.rs new file mode 100644 index 00000000..77184479 --- /dev/null +++ b/src/model/form1099_type.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Form 1099 Type +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum Form1099Type { + #[serde(rename = "FORM_1099_TYPE_UNKNOWN")] + Form1099TypeUnknown, + #[serde(rename = "FORM_1099_TYPE_MISC")] + Form1099TypeMisc, + #[serde(rename = "FORM_1099_TYPE_K")] + Form1099TypeK, +} diff --git a/src/model/fraud_amount.rs b/src/model/fraud_amount.rs index f95fa921..eec42edc 100644 --- a/src/model/fraud_amount.rs +++ b/src/model/fraud_amount.rs @@ -1,10 +1,11 @@ use serde::{Serialize, Deserialize}; +use super::IsoCurrencyCode; /**The amount and currency of the fraud or attempted fraud. `fraud_amount` should be omitted to indicate an unknown fraud amount.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct FraudAmount { ///An ISO-4217 currency code. - pub iso_currency_code: String, + pub iso_currency_code: IsoCurrencyCode, /**The amount value. This value can be 0 to indicate no money was lost. Must not contain more than two digits of precision (e.g., `1.23`).*/ @@ -14,4 +15,4 @@ impl std::fmt::Display for FraudAmount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/generic_screening_hit_location_items.rs b/src/model/generic_screening_hit_location_items.rs index 9c8fc30b..5d0db404 100644 --- a/src/model/generic_screening_hit_location_items.rs +++ b/src/model/generic_screening_hit_location_items.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{MatchSummary, WatchlistScreeningHitLocations}; ///Analyzed location information for the associated hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct GenericScreeningHitLocationItems { ///Summary object reflecting the match result of the associated data #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for GenericScreeningHitLocationItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/get_recipient_response.rs b/src/model/get_recipient_response.rs new file mode 100644 index 00000000..69c7b093 --- /dev/null +++ b/src/model/get_recipient_response.rs @@ -0,0 +1,2 @@ +use serde::{Serialize, Deserialize}; +pub type GetRecipientResponse = serde_json::Value; diff --git a/src/model/get_recipients_response.rs b/src/model/get_recipients_response.rs new file mode 100644 index 00000000..105eef46 --- /dev/null +++ b/src/model/get_recipients_response.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +use super::ExtendedRecipientMetadata; +///GetRecipientsResponse defines the response schema for `/fdx/recipients` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct GetRecipientsResponse { + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub recipients: Vec, +} +impl std::fmt::Display for GetRecipientsResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/health_incident.rs b/src/model/health_incident.rs index 1f163d4a..c8f999bf 100644 --- a/src/model/health_incident.rs +++ b/src/model/health_incident.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for HealthIncident { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/hidden_match_summary_code.rs b/src/model/hidden_match_summary_code.rs new file mode 100644 index 00000000..84af780b --- /dev/null +++ b/src/model/hidden_match_summary_code.rs @@ -0,0 +1,26 @@ +use serde::{Serialize, Deserialize}; +/**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum HiddenMatchSummaryCode { + #[serde(rename = "match")] + Match, + #[serde(rename = "partial_match")] + PartialMatch, + #[serde(rename = "no_match")] + NoMatch, + #[serde(rename = "no_data")] + NoData, + #[serde(rename = "no_input")] + NoInput, +} diff --git a/src/model/historical_annual_income.rs b/src/model/historical_annual_income.rs new file mode 100644 index 00000000..108bd44e --- /dev/null +++ b/src/model/historical_annual_income.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///An object representing the historical annual income amount. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct HistoricalAnnualIncome { + ///The historical annual income at the time of subscription + pub baseline_amount: f64, + ///The current historical annual income + pub current_amount: f64, +} +impl std::fmt::Display for HistoricalAnnualIncome { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/historical_balance.rs b/src/model/historical_balance.rs index ab723ded..37232300 100644 --- a/src/model/historical_balance.rs +++ b/src/model/historical_balance.rs @@ -21,4 +21,4 @@ impl std::fmt::Display for HistoricalBalance { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/historical_update_webhook.rs b/src/model/historical_update_webhook.rs index b3ef9d7c..5a37ac4f 100644 --- a/src/model/historical_update_webhook.rs +++ b/src/model/historical_update_webhook.rs @@ -1,18 +1,18 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; -/**Fired when an Item's historical transaction pull is completed and Plaid has prepared as much historical transaction data as possible for the Item. Once this webhook has been fired, transaction data beyond the most recent 30 days can be fetched for the Item. If [Account Select v2](https://plaid.com/docs/link/customization/#account-select) is enabled, this webhook will also be fired if account selections for the Item are updated, with `new_transactions` set to the number of net new transactions pulled after the account selection update. +use super::{PlaidError, WebhookEnvironmentValues}; +/**Fired when an Item's historical transaction pull is completed and Plaid has prepared as much historical transaction data as possible for the Item. Once this webhook has been fired, transaction data beyond the most recent 30 days can be fetched for the Item. This webhook will also be fired if account selections for the Item are updated, with `new_transactions` set to the number of net new transactions pulled after the account selection update. This webhook is intended for use with `/transactions/get`; if you are using the newer `/transactions/sync` endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the `SYNC_UPDATES_AVAILABLE` webhook instead.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct HistoricalUpdateWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error pub item_id: String, - ///The number of new, unfetched transactions available + ///The number of new transactions available pub new_transactions: f64, ///`HISTORICAL_UPDATE` pub webhook_code: String, @@ -23,4 +23,4 @@ impl std::fmt::Display for HistoricalUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/holding.rs b/src/model/holding.rs index 9aee0e8e..4006668c 100644 --- a/src/model/holding.rs +++ b/src/model/holding.rs @@ -31,9 +31,15 @@ This field is returned for select financial institutions and comes as provided b See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `iso_currency_code`s.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub unofficial_currency_code: Option, + ///The total quantity of vested assets held, as reported by the financial institution. Vested assets are only associated with [equities](https://plaid.com/docs/api/products/investments/#investments-holdings-get-response-securities-type). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vested_quantity: Option, + ///The value of the vested holdings as reported by the institution. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vested_value: Option, } impl std::fmt::Display for Holding { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/holdings_default_update_webhook.rs b/src/model/holdings_default_update_webhook.rs index 24cb8c10..5e397dec 100644 --- a/src/model/holdings_default_update_webhook.rs +++ b/src/model/holdings_default_update_webhook.rs @@ -1,11 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired when new or updated holdings have been detected on an investment account. The webhook typically fires in response to any newly added holdings or price changes to existing holdings, most commonly after market close. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct HoldingsDefaultUpdateWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -23,4 +23,4 @@ impl std::fmt::Display for HoldingsDefaultUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/holdings_override.rs b/src/model/holdings_override.rs index c132bc69..17315fcb 100644 --- a/src/model/holdings_override.rs +++ b/src/model/holdings_override.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for HoldingsOverride { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/hosted_link_delivery_method.rs b/src/model/hosted_link_delivery_method.rs new file mode 100644 index 00000000..2ffb6780 --- /dev/null +++ b/src/model/hosted_link_delivery_method.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +/**How Plaid should deliver the Plaid Link session to the customer. Only available to customers enabled for Link Delivery (beta). To request Link Delivery access, contact your account manager. +'sms' will deliver via SMS. Must pass `user.phone_number`. +'email' will deliver via email. Must pass `user.email_address`. In the Sandbox environment, this field will be ignored; use the Production environment to test Link Delivery instead.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum HostedLinkDeliveryMethod { + #[serde(rename = "sms")] + Sms, + #[serde(rename = "email")] + Email, +} diff --git a/src/model/hosted_mmd_verification_webhook.rs b/src/model/hosted_mmd_verification_webhook.rs index 7125bda5..cb00a5fc 100644 --- a/src/model/hosted_mmd_verification_webhook.rs +++ b/src/model/hosted_mmd_verification_webhook.rs @@ -1,17 +1,18 @@ use serde::{Serialize, Deserialize}; -///Contains the state of a hosted same-day microdeposits verification session. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::WebhookEnvironmentValues; +///Contains the state of a SMS same-day microdeposits verification session. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct HostedMmdVerificationWebhook { ///The external account ID of the affected account pub account_id: String, ///The Plaid environment the webhook was sent from #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option, + pub environment: Option, ///The `item_id` of the Item associated with this webhook, warning, or error pub item_id: String, - ///The final status of the same-day microdeposits verification. Will always be "MANUALLY_VERIFIED" or "VERIFICATION_FAILED". + ///The final status of the same-day microdeposits verification. Will always be `MANUALLY_VERIFIED` or `VERIFICATION_FAILED`. pub status: String, - ///`HOSTED_VERIFICATION` + ///`SMS_MICRODEPOSITS_VERIFICATION` pub webhook_code: String, ///`AUTH` pub webhook_type: String, @@ -20,4 +21,4 @@ impl std::fmt::Display for HostedMmdVerificationWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/id_number_type.rs b/src/model/id_number_type.rs new file mode 100644 index 00000000..0eb33ed0 --- /dev/null +++ b/src/model/id_number_type.rs @@ -0,0 +1,75 @@ +use serde::{Serialize, Deserialize}; +///A globally unique and human readable ID type, specific to the country and document category. For more context on this field, see [Hybrid Input Validation](https://plaid.com/docs/identity-verification/hybrid-input-validation). +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IdNumberType { + #[serde(rename = "ar_dni")] + ArDni, + #[serde(rename = "au_drivers_license")] + AuDriversLicense, + #[serde(rename = "au_passport")] + AuPassport, + #[serde(rename = "br_cpf")] + BrCpf, + #[serde(rename = "ca_sin")] + CaSin, + #[serde(rename = "cl_run")] + ClRun, + #[serde(rename = "cn_resident_card")] + CnResidentCard, + #[serde(rename = "co_nit")] + CoNit, + #[serde(rename = "dk_cpr")] + DkCpr, + #[serde(rename = "eg_national_id")] + EgNationalId, + #[serde(rename = "es_dni")] + EsDni, + #[serde(rename = "es_nie")] + EsNie, + #[serde(rename = "hk_hkid")] + HkHkid, + #[serde(rename = "in_pan")] + InPan, + #[serde(rename = "it_cf")] + ItCf, + #[serde(rename = "jo_civil_id")] + JoCivilId, + #[serde(rename = "jp_my_number")] + JpMyNumber, + #[serde(rename = "ke_huduma_namba")] + KeHudumaNamba, + #[serde(rename = "kw_civil_id")] + KwCivilId, + #[serde(rename = "mx_curp")] + MxCurp, + #[serde(rename = "mx_rfc")] + MxRfc, + #[serde(rename = "my_nric")] + MyNric, + #[serde(rename = "ng_nin")] + NgNin, + #[serde(rename = "nz_drivers_license")] + NzDriversLicense, + #[serde(rename = "om_civil_id")] + OmCivilId, + #[serde(rename = "ph_psn")] + PhPsn, + #[serde(rename = "pl_pesel")] + PlPesel, + #[serde(rename = "ro_cnp")] + RoCnp, + #[serde(rename = "sa_national_id")] + SaNationalId, + #[serde(rename = "se_pin")] + SePin, + #[serde(rename = "sg_nric")] + SgNric, + #[serde(rename = "tr_tc_kimlik")] + TrTcKimlik, + #[serde(rename = "us_ssn")] + UsSsn, + #[serde(rename = "us_ssn_last_4")] + UsSsnLast4, + #[serde(rename = "za_smart_id")] + ZaSmartId, +} diff --git a/src/model/identity_default_update_webhook.rs b/src/model/identity_default_update_webhook.rs index bcfb238c..2d8e42c3 100644 --- a/src/model/identity_default_update_webhook.rs +++ b/src/model/identity_default_update_webhook.rs @@ -1,15 +1,15 @@ use serde::{Serialize, Deserialize}; -use super::{AccountIdsWithUpdatedIdentity, PlaidError}; +use super::{AccountIdsWithUpdatedIdentity, PlaidError, WebhookEnvironmentValues}; ///Fired when a change to identity data has been detected on an Item. Items are checked for identity updates every 30-90 days. We recommend that upon receiving this webhook you make another call to `/identity/get` to fetch the user's latest identity data. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityDefaultUpdateWebhook { /**An object with keys of `account_id`'s that are mapped to their respective identity attributes that changed. Example: `{ "XMBvvyMGQ1UoLbKByoMqH3nXMj84ALSdE5B58": ["PHONES"] }`*/ pub account_ids_with_updated_identity: AccountIdsWithUpdatedIdentity, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -23,4 +23,4 @@ impl std::fmt::Display for IdentityDefaultUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_document_metadata.rs b/src/model/identity_document_metadata.rs deleted file mode 100644 index 0b92af86..00000000 --- a/src/model/identity_document_metadata.rs +++ /dev/null @@ -1,31 +0,0 @@ -use serde::{Serialize, Deserialize}; -///In closed beta. Object representing metadata pertaining to the document. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct IdentityDocumentMetadata { - ///Boolean field indicating if the uploaded document's account number matches the account number we have on file - #[serde(default, skip_serializing_if = "Option::is_none")] - pub is_account_number_match: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub last_updated: Option>, - ///The name of the document. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub page_count: Option, - /**The processing status of the document. - -`PROCESSING_COMPLETE`: The document was successfully processed. - -`DOCUMENT_ERROR`: The document could not be processed. Possible causes include: The document was an unacceptable document type such as an offer letter or bank statement, the document image was cropped or blurry, or the document was corrupted. - -`UNKNOWN` or `null`: An internal error occurred. If this happens repeatedly, contact support or your Plaid account manager.*/ - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub uploaded_at: Option>, -} -impl std::fmt::Display for IdentityDocumentMetadata { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file diff --git a/src/model/identity_document_upload.rs b/src/model/identity_document_upload.rs new file mode 100644 index 00000000..636e84c6 --- /dev/null +++ b/src/model/identity_document_upload.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +use super::{IdentityDocumentUploadMetadata, IdentityDocumentUploadRiskInsights}; +///Document object with metadata of the uploaded document +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IdentityDocumentUpload { + ///A UUID identifying the document. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub document_id: Option, + ///Metadata pertaining to the document. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, + ///Object representing fraud risk data of the uploaded document. Only provided when using Identity Document Upload with Fraud Risk enabled. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub risk_insights: Option, +} +impl std::fmt::Display for IdentityDocumentUpload { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/identity_document_upload_metadata.rs b/src/model/identity_document_upload_metadata.rs new file mode 100644 index 00000000..93eb3e16 --- /dev/null +++ b/src/model/identity_document_upload_metadata.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +///Metadata pertaining to the document. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IdentityDocumentUploadMetadata { + ///The submitted document type. Currently, this will always be `BANK_STATEMENT`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub document_type: Option, + ///Boolean field indicating whether the uploaded document's account number matches the account number we have on file. If `false`, it is not recommended to accept the uploaded identity data as accurate without further verification. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_account_number_match: Option, + ///The timestamp when the document was last updated. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_updated: Option>, + ///The number of pages in the uploaded document. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_count: Option, + ///The timestamp when the document was originally uploaded. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uploaded_at: Option>, +} +impl std::fmt::Display for IdentityDocumentUploadMetadata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/identity_document_upload_risk_insights.rs b/src/model/identity_document_upload_risk_insights.rs new file mode 100644 index 00000000..0fcf197e --- /dev/null +++ b/src/model/identity_document_upload_risk_insights.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::{IdentityDocumentUploadRiskSignal, IdentityDocumentUploadRiskSummary}; +///Object representing fraud risk data of the uploaded document. Only provided when using Identity Document Upload with Fraud Risk enabled. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IdentityDocumentUploadRiskInsights { + ///An array of risk signals. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub risk_signals: Option>, + ///Risk summary of an uploaded document. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub risk_summary: Option, +} +impl std::fmt::Display for IdentityDocumentUploadRiskInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/identity_document_upload_risk_signal.rs b/src/model/identity_document_upload_risk_signal.rs new file mode 100644 index 00000000..9dbb539a --- /dev/null +++ b/src/model/identity_document_upload_risk_signal.rs @@ -0,0 +1,23 @@ +use serde::{Serialize, Deserialize}; +///Risk signals tied to the document +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IdentityDocumentUploadRiskSignal { + ///Indicates whether fraud risk was detected on the field. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub has_fraud_risk: Option, + ///The relevant page associated with the risk signal. If the risk signal is not associated with a specific page, the value will be 0. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub page_number: Option, + ///A human-readable explanation providing more detail about the specific risk signal. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub signal_description: Option, + ///The type of risk found. + #[serde(rename = "type")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl std::fmt::Display for IdentityDocumentUploadRiskSignal { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/identity_document_upload_risk_summary.rs b/src/model/identity_document_upload_risk_summary.rs new file mode 100644 index 00000000..f0c14548 --- /dev/null +++ b/src/model/identity_document_upload_risk_summary.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///Risk summary of an uploaded document. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IdentityDocumentUploadRiskSummary { + ///A number between 0 and 100, inclusive, where a score closer to 0 indicates a document is likely to be trustworthy and a score closer to 100 indicates a document is likely to be fraudulent. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub risk_score: Option, +} +impl std::fmt::Display for IdentityDocumentUploadRiskSummary { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/identity_documents_uploads_get_request_options.rs b/src/model/identity_documents_uploads_get_request_options.rs new file mode 100644 index 00000000..eb73dcc0 --- /dev/null +++ b/src/model/identity_documents_uploads_get_request_options.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///An optional object to filter `/identity/documents/uploads/get` results. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IdentityDocumentsUploadsGetRequestOptions { + /**A list of `account_ids` to retrieve for the Item. +Note: An error will be returned if a provided `account_id` is not associated with the Item.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_ids: Option>, +} +impl std::fmt::Display for IdentityDocumentsUploadsGetRequestOptions { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/identity_documents_uploads_get_response.rs b/src/model/identity_documents_uploads_get_response.rs new file mode 100644 index 00000000..e330b3f5 --- /dev/null +++ b/src/model/identity_documents_uploads_get_response.rs @@ -0,0 +1,18 @@ +use serde::{Serialize, Deserialize}; +use super::{AccountIdentityDocumentUpload, Item}; +///IdentityDocumentsUploadsGetResponse defines the response schema for `/identity/documents/uploads/get` +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct IdentityDocumentsUploadsGetResponse { + ///The accounts for which Identity data has been requested + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub accounts: Vec, + ///Metadata about the Item. + pub item: Item, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for IdentityDocumentsUploadsGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/identity_get_request_options.rs b/src/model/identity_get_request_options.rs index d9fbb77f..e4507b5e 100644 --- a/src/model/identity_get_request_options.rs +++ b/src/model/identity_get_request_options.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for IdentityGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_get_response.rs b/src/model/identity_get_response.rs index 4b42edcf..779b56cf 100644 --- a/src/model/identity_get_response.rs +++ b/src/model/identity_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountIdentity, Item}; ///IdentityGetResponse defines the response schema for `/identity/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityGetResponse { ///The accounts for which Identity data has been requested #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -15,4 +15,4 @@ impl std::fmt::Display for IdentityGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_match_request_options.rs b/src/model/identity_match_request_options.rs index fee909fb..24572618 100644 --- a/src/model/identity_match_request_options.rs +++ b/src/model/identity_match_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for IdentityMatchRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_match_response.rs b/src/model/identity_match_response.rs index 50de5051..da8c336e 100644 --- a/src/model/identity_match_response.rs +++ b/src/model/identity_match_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountIdentityMatchScore, Item}; ///IdentityMatchResponse defines the response schema for `/identity/match` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityMatchResponse { ///The accounts for which Identity match has been requested #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -15,4 +15,4 @@ impl std::fmt::Display for IdentityMatchResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_match_user.rs b/src/model/identity_match_user.rs index 7cbe765c..c3a14559 100644 --- a/src/model/identity_match_user.rs +++ b/src/model/identity_match_user.rs @@ -12,7 +12,7 @@ pub struct IdentityMatchUser { ///The user's full legal name. #[serde(default, skip_serializing_if = "Option::is_none")] pub legal_name: Option, - ///The user's phone number, in E.164 format: +{countrycode}{number}. For example: "+14151234567". Phone numbers provided in other formats will be parsed on a best-effort basis. + ///The user's phone number, in E.164 format: +{countrycode}{number}. For example: "+14157452130". Phone numbers provided in other formats will be parsed on a best-effort basis. Phone number input is validated against valid number ranges; number strings that do not match a real-world phone numbering scheme may cause the request to fail, even in the Sandbox test environment. #[serde(default, skip_serializing_if = "Option::is_none")] pub phone_number: Option, } @@ -20,4 +20,4 @@ impl std::fmt::Display for IdentityMatchUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_refresh_response.rs b/src/model/identity_refresh_response.rs index 7d2d55d5..e1ec39ec 100644 --- a/src/model/identity_refresh_response.rs +++ b/src/model/identity_refresh_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for IdentityRefreshResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_update_types.rs b/src/model/identity_update_types.rs new file mode 100644 index 00000000..eddb9419 --- /dev/null +++ b/src/model/identity_update_types.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///The possible types of identity data that may have changed. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IdentityUpdateTypes { + #[serde(rename = "PHONES")] + Phones, + #[serde(rename = "ADDRESSES")] + Addresses, + #[serde(rename = "EMAILS")] + Emails, + #[serde(rename = "NAMES")] + Names, +} diff --git a/src/model/identity_verification.rs b/src/model/identity_verification.rs index adde2048..083f871a 100644 --- a/src/model/identity_verification.rs +++ b/src/model/identity_verification.rs @@ -1,12 +1,15 @@ use serde::{Serialize, Deserialize}; use super::{ - DocumentaryVerification, IdentityVerificationStepSummary, + DocumentaryVerification, IdentityVerificationStatus, IdentityVerificationStepSummary, IdentityVerificationTemplateReference, IdentityVerificationUserData, KycCheckDetails, - RiskCheckDetails, SelfieCheck, + RiskCheckDetails, SelfieCheck, VerifySmsDetails, }; ///A identity verification attempt represents a customer's attempt to verify their identity, reflecting the required steps for completing the session, the results for each step, and information collected in the process. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerification { + ///ID of the associated Beacon User. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beacon_user_id: Option, ///A unique ID that identifies the end user in your system. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. pub client_user_id: String, ///An ISO8601 formatted timestamp. @@ -19,7 +22,7 @@ pub struct IdentityVerification { pub documentary_verification: Option, ///ID of the associated Identity Verification attempt. pub id: String, - ///Additional information for the `kyc_check` step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. + ///Additional information for the `kyc_check` (Data Source Verification) step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. #[serde(default, skip_serializing_if = "Option::is_none")] pub kyc_check: Option, ///The ID for the Identity Verification preceding this session. This field will only be filled if the current Identity Verification is a retry of a previous attempt. @@ -51,7 +54,7 @@ pub struct IdentityVerification { `canceled` - The Identity Verification attempt was canceled, either via the dashboard by a user, or via API. The user may have completed part of the session, but has neither failed or passed. `pending_review` - The Identity Verification attempt template was configured to perform a screening that had one or more hits needing review.*/ - pub status: String, + pub status: IdentityVerificationStatus, /**Each step will be one of the following values: @@ -81,6 +84,9 @@ pub struct IdentityVerification { pub template: IdentityVerificationTemplateReference, ///The identity data that was either collected from the user or provided via API in order to perform an Identity Verification. pub user: IdentityVerificationUserData, + ///Additional information for the `verify_sms` step. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub verify_sms: Option, ///ID of the associated screening. #[serde(default, skip_serializing_if = "Option::is_none")] pub watchlist_screening_id: Option, @@ -89,4 +95,4 @@ impl std::fmt::Display for IdentityVerification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_autofill_address.rs b/src/model/identity_verification_autofill_address.rs index aa42f44d..e52076a2 100644 --- a/src/model/identity_verification_autofill_address.rs +++ b/src/model/identity_verification_autofill_address.rs @@ -1,37 +1,38 @@ use serde::{Serialize, Deserialize}; +use super::{AddressPurposeLabel, PoBoxStatus}; /**Even if an address has been autofilled, some fields may be null depending on the region's addressing system. For example: Addresses from the United Kingdom will not include a region Addresses from Hong Kong will not include postal code*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationAutofillAddress { - ///City from the end user's address + ///City from the end user's address. A string with at least one non-whitespace alphabetical character, with a max length of 100 characters." #[serde(default, skip_serializing_if = "Option::is_none")] pub city: Option, ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. pub country: String, ///Field describing whether the associated address is a post office box. Will be `yes` when a P.O. box is detected, `no` when Plaid confirmed the address is not a P.O. box, and `no_data` when Plaid was not able to determine if the address is a P.O. box. - pub po_box: String, + pub po_box: PoBoxStatus, ///The postal code for the associated address. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. #[serde(default, skip_serializing_if = "Option::is_none")] pub postal_code: Option, ///An ISO 3166-2 subdivision code. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc. #[serde(default, skip_serializing_if = "Option::is_none")] pub region: Option, - ///The primary street portion of an address. If an address is provided, this field will always be filled. + ///The primary street portion of an address. If an address is provided, this field will always be filled. A string with at least one non-whitespace alphabetical character, with a max length of 80 characters. pub street: String, - ///Extra street information, like an apartment or suite number. + ///Extra street information, like an apartment or suite number. If provided, a string with at least one non-whitespace character, with a max length of 50 characters. #[serde(default, skip_serializing_if = "Option::is_none")] pub street2: Option, /**Field describing whether the associated address is being used for commercial or residential purposes. Note: This value will be `no_data` when Plaid does not have sufficient data to determine the address's use.*/ #[serde(rename = "type")] - pub type_: String, + pub type_: AddressPurposeLabel, } impl std::fmt::Display for IdentityVerificationAutofillAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_autofill_create_response.rs b/src/model/identity_verification_autofill_create_response.rs index b1dbd491..ddfb74a2 100644 --- a/src/model/identity_verification_autofill_create_response.rs +++ b/src/model/identity_verification_autofill_create_response.rs @@ -1,12 +1,12 @@ use serde::{Serialize, Deserialize}; -use super::IdentityVerificationAutofillUserData; +use super::{IdentityVerificationAutofillStatus, IdentityVerificationAutofillUserData}; ///Autofill represents unverified customer information. This needs to be confirmed by the customer before using. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationAutofillCreateResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, ///A status enum indicating whether autofill succeeded or failed. - pub status: String, + pub status: IdentityVerificationAutofillStatus, ///User information that was autofilled. All this information should be confirmed by the user before using. #[serde(default, skip_serializing_if = "Option::is_none")] pub user: Option, @@ -15,4 +15,4 @@ impl std::fmt::Display for IdentityVerificationAutofillCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_autofill_status.rs b/src/model/identity_verification_autofill_status.rs new file mode 100644 index 00000000..d6a3c623 --- /dev/null +++ b/src/model/identity_verification_autofill_status.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///A status enum indicating whether autofill succeeded or failed. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IdentityVerificationAutofillStatus { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, +} diff --git a/src/model/identity_verification_autofill_user_data.rs b/src/model/identity_verification_autofill_user_data.rs index 0ce980a1..d1b5ac21 100644 --- a/src/model/identity_verification_autofill_user_data.rs +++ b/src/model/identity_verification_autofill_user_data.rs @@ -4,7 +4,7 @@ use super::{ UserIdNumber, }; ///User information that was autofilled. All this information should be confirmed by the user before using. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationAutofillUserData { /**Even if an address has been autofilled, some fields may be null depending on the region's addressing system. For example: @@ -24,4 +24,4 @@ impl std::fmt::Display for IdentityVerificationAutofillUserData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_create_request_user.rs b/src/model/identity_verification_create_request_user.rs index c62887cd..cf264714 100644 --- a/src/model/identity_verification_create_request_user.rs +++ b/src/model/identity_verification_create_request_user.rs @@ -19,7 +19,7 @@ Each of the following identity fields are optional: Specifically, these fields are optional in that they can either be fully provided (satisfying every required field in their subschema) or omitted from the request entirely by not providing the key or value. Providing these fields via the API will result in Link skipping the data collection process for the associated user. All verification steps enabled in the associated Identity Verification Template will still be run. Verification steps will either be run immediately, or once the user completes the `accept_tos` step, depending on the value provided to the `gave_consent` field. If you are not using the shareable URL feature, you can optionally provide these fields via `/link/token/create` instead; both `/identity_verification/create` and `/link/token/create` are valid ways to provide this information. Note that if you provide a non-`null` user data object via `/identity_verification/create`, any user data fields entered via `/link/token/create` for the same `client_user_id` will be ignored when prefilling Link.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationCreateRequestUser { /**Home address for the user. Supported values are: not provided, address with only country code or full address. @@ -32,7 +32,7 @@ For more context on this field, see [Input Validation by Country](https://plaid. ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub date_of_birth: Option, - ///A valid email address. + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, ///ID number submitted by the user, currently used only for the Identity Verification product. If the user has not submitted this data yet, this field will be `null`. Otherwise, both fields are guaranteed to be filled. @@ -41,7 +41,7 @@ For more context on this field, see [Input Validation by Country](https://plaid. ///You can use this field to pre-populate the user's legal name; if it is provided here, they will not be prompted to enter their name in the identity verification attempt. #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - ///A phone number in E.164 format. + ///A valid phone number in E.164 format. #[serde(default, skip_serializing_if = "Option::is_none")] pub phone_number: Option, } @@ -49,4 +49,4 @@ impl std::fmt::Display for IdentityVerificationCreateRequestUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_create_response.rs b/src/model/identity_verification_create_response.rs index de62c5e7..a14f25c2 100644 --- a/src/model/identity_verification_create_response.rs +++ b/src/model/identity_verification_create_response.rs @@ -1,12 +1,15 @@ use serde::{Serialize, Deserialize}; use super::{ - DocumentaryVerification, IdentityVerificationStepSummary, + DocumentaryVerification, IdentityVerificationStatus, IdentityVerificationStepSummary, IdentityVerificationTemplateReference, IdentityVerificationUserData, KycCheckDetails, - RiskCheckDetails, SelfieCheck, + RiskCheckDetails, SelfieCheck, VerifySmsDetails, }; ///A identity verification attempt represents a customer's attempt to verify their identity, reflecting the required steps for completing the session, the results for each step, and information collected in the process. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationCreateResponse { + ///ID of the associated Beacon User. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beacon_user_id: Option, ///A unique ID that identifies the end user in your system. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. pub client_user_id: String, ///An ISO8601 formatted timestamp. @@ -19,7 +22,7 @@ pub struct IdentityVerificationCreateResponse { pub documentary_verification: Option, ///ID of the associated Identity Verification attempt. pub id: String, - ///Additional information for the `kyc_check` step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. + ///Additional information for the `kyc_check` (Data Source Verification) step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. #[serde(default, skip_serializing_if = "Option::is_none")] pub kyc_check: Option, ///The ID for the Identity Verification preceding this session. This field will only be filled if the current Identity Verification is a retry of a previous attempt. @@ -53,7 +56,7 @@ pub struct IdentityVerificationCreateResponse { `canceled` - The Identity Verification attempt was canceled, either via the dashboard by a user, or via API. The user may have completed part of the session, but has neither failed or passed. `pending_review` - The Identity Verification attempt template was configured to perform a screening that had one or more hits needing review.*/ - pub status: String, + pub status: IdentityVerificationStatus, /**Each step will be one of the following values: @@ -83,6 +86,9 @@ pub struct IdentityVerificationCreateResponse { pub template: IdentityVerificationTemplateReference, ///The identity data that was either collected from the user or provided via API in order to perform an Identity Verification. pub user: IdentityVerificationUserData, + ///Additional information for the `verify_sms` step. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub verify_sms: Option, ///ID of the associated screening. #[serde(default, skip_serializing_if = "Option::is_none")] pub watchlist_screening_id: Option, @@ -91,4 +97,4 @@ impl std::fmt::Display for IdentityVerificationCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_document_address_response.rs b/src/model/identity_verification_document_address_response.rs index 147e4236..ee200657 100644 --- a/src/model/identity_verification_document_address_response.rs +++ b/src/model/identity_verification_document_address_response.rs @@ -27,4 +27,4 @@ impl std::fmt::Display for IdentityVerificationDocumentAddressResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_document_name_response.rs b/src/model/identity_verification_document_name_response.rs new file mode 100644 index 00000000..8d3fc3e5 --- /dev/null +++ b/src/model/identity_verification_document_name_response.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///The individual's name extracted from the document. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IdentityVerificationDocumentNameResponse { + ///A string with at least one non-whitespace character, with a max length of 100 characters. + pub family_name: String, + ///A string with at least one non-whitespace character, with a max length of 100 characters. + pub given_name: String, +} +impl std::fmt::Display for IdentityVerificationDocumentNameResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/identity_verification_get_response.rs b/src/model/identity_verification_get_response.rs index e1c5b4b2..b401f44d 100644 --- a/src/model/identity_verification_get_response.rs +++ b/src/model/identity_verification_get_response.rs @@ -1,12 +1,15 @@ use serde::{Serialize, Deserialize}; use super::{ - DocumentaryVerification, IdentityVerificationStepSummary, + DocumentaryVerification, IdentityVerificationStatus, IdentityVerificationStepSummary, IdentityVerificationTemplateReference, IdentityVerificationUserData, KycCheckDetails, - RiskCheckDetails, SelfieCheck, + RiskCheckDetails, SelfieCheck, VerifySmsDetails, }; ///A identity verification attempt represents a customer's attempt to verify their identity, reflecting the required steps for completing the session, the results for each step, and information collected in the process. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationGetResponse { + ///ID of the associated Beacon User. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beacon_user_id: Option, ///A unique ID that identifies the end user in your system. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. pub client_user_id: String, ///An ISO8601 formatted timestamp. @@ -19,7 +22,7 @@ pub struct IdentityVerificationGetResponse { pub documentary_verification: Option, ///ID of the associated Identity Verification attempt. pub id: String, - ///Additional information for the `kyc_check` step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. + ///Additional information for the `kyc_check` (Data Source Verification) step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. #[serde(default, skip_serializing_if = "Option::is_none")] pub kyc_check: Option, ///The ID for the Identity Verification preceding this session. This field will only be filled if the current Identity Verification is a retry of a previous attempt. @@ -53,7 +56,7 @@ pub struct IdentityVerificationGetResponse { `canceled` - The Identity Verification attempt was canceled, either via the dashboard by a user, or via API. The user may have completed part of the session, but has neither failed or passed. `pending_review` - The Identity Verification attempt template was configured to perform a screening that had one or more hits needing review.*/ - pub status: String, + pub status: IdentityVerificationStatus, /**Each step will be one of the following values: @@ -83,6 +86,9 @@ pub struct IdentityVerificationGetResponse { pub template: IdentityVerificationTemplateReference, ///The identity data that was either collected from the user or provided via API in order to perform an Identity Verification. pub user: IdentityVerificationUserData, + ///Additional information for the `verify_sms` step. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub verify_sms: Option, ///ID of the associated screening. #[serde(default, skip_serializing_if = "Option::is_none")] pub watchlist_screening_id: Option, @@ -91,4 +97,4 @@ impl std::fmt::Display for IdentityVerificationGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_list_response.rs b/src/model/identity_verification_list_response.rs index e5095a4d..339e6826 100644 --- a/src/model/identity_verification_list_response.rs +++ b/src/model/identity_verification_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for IdentityVerificationListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_request_user.rs b/src/model/identity_verification_request_user.rs index e06c8c10..d5e78bfd 100644 --- a/src/model/identity_verification_request_user.rs +++ b/src/model/identity_verification_request_user.rs @@ -18,7 +18,7 @@ Each of the following identity fields are optional: Specifically, these fields are optional in that they can either be fully provided (satisfying every required field in their subschema) or omitted from the request entirely by not providing the key or value. Providing these fields via the API will result in Link skipping the data collection process for the associated user. All verification steps enabled in the associated Identity Verification Template will still be run. Verification steps will either be run immediately, or once the user completes the `accept_tos` step, depending on the value provided to the `gave_consent` field.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationRequestUser { /**Home address for the user. Supported values are: not provided, address with only country code or full address. @@ -28,7 +28,7 @@ For more context on this field, see [Input Validation by Country](https://plaid. ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub date_of_birth: Option, - ///A valid email address. + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, ///ID number submitted by the user, currently used only for the Identity Verification product. If the user has not submitted this data yet, this field will be `null`. Otherwise, both fields are guaranteed to be filled. @@ -37,7 +37,7 @@ For more context on this field, see [Input Validation by Country](https://plaid. ///You can use this field to pre-populate the user's legal name; if it is provided here, they will not be prompted to enter their name in the identity verification attempt. #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - ///A phone number in E.164 format. + ///A valid phone number in E.164 format. #[serde(default, skip_serializing_if = "Option::is_none")] pub phone_number: Option, } @@ -45,4 +45,4 @@ impl std::fmt::Display for IdentityVerificationRequestUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_request_user_name.rs b/src/model/identity_verification_request_user_name.rs index 11c5d874..92839f56 100644 --- a/src/model/identity_verification_request_user_name.rs +++ b/src/model/identity_verification_request_user_name.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for IdentityVerificationRequestUserName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_response_user_name.rs b/src/model/identity_verification_response_user_name.rs index 2041cdec..29afabad 100644 --- a/src/model/identity_verification_response_user_name.rs +++ b/src/model/identity_verification_response_user_name.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for IdentityVerificationResponseUserName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_retried_webhook.rs b/src/model/identity_verification_retried_webhook.rs index 346d24b9..0496c2fa 100644 --- a/src/model/identity_verification_retried_webhook.rs +++ b/src/model/identity_verification_retried_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when identity verification has been retried, which can be triggered via the dashboard or the API. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationRetriedWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The ID of the associated Identity Verification attempt. pub identity_verification_id: String, ///`RETRIED` @@ -15,4 +16,4 @@ impl std::fmt::Display for IdentityVerificationRetriedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_retry_request_steps_object.rs b/src/model/identity_verification_retry_request_steps_object.rs index 33577d54..2dd89c2f 100644 --- a/src/model/identity_verification_retry_request_steps_object.rs +++ b/src/model/identity_verification_retry_request_steps_object.rs @@ -14,7 +14,7 @@ The `selfie_check` step is currently not supported on the sandbox server. Sandbo pub struct IdentityVerificationRetryRequestStepsObject { ///A boolean field specifying whether the new session should require or skip the `documentary_verification` step. pub documentary_verification: bool, - ///A boolean field specifying whether the new session should require or skip the `kyc_check` step. + ///A boolean field specifying whether the new session should require or skip the `kyc_check` (Data Source Verification) step. pub kyc_check: bool, ///A boolean field specifying whether the new session should require or skip the `selfie_check` step. pub selfie_check: bool, @@ -25,4 +25,4 @@ impl std::fmt::Display for IdentityVerificationRetryRequestStepsObject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_retry_response.rs b/src/model/identity_verification_retry_response.rs index eceb773e..a13020a5 100644 --- a/src/model/identity_verification_retry_response.rs +++ b/src/model/identity_verification_retry_response.rs @@ -1,12 +1,15 @@ use serde::{Serialize, Deserialize}; use super::{ - DocumentaryVerification, IdentityVerificationStepSummary, + DocumentaryVerification, IdentityVerificationStatus, IdentityVerificationStepSummary, IdentityVerificationTemplateReference, IdentityVerificationUserData, KycCheckDetails, - RiskCheckDetails, SelfieCheck, + RiskCheckDetails, SelfieCheck, VerifySmsDetails, }; ///A identity verification attempt represents a customer's attempt to verify their identity, reflecting the required steps for completing the session, the results for each step, and information collected in the process. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationRetryResponse { + ///ID of the associated Beacon User. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub beacon_user_id: Option, ///A unique ID that identifies the end user in your system. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. pub client_user_id: String, ///An ISO8601 formatted timestamp. @@ -19,7 +22,7 @@ pub struct IdentityVerificationRetryResponse { pub documentary_verification: Option, ///ID of the associated Identity Verification attempt. pub id: String, - ///Additional information for the `kyc_check` step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. + ///Additional information for the `kyc_check` (Data Source Verification) step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. #[serde(default, skip_serializing_if = "Option::is_none")] pub kyc_check: Option, ///The ID for the Identity Verification preceding this session. This field will only be filled if the current Identity Verification is a retry of a previous attempt. @@ -53,7 +56,7 @@ pub struct IdentityVerificationRetryResponse { `canceled` - The Identity Verification attempt was canceled, either via the dashboard by a user, or via API. The user may have completed part of the session, but has neither failed or passed. `pending_review` - The Identity Verification attempt template was configured to perform a screening that had one or more hits needing review.*/ - pub status: String, + pub status: IdentityVerificationStatus, /**Each step will be one of the following values: @@ -83,6 +86,9 @@ pub struct IdentityVerificationRetryResponse { pub template: IdentityVerificationTemplateReference, ///The identity data that was either collected from the user or provided via API in order to perform an Identity Verification. pub user: IdentityVerificationUserData, + ///Additional information for the `verify_sms` step. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub verify_sms: Option, ///ID of the associated screening. #[serde(default, skip_serializing_if = "Option::is_none")] pub watchlist_screening_id: Option, @@ -91,4 +97,4 @@ impl std::fmt::Display for IdentityVerificationRetryResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_status.rs b/src/model/identity_verification_status.rs new file mode 100644 index 00000000..0066f55e --- /dev/null +++ b/src/model/identity_verification_status.rs @@ -0,0 +1,30 @@ +use serde::{Serialize, Deserialize}; +/**The status of this Identity Verification attempt. + + +`active` - The Identity Verification attempt is incomplete. The user may have completed part of the session, but has neither failed or passed. + +`success` - The Identity Verification attempt has completed, passing all steps defined to the associated Identity Verification template + +`failed` - The user failed one or more steps in the session and was told to contact support. + +`expired` - The Identity Verification attempt was active for a long period of time without being completed and was automatically marked as expired. Note that sessions currently do not expire. Automatic expiration is expected to be enabled in the future. + +`canceled` - The Identity Verification attempt was canceled, either via the dashboard by a user, or via API. The user may have completed part of the session, but has neither failed or passed. + +`pending_review` - The Identity Verification attempt template was configured to perform a screening that had one or more hits needing review.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IdentityVerificationStatus { + #[serde(rename = "active")] + Active, + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "expired")] + Expired, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "pending_review")] + PendingReview, +} diff --git a/src/model/identity_verification_status_updated_webhook.rs b/src/model/identity_verification_status_updated_webhook.rs index e1089abc..550c34f7 100644 --- a/src/model/identity_verification_status_updated_webhook.rs +++ b/src/model/identity_verification_status_updated_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when the status of an identity verification has been updated, which can be triggered via the dashboard or the API. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationStatusUpdatedWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The ID of the associated Identity Verification attempt. pub identity_verification_id: String, ///`STATUS_UPDATED` @@ -15,4 +16,4 @@ impl std::fmt::Display for IdentityVerificationStatusUpdatedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_step_status.rs b/src/model/identity_verification_step_status.rs new file mode 100644 index 00000000..cefa8486 --- /dev/null +++ b/src/model/identity_verification_step_status.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +///The status of a step in the Identity Verification process. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IdentityVerificationStepStatus { + #[serde(rename = "success")] + Success, + #[serde(rename = "active")] + Active, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "waiting_for_prerequisite")] + WaitingForPrerequisite, + #[serde(rename = "not_applicable")] + NotApplicable, + #[serde(rename = "skipped")] + Skipped, + #[serde(rename = "expired")] + Expired, + #[serde(rename = "canceled")] + Canceled, + #[serde(rename = "pending_review")] + PendingReview, + #[serde(rename = "manually_approved")] + ManuallyApproved, + #[serde(rename = "manually_rejected")] + ManuallyRejected, +} diff --git a/src/model/identity_verification_step_summary.rs b/src/model/identity_verification_step_summary.rs index e8cfef1e..573dfc62 100644 --- a/src/model/identity_verification_step_summary.rs +++ b/src/model/identity_verification_step_summary.rs @@ -1,4 +1,5 @@ use serde::{Serialize, Deserialize}; +use super::IdentityVerificationStepStatus; /**Each step will be one of the following values: @@ -23,25 +24,25 @@ use serde::{Serialize, Deserialize}; `manually_approved` - The step was manually overridden to pass by a team member in the dashboard. `manually_rejected` - The step was manually overridden to fail by a team member in the dashboard.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationStepSummary { ///The status of a step in the Identity Verification process. - pub accept_tos: String, + pub accept_tos: IdentityVerificationStepStatus, ///The status of a step in the Identity Verification process. - pub documentary_verification: String, + pub documentary_verification: IdentityVerificationStepStatus, ///The status of a step in the Identity Verification process. - pub kyc_check: String, + pub kyc_check: IdentityVerificationStepStatus, ///The status of a step in the Identity Verification process. - pub risk_check: String, + pub risk_check: IdentityVerificationStepStatus, ///The status of a step in the Identity Verification process. - pub selfie_check: String, + pub selfie_check: IdentityVerificationStepStatus, ///The status of a step in the Identity Verification process. - pub verify_sms: String, + pub verify_sms: IdentityVerificationStepStatus, ///The status of a step in the Identity Verification process. - pub watchlist_screening: String, + pub watchlist_screening: IdentityVerificationStepStatus, } impl std::fmt::Display for IdentityVerificationStepSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_step_updated_webhook.rs b/src/model/identity_verification_step_updated_webhook.rs index 18fb46fb..0e687fe1 100644 --- a/src/model/identity_verification_step_updated_webhook.rs +++ b/src/model/identity_verification_step_updated_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when an end user has completed a step of the Identity Verification process. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationStepUpdatedWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The ID of the associated Identity Verification attempt. pub identity_verification_id: String, ///`STEP_UPDATED` @@ -15,4 +16,4 @@ impl std::fmt::Display for IdentityVerificationStepUpdatedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_template_reference.rs b/src/model/identity_verification_template_reference.rs index 160b1ff2..fbff2ba7 100644 --- a/src/model/identity_verification_template_reference.rs +++ b/src/model/identity_verification_template_reference.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for IdentityVerificationTemplateReference { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_user_address.rs b/src/model/identity_verification_user_address.rs index f0658d51..ad07850a 100644 --- a/src/model/identity_verification_user_address.rs +++ b/src/model/identity_verification_user_address.rs @@ -6,7 +6,7 @@ Addresses from the United Kingdom will not include a region Addresses from Hong Kong will not include postal code*/ #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct IdentityVerificationUserAddress { - ///City from the end user's address + ///City from the end user's address. A string with at least one non-whitespace alphabetical character, with a max length of 100 characters." #[serde(default, skip_serializing_if = "Option::is_none")] pub city: Option, ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. @@ -17,10 +17,10 @@ pub struct IdentityVerificationUserAddress { ///An ISO 3166-2 subdivision code. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc. #[serde(default, skip_serializing_if = "Option::is_none")] pub region: Option, - ///The primary street portion of an address. If an address is provided, this field will always be filled. + ///The primary street portion of an address. If an address is provided, this field will always be filled. A string with at least one non-whitespace alphabetical character, with a max length of 80 characters. #[serde(default, skip_serializing_if = "Option::is_none")] pub street: Option, - ///Extra street information, like an apartment or suite number. + ///Extra street information, like an apartment or suite number. If provided, a string with at least one non-whitespace character, with a max length of 50 characters. #[serde(default, skip_serializing_if = "Option::is_none")] pub street2: Option, } @@ -28,4 +28,4 @@ impl std::fmt::Display for IdentityVerificationUserAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_verification_user_data.rs b/src/model/identity_verification_user_data.rs index 84a35f43..a5740109 100644 --- a/src/model/identity_verification_user_data.rs +++ b/src/model/identity_verification_user_data.rs @@ -3,7 +3,7 @@ use super::{ IdentityVerificationResponseUserName, IdentityVerificationUserAddress, UserIdNumber, }; ///The identity data that was either collected from the user or provided via API in order to perform an Identity Verification. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationUserData { /**Even if an address has been collected, some fields may be null depending on the region's addressing system. For example: @@ -15,7 +15,7 @@ Addresses from Hong Kong will not include postal code*/ ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub date_of_birth: Option, - ///A valid email address. + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, ///ID number submitted by the user, currently used only for the Identity Verification product. If the user has not submitted this data yet, this field will be `null`. Otherwise, both fields are guaranteed to be filled. @@ -27,7 +27,7 @@ Addresses from Hong Kong will not include postal code*/ ///The full name provided by the user. If the user has not submitted their name, this field will be null. Otherwise, both fields are guaranteed to be filled. #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - ///A phone number in E.164 format. + ///A valid phone number in E.164 format. #[serde(default, skip_serializing_if = "Option::is_none")] pub phone_number: Option, } @@ -35,4 +35,4 @@ impl std::fmt::Display for IdentityVerificationUserData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/image_quality.rs b/src/model/image_quality.rs new file mode 100644 index 00000000..aeeb34a7 --- /dev/null +++ b/src/model/image_quality.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +/**A high level description of the quality of the image the user submitted. + +For example, an image that is blurry, distorted by glare from a nearby light source, or improperly framed might be marked as low or medium quality. Poor quality images are more likely to fail OCR and/or template conformity checks. + +Note: By default, Plaid will let a user recapture document images twice before failing the entire session if we attribute the failure to low image quality.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ImageQuality { + #[serde(rename = "high")] + High, + #[serde(rename = "medium")] + Medium, + #[serde(rename = "low")] + Low, +} diff --git a/src/model/incident_update.rs b/src/model/incident_update.rs index 9576701c..36fe837e 100644 --- a/src/model/incident_update.rs +++ b/src/model/incident_update.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for IncidentUpdate { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_breakdown.rs b/src/model/income_breakdown.rs index ebf8902a..f65e261e 100644 --- a/src/model/income_breakdown.rs +++ b/src/model/income_breakdown.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for IncomeBreakdown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_breakdown_type.rs b/src/model/income_breakdown_type.rs index 0fcb3a9f..250e1c18 100644 --- a/src/model/income_breakdown_type.rs +++ b/src/model/income_breakdown_type.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct IncomeBreakdownType(pub serde_json::Value); \ No newline at end of file +pub struct IncomeBreakdownType(pub serde_json::Value); diff --git a/src/model/income_override.rs b/src/model/income_override.rs index 353c40ef..916294f0 100644 --- a/src/model/income_override.rs +++ b/src/model/income_override.rs @@ -1,14 +1,18 @@ use serde::{Serialize, Deserialize}; -use super::PaystubOverride; +use super::{PaystubOverride, W2Override}; ///Specify payroll data on the account. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct IncomeOverride { ///A list of paystubs associated with the account. #[serde(default, skip_serializing_if = "Option::is_none")] pub paystubs: Option>, + ///A list of w2s associated with the account. + #[serde(rename = "w2s")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub w2_s: Option>, } impl std::fmt::Display for IncomeOverride { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_sources_counts.rs b/src/model/income_sources_counts.rs new file mode 100644 index 00000000..ffdc9b3e --- /dev/null +++ b/src/model/income_sources_counts.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///Details about the number of income sources +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IncomeSourcesCounts { + ///The number of income sources detected at the subscription date + pub baseline_count: f64, + ///The number of income sources currently detected + pub current_count: f64, +} +impl std::fmt::Display for IncomeSourcesCounts { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/income_summary_field_number.rs b/src/model/income_summary_field_number.rs index 3562bc44..0e62aa65 100644 --- a/src/model/income_summary_field_number.rs +++ b/src/model/income_summary_field_number.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::VerificationStatus; ///Field number for income summary -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IncomeSummaryFieldNumber { ///The value of the field. pub value: f64, @@ -15,10 +16,10 @@ pub struct IncomeSummaryFieldNumber { "`UNABLE_TO_VERIFY`": The verification was performed and the information could not be verified. `"UNKNOWN"`: The verification status is unknown.*/ - pub verification_status: String, + pub verification_status: VerificationStatus, } impl std::fmt::Display for IncomeSummaryFieldNumber { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_summary_field_string.rs b/src/model/income_summary_field_string.rs index be1a374b..dcba4a20 100644 --- a/src/model/income_summary_field_string.rs +++ b/src/model/income_summary_field_string.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::VerificationStatus; ///Data about the income summary -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IncomeSummaryFieldString { ///The value of the field. pub value: String, @@ -15,10 +16,10 @@ pub struct IncomeSummaryFieldString { "`UNABLE_TO_VERIFY`": The verification was performed and the information could not be verified. `"UNKNOWN"`: The verification status is unknown.*/ - pub verification_status: String, + pub verification_status: VerificationStatus, } impl std::fmt::Display for IncomeSummaryFieldString { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_create_request_options.rs b/src/model/income_verification_create_request_options.rs index 0ac223bf..433f6176 100644 --- a/src/model/income_verification_create_request_options.rs +++ b/src/model/income_verification_create_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for IncomeVerificationCreateRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_create_response.rs b/src/model/income_verification_create_response.rs index 2455ffb1..eeaa2bc4 100644 --- a/src/model/income_verification_create_response.rs +++ b/src/model/income_verification_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for IncomeVerificationCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_doc_parsing_config.rs b/src/model/income_verification_doc_parsing_config.rs new file mode 100644 index 00000000..4481dea2 --- /dev/null +++ b/src/model/income_verification_doc_parsing_config.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///Analysis options to enable for document parsing +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IncomeVerificationDocParsingConfig { + #[serde(rename = "ocr")] + Ocr, + #[serde(rename = "risk_signals")] + RiskSignals, +} diff --git a/src/model/income_verification_payroll_flow_type.rs b/src/model/income_verification_payroll_flow_type.rs new file mode 100644 index 00000000..1e3d1574 --- /dev/null +++ b/src/model/income_verification_payroll_flow_type.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///Flow types to retrieve payroll income data +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IncomeVerificationPayrollFlowType { + #[serde(rename = "payroll_digital_income")] + PayrollDigitalIncome, + #[serde(rename = "payroll_document_income")] + PayrollDocumentIncome, +} diff --git a/src/model/income_verification_paystubs_get_response.rs b/src/model/income_verification_paystubs_get_response.rs index 057cb1ff..563605fc 100644 --- a/src/model/income_verification_paystubs_get_response.rs +++ b/src/model/income_verification_paystubs_get_response.rs @@ -1,12 +1,12 @@ use serde::{Serialize, Deserialize}; use super::{DocumentMetadata, Paystub, PlaidError}; ///IncomeVerificationPaystubsGetResponse defines the response schema for `/income/verification/paystubs/get`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IncomeVerificationPaystubsGetResponse { ///Metadata for an income document. #[serde(default, skip_serializing_if = "Option::is_none")] pub document_metadata: Option>, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -18,4 +18,4 @@ impl std::fmt::Display for IncomeVerificationPaystubsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_precheck_confidence.rs b/src/model/income_verification_precheck_confidence.rs new file mode 100644 index 00000000..fd75ace6 --- /dev/null +++ b/src/model/income_verification_precheck_confidence.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**The confidence that Plaid can support the user in the digital income verification flow instead of requiring a manual paystub upload. One of the following: + +`"HIGH"`: It is very likely that this user can use the digital income verification flow. + +"`LOW`": It is unlikely that this user can use the digital income verification flow. + +`"UNKNOWN"`: It was not possible to determine if the user is supportable with the information passed.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IncomeVerificationPrecheckConfidence { + #[serde(rename = "HIGH")] + High, + #[serde(rename = "LOW")] + Low, + #[serde(rename = "UNKNOWN")] + Unknown, +} diff --git a/src/model/income_verification_precheck_employer.rs b/src/model/income_verification_precheck_employer.rs index 3eef811c..459f3f15 100644 --- a/src/model/income_verification_precheck_employer.rs +++ b/src/model/income_verification_precheck_employer.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for IncomeVerificationPrecheckEmployer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_precheck_employer_address.rs b/src/model/income_verification_precheck_employer_address.rs index 536850c8..9b028b5a 100644 --- a/src/model/income_verification_precheck_employer_address.rs +++ b/src/model/income_verification_precheck_employer_address.rs @@ -6,4 +6,4 @@ impl std::fmt::Display for IncomeVerificationPrecheckEmployerAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_precheck_military_info.rs b/src/model/income_verification_precheck_military_info.rs index ba16fc44..fb9526aa 100644 --- a/src/model/income_verification_precheck_military_info.rs +++ b/src/model/income_verification_precheck_military_info.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for IncomeVerificationPrecheckMilitaryInfo { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_precheck_payroll_institution.rs b/src/model/income_verification_precheck_payroll_institution.rs index 1f39b199..95a3d01a 100644 --- a/src/model/income_verification_precheck_payroll_institution.rs +++ b/src/model/income_verification_precheck_payroll_institution.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for IncomeVerificationPrecheckPayrollInstitution { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_precheck_response.rs b/src/model/income_verification_precheck_response.rs index 744a1a58..672cf207 100644 --- a/src/model/income_verification_precheck_response.rs +++ b/src/model/income_verification_precheck_response.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::IncomeVerificationPrecheckConfidence; ///IncomeVerificationPrecheckResponse defines the response schema for `/income/verification/precheck`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IncomeVerificationPrecheckResponse { /**The confidence that Plaid can support the user in the digital income verification flow instead of requiring a manual paystub upload. One of the following: @@ -9,7 +10,7 @@ pub struct IncomeVerificationPrecheckResponse { "`LOW`": It is unlikely that this user can use the digital income verification flow. `"UNKNOWN"`: It was not possible to determine if the user is supportable with the information passed.*/ - pub confidence: String, + pub confidence: IncomeVerificationPrecheckConfidence, ///ID of the precheck. Provide this value when calling `/link/token/create` in order to optimize Link conversion. pub precheck_id: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -19,4 +20,4 @@ impl std::fmt::Display for IncomeVerificationPrecheckResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_precheck_user.rs b/src/model/income_verification_precheck_user.rs index fbf60a00..2cf7d98b 100644 --- a/src/model/income_verification_precheck_user.rs +++ b/src/model/income_verification_precheck_user.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for IncomeVerificationPrecheckUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_refresh_reconnect_needed_webhook.rs b/src/model/income_verification_refresh_reconnect_needed_webhook.rs index 8ad66ffa..15c8388c 100644 --- a/src/model/income_verification_refresh_reconnect_needed_webhook.rs +++ b/src/model/income_verification_refresh_reconnect_needed_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when the attempt to refresh Payroll Income data for a user via `/credit/payroll_income/refresh` failed because the user must re-connect their payroll account. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IncomeVerificationRefreshReconnectNeededWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The `user_id` corresponding to the user the webhook has fired for. pub user_id: String, ///`INCOME_VERIFICATION_REFRESH_RECONNECT_NEEDED` @@ -15,4 +16,4 @@ impl std::fmt::Display for IncomeVerificationRefreshReconnectNeededWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_risk_signals_status_webhook.rs b/src/model/income_verification_risk_signals_status_webhook.rs index f60e2f98..1b39587a 100644 --- a/src/model/income_verification_risk_signals_status_webhook.rs +++ b/src/model/income_verification_risk_signals_status_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when risk signals have been processed for documents uploaded via Document Income. It will typically take a minute or two for this webhook to fire after the end user has uploaded their documents in the Document Income flow. Once this webhook has fired, `/credit/payroll_income/risk_signals/get` may then be called to determine whether the documents were successfully processed and to retrieve risk data. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IncomeVerificationRiskSignalsStatusWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The Item ID associated with the verification. pub item_id: String, ///`RISK_SIGNALS_PROCESSING_COMPLETE`: The income verification fraud detection processing has completed. If the user uploaded multiple documents, this webhook will fire when all documents have finished processing. Call the `/credit/payroll_income/risk_signals/get` endpoint to get all risk signal data. @@ -21,4 +22,4 @@ impl std::fmt::Display for IncomeVerificationRiskSignalsStatusWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_source_type.rs b/src/model/income_verification_source_type.rs new file mode 100644 index 00000000..ccf4c77d --- /dev/null +++ b/src/model/income_verification_source_type.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The types of source income data that users should be able to share +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IncomeVerificationSourceType { + #[serde(rename = "bank")] + Bank, + #[serde(rename = "payroll")] + Payroll, +} diff --git a/src/model/income_verification_status_webhook.rs b/src/model/income_verification_status_webhook.rs index ec2a5bff..0af02b65 100644 --- a/src/model/income_verification_status_webhook.rs +++ b/src/model/income_verification_status_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; -///Fired when the status of an income verification instance has changed. It will typically take several minutes for this webhook to fire after the end user has uploaded their documents in the Document Income flow. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::WebhookEnvironmentValues; +///Fired when the status of an income verification instance has changed. This webhook is fired for both the Document and Payroll Income flows, but not the Bank Income flow. It will typically take several minutes for this webhook to fire after the end user has uploaded their documents in the Document Income flow. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IncomeVerificationStatusWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The Item ID associated with the verification. pub item_id: String, ///The Plaid `user_id` of the User associated with this webhook, warning, or error. @@ -24,4 +25,4 @@ impl std::fmt::Display for IncomeVerificationStatusWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/income_verification_taxforms_get_response.rs b/src/model/income_verification_taxforms_get_response.rs index 914b7e0d..29a1f467 100644 --- a/src/model/income_verification_taxforms_get_response.rs +++ b/src/model/income_verification_taxforms_get_response.rs @@ -1,11 +1,11 @@ use serde::{Serialize, Deserialize}; use super::{DocumentMetadata, PlaidError, Taxform}; ///IncomeVerificationTaxformsGetResponse defines the response schema for `/income/verification/taxforms/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IncomeVerificationTaxformsGetResponse { #[serde(default, skip_serializing_if = "Vec::is_empty")] pub document_metadata: Vec, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -19,4 +19,4 @@ impl std::fmt::Display for IncomeVerificationTaxformsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/individual_name.rs b/src/model/individual_name.rs index dec26cda..282a70d8 100644 --- a/src/model/individual_name.rs +++ b/src/model/individual_name.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for IndividualName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/individual_screening_hit_names.rs b/src/model/individual_screening_hit_names.rs index cafddde2..7727b6ad 100644 --- a/src/model/individual_screening_hit_names.rs +++ b/src/model/individual_screening_hit_names.rs @@ -1,16 +1,17 @@ use serde::{Serialize, Deserialize}; +use super::WeakAliasDetermination; ///Name information for the associated individual watchlist hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IndividualScreeningHitNames { ///The full name of the individual, including all parts. pub full: String, ///Primary names are those most commonly used to refer to this person. Only one name will ever be marked as primary. pub is_primary: bool, ///Names that are explicitly marked as low quality either by their `source` list, or by `plaid` by a series of additional checks done by Plaid. Plaid does not ever surface a hit as a result of a weak name alone. If a name has no quality issues, this value will be `none`. - pub weak_alias_determination: String, + pub weak_alias_determination: WeakAliasDetermination, } impl std::fmt::Display for IndividualScreeningHitNames { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/individual_watchlist_code.rs b/src/model/individual_watchlist_code.rs new file mode 100644 index 00000000..2cc379d0 --- /dev/null +++ b/src/model/individual_watchlist_code.rs @@ -0,0 +1,76 @@ +use serde::{Serialize, Deserialize}; +/**Shorthand identifier for a specific screening list for individuals. + `AU_CON`: Australia Department of Foreign Affairs and Trade Consolidated List + `CA_CON`: Government of Canada Consolidated List of Sanctions + `EU_CON`: European External Action Service Consolidated List + `IZ_CIA`: CIA List of Chiefs of State and Cabinet Members + `IZ_IPL`: Interpol Red Notices for Wanted Persons List + `IZ_PEP`: Politically Exposed Persons List + `IZ_UNC`: United Nations Consolidated Sanctions + `IZ_WBK`: World Bank Listing of Ineligible Firms and Individuals + `UK_HMC`: UK HM Treasury Consolidated List + `US_DPL`: Bureau of Industry and Security Denied Persons List + `US_DTC`: US Department of State AECA Debarred + `US_FBI`: US Department of Justice FBI Wanted List + `US_FSE`: US OFAC Foreign Sanctions Evaders + `US_ISN`: US Department of State Nonproliferation Sanctions + `US_PLC`: US OFAC Palestinian Legislative Council + `US_SDN`: US OFAC Specially Designated Nationals List + `US_SSI`: US OFAC Sectoral Sanctions Identifications + `SG_SOF`: Government of Singapore Terrorists and Terrorist Entities + `TR_TWL`: Government of Turkey Terrorist Wanted List + `TR_DFD`: Government of Turkey Domestic Freezing Decisions + `TR_FOR`: Government of Turkey Foreign Freezing Requests + `TR_WMD`: Government of Turkey Weapons of Mass Destruction + `TR_CMB`: Government of Turkey Capital Markets Board*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IndividualWatchlistCode { + #[serde(rename = "AU_CON")] + AuCon, + #[serde(rename = "CA_CON")] + CaCon, + #[serde(rename = "EU_CON")] + EuCon, + #[serde(rename = "IZ_CIA")] + IzCia, + #[serde(rename = "IZ_IPL")] + IzIpl, + #[serde(rename = "IZ_PEP")] + IzPep, + #[serde(rename = "IZ_UNC")] + IzUnc, + #[serde(rename = "IZ_WBK")] + IzWbk, + #[serde(rename = "UK_HMC")] + UkHmc, + #[serde(rename = "US_DPL")] + UsDpl, + #[serde(rename = "US_DTC")] + UsDtc, + #[serde(rename = "US_FBI")] + UsFbi, + #[serde(rename = "US_FSE")] + UsFse, + #[serde(rename = "US_ISN")] + UsIsn, + #[serde(rename = "US_MBS")] + UsMbs, + #[serde(rename = "US_PLC")] + UsPlc, + #[serde(rename = "US_SDN")] + UsSdn, + #[serde(rename = "US_SSI")] + UsSsi, + #[serde(rename = "SG_SOF")] + SgSof, + #[serde(rename = "TR_TWL")] + TrTwl, + #[serde(rename = "TR_DFD")] + TrDfd, + #[serde(rename = "TR_FOR")] + TrFor, + #[serde(rename = "TR_WMD")] + TrWmd, + #[serde(rename = "TR_CMB")] + TrCmb, +} diff --git a/src/model/individual_watchlist_program.rs b/src/model/individual_watchlist_program.rs index cf342f9b..bacb7349 100644 --- a/src/model/individual_watchlist_program.rs +++ b/src/model/individual_watchlist_program.rs @@ -1,7 +1,9 @@ use serde::{Serialize, Deserialize}; -use super::WatchlistScreeningAuditTrail; +use super::{ + IndividualWatchlistCode, ProgramNameSensitivity, WatchlistScreeningAuditTrail, +}; ///A program that configures the active lists, search parameters, and other behavior for initial and ongoing screening of individuals. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct IndividualWatchlistProgram { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: WatchlistScreeningAuditTrail, @@ -15,7 +17,7 @@ pub struct IndividualWatchlistProgram { pub is_rescanning_enabled: bool, ///Watchlists enabled for the associated program #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub lists_enabled: Vec, + pub lists_enabled: Vec, ///A name for the program to define its purpose. For example, "High Risk Individuals", "US Cardholders", or "Applicants". pub name: String, /**The valid name matching sensitivity configurations for a screening program. Note that while certain matching techniques may be more prevalent on less strict settings, all matching algorithms are enabled for every sensitivity. @@ -27,10 +29,10 @@ pub struct IndividualWatchlistProgram { `strict` - Aggressive false positive reduction. This sensitivity will require names to be more similar than `coarse` and `balanced` settings, relying less on phonetics, while still accounting for character transpositions, missing tokens, and other common permutations. `exact` - Matches must be nearly exact. This sensitivity will only show hits with exact or nearly exact name matches with only basic correction such as extraneous symbols and capitalization. This setting is generally not recommended unless you have a very specific use case.*/ - pub name_sensitivity: String, + pub name_sensitivity: ProgramNameSensitivity, } impl std::fmt::Display for IndividualWatchlistProgram { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/inflow_model.rs b/src/model/inflow_model.rs index d67fa7b6..79090374 100644 --- a/src/model/inflow_model.rs +++ b/src/model/inflow_model.rs @@ -26,4 +26,4 @@ impl std::fmt::Display for InflowModel { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/initial_update_webhook.rs b/src/model/initial_update_webhook.rs index 24b0f1ff..01df5de8 100644 --- a/src/model/initial_update_webhook.rs +++ b/src/model/initial_update_webhook.rs @@ -1,17 +1,18 @@ use serde::{Serialize, Deserialize}; -/**Fired when an Item's initial transaction pull is completed. Once this webhook has been fired, transaction data for the most recent 30 days can be fetched for the Item. If [Account Select v2](https://plaid.com/docs/link/customization/#account-select) is enabled, this webhook will also be fired if account selections for the Item are updated, with `new_transactions` set to the number of net new transactions pulled after the account selection update. +use super::WebhookEnvironmentValues; +/**Fired when an Item's initial transaction pull is completed. Once this webhook has been fired, transaction data for the most recent 30 days can be fetched for the Item. This webhook will also be fired if account selections for the Item are updated, with `new_transactions` set to the number of net new transactions pulled after the account selection update. This webhook is intended for use with `/transactions/get`; if you are using the newer `/transactions/sync` endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the `SYNC_UPDATES_AVAILABLE` webhook instead.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct InitialUpdateWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The error code associated with the webhook. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error pub item_id: String, - ///The number of new, unfetched transactions available. + ///The number of new transactions available. pub new_transactions: f64, ///`INITIAL_UPDATE` pub webhook_code: String, @@ -22,4 +23,4 @@ impl std::fmt::Display for InitialUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institution.rs b/src/model/institution.rs index cf52e7b3..194232c8 100644 --- a/src/model/institution.rs +++ b/src/model/institution.rs @@ -1,5 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{AuthMetadata, InstitutionStatus, PaymentInitiationMetadata}; +use super::{ + AuthMetadata, CountryCode, InstitutionStatus, PaymentInitiationMetadata, Products, +}; ///Details relating to a specific financial institution #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct Institution { @@ -8,7 +10,7 @@ pub struct Institution { pub auth_metadata: Option, ///A list of the country codes supported by the institution. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub country_codes: Vec, + pub country_codes: Vec, ///A partial list of DTC numbers associated with the institution. #[serde(default, skip_serializing_if = "Option::is_none")] pub dtc_numbers: Option>, @@ -27,10 +29,10 @@ pub struct Institution { ///Hexadecimal representation of the primary color used by the institution #[serde(default, skip_serializing_if = "Option::is_none")] pub primary_color: Option, - ///A list of the Plaid products supported by the institution. Note that only institutions that support Instant Auth will return `auth` in the product array; institutions that do not list `auth` may still support other Auth methods such as Instant Match or Automated Micro-deposit Verification. To identify institutions that support those methods, use the `auth_metadata` object. For more details, see [Full Auth coverage](https://plaid.com/docs/auth/coverage/). + ///A list of the Plaid products supported by the institution. Note that only institutions that support Instant Auth will return `auth` in the product array; institutions that do not list `auth` may still support other Auth methods such as Instant Match or Automated Micro-deposit Verification. To identify institutions that support those methods, use the `auth_metadata` object. For more details, see [Full Auth coverage](https://plaid.com/docs/auth/coverage/). The `income_verification` product here indicates support for Bank Income. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub products: Vec, - ///A partial list of routing numbers associated with the institution. This list is provided for the purpose of looking up institutions by routing number. It is not comprehensive and should never be used as a complete list of routing numbers for an institution. + pub products: Vec, + ///A list of routing numbers known to be associated with the institution. This list is provided for the purpose of looking up institutions by routing number. It is generally comprehensive but is not guaranteed to be a complete list of routing numbers for an institution. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub routing_numbers: Vec, /**The status of an institution is determined by the health of its Item logins, Transactions updates, Investments updates, Liabilities updates, Auth requests, Balance requests, Identity requests, Investments requests, and Liabilities requests. A login attempt is conducted during the initial Item add in Link. If there is not enough traffic to accurately calculate an institution's status, Plaid will return null rather than potentially inaccurate data. @@ -46,4 +48,4 @@ impl std::fmt::Display for Institution { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institution_status.rs b/src/model/institution_status.rs index 2bd7fecd..6eccfa4b 100644 --- a/src/model/institution_status.rs +++ b/src/model/institution_status.rs @@ -37,4 +37,4 @@ impl std::fmt::Display for InstitutionStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institution_status_alert_webhook.rs b/src/model/institution_status_alert_webhook.rs index dab04b5c..8c8f6739 100644 --- a/src/model/institution_status_alert_webhook.rs +++ b/src/model/institution_status_alert_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when institution status meets the conditions configured in the developer dashboard. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct InstitutionStatusAlertWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The ID of the associated institution. pub institution_id: String, ///The global success rate of the institution, calculated based on item add health. @@ -17,4 +18,4 @@ impl std::fmt::Display for InstitutionStatusAlertWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institution_supported_networks.rs b/src/model/institution_supported_networks.rs index 9597ee01..bcd0392d 100644 --- a/src/model/institution_supported_networks.rs +++ b/src/model/institution_supported_networks.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for InstitutionSupportedNetworks { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institutions_get_by_id_request_options.rs b/src/model/institutions_get_by_id_request_options.rs index ce081f65..6efad6bb 100644 --- a/src/model/institutions_get_by_id_request_options.rs +++ b/src/model/institutions_get_by_id_request_options.rs @@ -21,4 +21,4 @@ impl std::fmt::Display for InstitutionsGetByIdRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institutions_get_by_id_response.rs b/src/model/institutions_get_by_id_response.rs index 3df1831d..95425b45 100644 --- a/src/model/institutions_get_by_id_response.rs +++ b/src/model/institutions_get_by_id_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for InstitutionsGetByIdResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institutions_get_request_options.rs b/src/model/institutions_get_request_options.rs index 23dadcd4..d63342a2 100644 --- a/src/model/institutions_get_request_options.rs +++ b/src/model/institutions_get_request_options.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::Products; ///An optional object to filter `/institutions/get` results. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct InstitutionsGetRequestOptions { ///When `true`, returns metadata related to the Auth product indicating which auth methods are supported. #[serde(default, skip_serializing_if = "Option::is_none")] pub include_auth_metadata: Option, - /**When `true`, return the institution's homepage URL, logo and primary brand color. + /**When `true`, return the institution's homepage URL, logo and primary brand color. Not all institutions' logos are available. Note that Plaid does not own any of the logos shared by the API, and that by accessing or using these logos, you agree that you are doing so at your own risk and will, if necessary, obtain all required permissions from the appropriate rights holders and adhere to any applicable usage guidelines. Plaid disclaims all express or implied warranties with respect to the logos.*/ #[serde(default, skip_serializing_if = "Option::is_none")] @@ -16,10 +17,10 @@ Note that Plaid does not own any of the logos shared by the API, and that by acc ///Limit results to institutions with or without OAuth login flows. Note that institutions will have `oauth` set to `true` if some Items associated with that institution are required to use OAuth flows; institutions in a state of migration to OAuth will have the `oauth` attribute set to `true`. #[serde(default, skip_serializing_if = "Option::is_none")] pub oauth: Option, - ///Filter the Institutions based on which products they support. + ///Filter the Institutions based on which products they support. Will only return institutions that support all listed products. When filtering based on `auth`, an institution must support Instant Auth to match the criterion. #[serde(default, skip_serializing_if = "Option::is_none")] - pub products: Option>, - ///Specify an array of routing numbers to filter institutions. The response will only return institutions that match all of the routing numbers in the array. Routing number records used for this matching are not comprehensive; failure to match a given routing number to an institution does not mean that the institution is unsupported by Plaid. + pub products: Option>, + ///Specify an array of routing numbers to filter institutions. The response will only return institutions that match all of the routing numbers in the array. Routing number records used for this matching are generally comprehensive; however, failure to match a given routing number to an institution does not necessarily mean that the institution is unsupported by Plaid. #[serde(default, skip_serializing_if = "Option::is_none")] pub routing_numbers: Option>, } @@ -27,4 +28,4 @@ impl std::fmt::Display for InstitutionsGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institutions_get_response.rs b/src/model/institutions_get_response.rs index 1ac6a4b7..89a7a34a 100644 --- a/src/model/institutions_get_response.rs +++ b/src/model/institutions_get_response.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for InstitutionsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institutions_search_payment_initiation_options.rs b/src/model/institutions_search_payment_initiation_options.rs index 1262159e..c5ec711c 100644 --- a/src/model/institutions_search_payment_initiation_options.rs +++ b/src/model/institutions_search_payment_initiation_options.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for InstitutionsSearchPaymentInitiationOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institutions_search_request_options.rs b/src/model/institutions_search_request_options.rs index fd048499..76f11d3b 100644 --- a/src/model/institutions_search_request_options.rs +++ b/src/model/institutions_search_request_options.rs @@ -23,4 +23,4 @@ impl std::fmt::Display for InstitutionsSearchRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/institutions_search_response.rs b/src/model/institutions_search_response.rs index 5fdf1010..adbda201 100644 --- a/src/model/institutions_search_response.rs +++ b/src/model/institutions_search_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for InstitutionsSearchResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investment_account_subtype.rs b/src/model/investment_account_subtype.rs new file mode 100644 index 00000000..5497018f --- /dev/null +++ b/src/model/investment_account_subtype.rs @@ -0,0 +1,105 @@ +use serde::{Serialize, Deserialize}; +///Valid account subtypes for investment accounts. For a list containing descriptions of each subtype, see [Account schemas](https://plaid.com/docs/api/accounts/#StandaloneAccountType-investment). +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum InvestmentAccountSubtype { + #[serde(rename = "529")] + InvestmentAccountSubtype529, + #[serde(rename = "401a")] + InvestmentAccountSubtype401A, + #[serde(rename = "401k")] + InvestmentAccountSubtype401K, + #[serde(rename = "403B")] + InvestmentAccountSubtype403B, + #[serde(rename = "457b")] + InvestmentAccountSubtype457B, + #[serde(rename = "brokerage")] + Brokerage, + #[serde(rename = "cash isa")] + CashIsa, + #[serde(rename = "crypto exchange")] + CryptoExchange, + #[serde(rename = "education savings account")] + EducationSavingsAccount, + #[serde(rename = "fixed annuity")] + FixedAnnuity, + #[serde(rename = "gic")] + Gic, + #[serde(rename = "health reimbursement arrangement")] + HealthReimbursementArrangement, + #[serde(rename = "hsa")] + Hsa, + #[serde(rename = "ira")] + Ira, + #[serde(rename = "isa")] + Isa, + #[serde(rename = "keogh")] + Keogh, + #[serde(rename = "lif")] + Lif, + #[serde(rename = "life insurance")] + LifeInsurance, + #[serde(rename = "lira")] + Lira, + #[serde(rename = "lrif")] + Lrif, + #[serde(rename = "lrsp")] + Lrsp, + #[serde(rename = "mutual fund")] + MutualFund, + #[serde(rename = "non-custodial wallet")] + NonCustodialWallet, + #[serde(rename = "non-taxable brokerage account")] + NonTaxableBrokerageAccount, + #[serde(rename = "other")] + Other, + #[serde(rename = "other annuity")] + OtherAnnuity, + #[serde(rename = "other insurance")] + OtherInsurance, + #[serde(rename = "pension")] + Pension, + #[serde(rename = "prif")] + Prif, + #[serde(rename = "profit sharing plan")] + ProfitSharingPlan, + #[serde(rename = "qshr")] + Qshr, + #[serde(rename = "rdsp")] + Rdsp, + #[serde(rename = "resp")] + Resp, + #[serde(rename = "retirement")] + Retirement, + #[serde(rename = "rlif")] + Rlif, + #[serde(rename = "roth")] + Roth, + #[serde(rename = "roth 401k")] + Roth401K, + #[serde(rename = "rrif")] + Rrif, + #[serde(rename = "rrsp")] + Rrsp, + #[serde(rename = "sarsep")] + Sarsep, + #[serde(rename = "sep ira")] + SepIra, + #[serde(rename = "simple ira")] + SimpleIra, + #[serde(rename = "sipp")] + Sipp, + #[serde(rename = "stock plan")] + StockPlan, + #[serde(rename = "tfsa")] + Tfsa, + #[serde(rename = "trust")] + Trust, + #[serde(rename = "ugma")] + Ugma, + #[serde(rename = "utma")] + Utma, + #[serde(rename = "variable annuity")] + VariableAnnuity, + #[serde(rename = "all")] + All, +} diff --git a/src/model/investment_account_subtypes.rs b/src/model/investment_account_subtypes.rs new file mode 100644 index 00000000..a3c8e5c2 --- /dev/null +++ b/src/model/investment_account_subtypes.rs @@ -0,0 +1,4 @@ +use serde::{Serialize, Deserialize}; +use super::InvestmentAccountSubtype; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct InvestmentAccountSubtypes(pub Vec); diff --git a/src/model/investment_filter.rs b/src/model/investment_filter.rs index da34a2bf..6844f2f6 100644 --- a/src/model/investment_filter.rs +++ b/src/model/investment_filter.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; +use super::InvestmentAccountSubtypes; ///A filter to apply to `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier). #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct InvestmentFilter { ///An array of account subtypes to display in Link. If not specified, all account subtypes will be shown. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub account_subtypes: Vec, + pub account_subtypes: InvestmentAccountSubtypes, } impl std::fmt::Display for InvestmentFilter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investment_holdings_get_request_options.rs b/src/model/investment_holdings_get_request_options.rs index e9baf4f9..d587eaf0 100644 --- a/src/model/investment_holdings_get_request_options.rs +++ b/src/model/investment_holdings_get_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for InvestmentHoldingsGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investment_transaction.rs b/src/model/investment_transaction.rs index 5cd64d00..adda399f 100644 --- a/src/model/investment_transaction.rs +++ b/src/model/investment_transaction.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::{InvestmentTransactionSubtype, InvestmentTransactionType}; ///A transaction within an investment account. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct InvestmentTransaction { ///The `account_id` of the account against which this transaction posted. pub account_id: String, @@ -29,7 +30,7 @@ pub struct InvestmentTransaction { #[serde(default, skip_serializing_if = "Option::is_none")] pub security_id: Option, ///For descriptions of possible transaction types and subtypes, see the [Investment transaction types schema](https://plaid.com/docs/api/accounts/#investment-transaction-types-schema). - pub subtype: String, + pub subtype: InvestmentTransactionSubtype, /**Value is one of the following: `buy`: Buying an investment `sell`: Selling an investment @@ -40,7 +41,7 @@ pub struct InvestmentTransaction { For descriptions of possible transaction types and subtypes, see the [Investment transaction types schema](https://plaid.com/docs/api/accounts/#investment-transaction-types-schema).*/ #[serde(rename = "type")] - pub type_: String, + pub type_: InvestmentTransactionType, /**The unofficial currency code associated with the holding. Always `null` if `iso_currency_code` is non-`null`. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. See the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `iso_currency_code`s.*/ @@ -51,4 +52,4 @@ impl std::fmt::Display for InvestmentTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investment_transaction_subtype.rs b/src/model/investment_transaction_subtype.rs new file mode 100644 index 00000000..2a9d3db0 --- /dev/null +++ b/src/model/investment_transaction_subtype.rs @@ -0,0 +1,101 @@ +use serde::{Serialize, Deserialize}; +///For descriptions of possible transaction types and subtypes, see the [Investment transaction types schema](https://plaid.com/docs/api/accounts/#investment-transaction-types-schema). +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum InvestmentTransactionSubtype { + #[serde(rename = "account fee")] + AccountFee, + #[serde(rename = "adjustment")] + Adjustment, + #[serde(rename = "assignment")] + Assignment, + #[serde(rename = "buy")] + Buy, + #[serde(rename = "buy to cover")] + BuyToCover, + #[serde(rename = "contribution")] + Contribution, + #[serde(rename = "deposit")] + Deposit, + #[serde(rename = "distribution")] + Distribution, + #[serde(rename = "dividend")] + Dividend, + #[serde(rename = "dividend reinvestment")] + DividendReinvestment, + #[serde(rename = "exercise")] + Exercise, + #[serde(rename = "expire")] + Expire, + #[serde(rename = "fund fee")] + FundFee, + #[serde(rename = "interest")] + Interest, + #[serde(rename = "interest receivable")] + InterestReceivable, + #[serde(rename = "interest reinvestment")] + InterestReinvestment, + #[serde(rename = "legal fee")] + LegalFee, + #[serde(rename = "loan payment")] + LoanPayment, + #[serde(rename = "long-term capital gain")] + LongTermCapitalGain, + #[serde(rename = "long-term capital gain reinvestment")] + LongTermCapitalGainReinvestment, + #[serde(rename = "management fee")] + ManagementFee, + #[serde(rename = "margin expense")] + MarginExpense, + #[serde(rename = "merger")] + Merger, + #[serde(rename = "miscellaneous fee")] + MiscellaneousFee, + #[serde(rename = "non-qualified dividend")] + NonQualifiedDividend, + #[serde(rename = "non-resident tax")] + NonResidentTax, + #[serde(rename = "pending credit")] + PendingCredit, + #[serde(rename = "pending debit")] + PendingDebit, + #[serde(rename = "qualified dividend")] + QualifiedDividend, + #[serde(rename = "rebalance")] + Rebalance, + #[serde(rename = "return of principal")] + ReturnOfPrincipal, + #[serde(rename = "request")] + Request, + #[serde(rename = "sell")] + Sell, + #[serde(rename = "sell short")] + SellShort, + #[serde(rename = "send")] + Send, + #[serde(rename = "short-term capital gain")] + ShortTermCapitalGain, + #[serde(rename = "short-term capital gain reinvestment")] + ShortTermCapitalGainReinvestment, + #[serde(rename = "spin off")] + SpinOff, + #[serde(rename = "split")] + Split, + #[serde(rename = "stock distribution")] + StockDistribution, + #[serde(rename = "tax")] + Tax, + #[serde(rename = "tax withheld")] + TaxWithheld, + #[serde(rename = "trade")] + Trade, + #[serde(rename = "transfer")] + Transfer, + #[serde(rename = "transfer fee")] + TransferFee, + #[serde(rename = "trust fee")] + TrustFee, + #[serde(rename = "unqualified gain")] + UnqualifiedGain, + #[serde(rename = "withdrawal")] + Withdrawal, +} diff --git a/src/model/investment_transaction_type.rs b/src/model/investment_transaction_type.rs new file mode 100644 index 00000000..c2346430 --- /dev/null +++ b/src/model/investment_transaction_type.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +/**Value is one of the following: +`buy`: Buying an investment +`sell`: Selling an investment +`cancel`: A cancellation of a pending transaction +`cash`: Activity that modifies a cash position +`fee`: A fee on the account +`transfer`: Activity which modifies a position, but not through buy/sell activity e.g. options exercise, portfolio transfer + +For descriptions of possible transaction types and subtypes, see the [Investment transaction types schema](https://plaid.com/docs/api/accounts/#investment-transaction-types-schema).*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum InvestmentTransactionType { + #[serde(rename = "buy")] + Buy, + #[serde(rename = "sell")] + Sell, + #[serde(rename = "cancel")] + Cancel, + #[serde(rename = "cash")] + Cash, + #[serde(rename = "fee")] + Fee, + #[serde(rename = "transfer")] + Transfer, +} diff --git a/src/model/investments_auth_data_sources.rs b/src/model/investments_auth_data_sources.rs new file mode 100644 index 00000000..81a76fba --- /dev/null +++ b/src/model/investments_auth_data_sources.rs @@ -0,0 +1,32 @@ +use serde::{Serialize, Deserialize}; +use super::DataSources; +///Object with metadata pertaining to the source of data for the account numbers, owners, and holdings that are returned. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InvestmentsAuthDataSources { + /**A description of the source of data for a given product/data type. + +`INSTITUTION`: The institution supports this product, and the data was provided by the institution. +`INSTITUTION_MASK`: The user manually provided the full account number, which was matched to the account mask provided by the institution. Only applicable to the `numbers` data type. +`USER`: The institution does not support this product, and the data was manually provided by the user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub holdings: Option, + /**A description of the source of data for a given product/data type. + +`INSTITUTION`: The institution supports this product, and the data was provided by the institution. +`INSTITUTION_MASK`: The user manually provided the full account number, which was matched to the account mask provided by the institution. Only applicable to the `numbers` data type. +`USER`: The institution does not support this product, and the data was manually provided by the user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub numbers: Option, + /**A description of the source of data for a given product/data type. + +`INSTITUTION`: The institution supports this product, and the data was provided by the institution. +`INSTITUTION_MASK`: The user manually provided the full account number, which was matched to the account mask provided by the institution. Only applicable to the `numbers` data type. +`USER`: The institution does not support this product, and the data was manually provided by the user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub owners: Option, +} +impl std::fmt::Display for InvestmentsAuthDataSources { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/investments_auth_get_numbers.rs b/src/model/investments_auth_get_numbers.rs index d122c824..97694ec7 100644 --- a/src/model/investments_auth_get_numbers.rs +++ b/src/model/investments_auth_get_numbers.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for InvestmentsAuthGetNumbers { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_auth_get_request_options.rs b/src/model/investments_auth_get_request_options.rs index be3763a8..c05659cf 100644 --- a/src/model/investments_auth_get_request_options.rs +++ b/src/model/investments_auth_get_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for InvestmentsAuthGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_auth_get_response.rs b/src/model/investments_auth_get_response.rs index cca72ed4..c9374cc0 100644 --- a/src/model/investments_auth_get_response.rs +++ b/src/model/investments_auth_get_response.rs @@ -1,13 +1,16 @@ use serde::{Serialize, Deserialize}; use super::{ - AccountBase, Holding, InvestmentsAuthGetNumbers, InvestmentsAuthOwner, Item, Security, + AccountBase, Holding, InvestmentsAuthDataSources, InvestmentsAuthGetNumbers, + InvestmentsAuthOwner, Item, Security, }; ///InvestmentsAuthGetResponse defines the response schema for `/investments/auth/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct InvestmentsAuthGetResponse { ///The accounts for which data is being retrieved #[serde(default, skip_serializing_if = "Vec::is_empty")] pub accounts: Vec, + ///Object with metadata pertaining to the source of data for the account numbers, owners, and holdings that are returned. + pub data_sources: InvestmentsAuthDataSources, ///The holdings belonging to investment accounts associated with the Item. Details of the securities in the holdings are provided in the `securities` field. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub holdings: Vec, @@ -28,4 +31,4 @@ impl std::fmt::Display for InvestmentsAuthGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_auth_owner.rs b/src/model/investments_auth_owner.rs index f1e7fdac..5a693901 100644 --- a/src/model/investments_auth_owner.rs +++ b/src/model/investments_auth_owner.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for InvestmentsAuthOwner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_default_update_webhook.rs b/src/model/investments_default_update_webhook.rs index 19718a68..940b8e63 100644 --- a/src/model/investments_default_update_webhook.rs +++ b/src/model/investments_default_update_webhook.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired when new transactions have been detected on an investment account. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct InvestmentsDefaultUpdateWebhook { ///The number of canceled transactions reported since the last time this webhook was fired. pub canceled_investments_transactions: f64, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -23,4 +23,4 @@ impl std::fmt::Display for InvestmentsDefaultUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_historical_update_webhook.rs b/src/model/investments_historical_update_webhook.rs index 62dbdeb7..8cfa4b5c 100644 --- a/src/model/investments_historical_update_webhook.rs +++ b/src/model/investments_historical_update_webhook.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired after an asynchronous extraction on an investments account. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct InvestmentsHistoricalUpdateWebhook { ///The number of canceled transactions reported since the last time this webhook was fired. pub canceled_investments_transactions: f64, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -23,4 +23,4 @@ impl std::fmt::Display for InvestmentsHistoricalUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_holdings_get_response.rs b/src/model/investments_holdings_get_response.rs index 0c83979b..78e718f0 100644 --- a/src/model/investments_holdings_get_response.rs +++ b/src/model/investments_holdings_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountBase, Holding, Item, Security}; ///InvestmentsHoldingsGetResponse defines the response schema for `/investments/holdings/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct InvestmentsHoldingsGetResponse { ///The accounts associated with the Item #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -24,4 +24,4 @@ impl std::fmt::Display for InvestmentsHoldingsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_refresh_response.rs b/src/model/investments_refresh_response.rs index 7a55a69a..3959352c 100644 --- a/src/model/investments_refresh_response.rs +++ b/src/model/investments_refresh_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for InvestmentsRefreshResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_transactions_get_request_options.rs b/src/model/investments_transactions_get_request_options.rs index ad160d07..70cfac24 100644 --- a/src/model/investments_transactions_get_request_options.rs +++ b/src/model/investments_transactions_get_request_options.rs @@ -5,7 +5,7 @@ pub struct InvestmentsTransactionsGetRequestOptions { ///An array of `account_ids` to retrieve for the Item. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_ids: Option>, - ///If the Item was not initialized with the investments product via the `products` array when calling `/link/token/create`, and `async_update` is set to true, the initial Investments extraction will happen asynchronously. Plaid will subsequently fire a `HISTORICAL_UPDATE` webhook when the extraction completes. When `false`, Plaid will wait to return a response until extraction completion and no `HISTORICAL_UPDATE` webhook will fire. Note that while the extraction is happening asynchronously, calls to `/investments/transactions/get` and `/investments/refresh` will return `PRODUCT_NOT_READY` errors until the extraction completes. + ///If the Item was not initialized with the investments product via the `products`, `required_if_supported_products`, or `optional_products` array when calling `/link/token/create`, and `async_update` is set to true, the initial Investments extraction will happen asynchronously. Plaid will subsequently fire a `HISTORICAL_UPDATE` webhook when the extraction completes. When `false`, Plaid will wait to return a response until extraction completion and no `HISTORICAL_UPDATE` webhook will fire. Note that while the extraction is happening asynchronously, calls to `/investments/transactions/get` and `/investments/refresh` will return `PRODUCT_NOT_READY` errors until the extraction completes. #[serde(default, skip_serializing_if = "Option::is_none")] pub async_update: Option, ///The number of transactions to fetch. @@ -19,4 +19,4 @@ impl std::fmt::Display for InvestmentsTransactionsGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_transactions_get_response.rs b/src/model/investments_transactions_get_response.rs index 034e512b..4c7b9474 100644 --- a/src/model/investments_transactions_get_response.rs +++ b/src/model/investments_transactions_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountBase, InvestmentTransaction, Item, Security}; ///InvestmentsTransactionsGetResponse defines the response schema for `/investments/transactions/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct InvestmentsTransactionsGetResponse { ///The accounts for which transaction history is being fetched. #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -26,4 +26,4 @@ impl std::fmt::Display for InvestmentsTransactionsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/investments_transactions_override.rs b/src/model/investments_transactions_override.rs index dff3b0c4..15634716 100644 --- a/src/model/investments_transactions_override.rs +++ b/src/model/investments_transactions_override.rs @@ -32,4 +32,4 @@ impl std::fmt::Display for InvestmentsTransactionsOverride { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/iso_currency_code.rs b/src/model/iso_currency_code.rs new file mode 100644 index 00000000..d0af71c3 --- /dev/null +++ b/src/model/iso_currency_code.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///An ISO-4217 currency code. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IsoCurrencyCode { + #[serde(rename = "USD")] + Usd, +} diff --git a/src/model/issue.rs b/src/model/issue.rs new file mode 100644 index 00000000..eaf3cf0d --- /dev/null +++ b/src/model/issue.rs @@ -0,0 +1,32 @@ +use serde::{Serialize, Deserialize}; +use super::IssuesStatus; +///Information on an issue encountered with financial institutions interactions with financial institutions during Linking. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Issue { + ///The creation time of the record tracking this issue. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub created_at: Option>, + ///A more detailed description for the customer. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub detailed_description: Option, + ///A list of ids of the financial institutions affected. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution_ids: Option>, + ///A list of names of the financial institutions affected. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution_names: Option>, + ///The unique identifier of the issue. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issue_id: Option, + ///The current status of the issue. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + ///A simple summary of the error for the end user. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub summary: Option, +} +impl std::fmt::Display for Issue { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/issue_resolved_webhook.rs b/src/model/issue_resolved_webhook.rs new file mode 100644 index 00000000..5acc82cb --- /dev/null +++ b/src/model/issue_resolved_webhook.rs @@ -0,0 +1,24 @@ +use serde::{Serialize, Deserialize}; +///Webhook notifications are sent only when a subscribed issue is marked as resolved. The payload contains details about the issue at the time of its resolution, focusing on the most essential information. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IssueResolvedWebhook { + ///The unique identifier of the financial institution involved. + pub institution_id: String, + ///The name of the financial institution involved. + pub institution_name: String, + ///A simple description of the error for the end user. + pub issue_description: String, + ///The unique identifier of the connectivity issue. + pub issue_id: String, + ///The time when the issue was marked as resolved. + pub issue_resolved_at: chrono::DateTime, + ///`ISSUE_RESOLVED` + pub webhook_code: String, + ///`ISSUES` + pub webhook_type: String, +} +impl std::fmt::Display for IssueResolvedWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/issues_get_response.rs b/src/model/issues_get_response.rs new file mode 100644 index 00000000..bd3d1284 --- /dev/null +++ b/src/model/issues_get_response.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::Issue; +///IssuesGetResponse defines the response schema for `/issues/get`. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct IssuesGetResponse { + ///Information on an issue encountered with financial institutions interactions with financial institutions during Linking. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issue: Option, + ///A unique identifier for the API request. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_id: Option, +} +impl std::fmt::Display for IssuesGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/issues_search_response.rs b/src/model/issues_search_response.rs new file mode 100644 index 00000000..048605ec --- /dev/null +++ b/src/model/issues_search_response.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::Issue; +///IssuesSearchResponse defines the response schema for `/issues/search`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IssuesSearchResponse { + ///A list of issues affecting the Item, session, or request passed in, conforming to the Issues data model. An empty list indicates that no matching issues were found. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub issues: Option>, + ///A unique identifier for the API request. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_id: Option, +} +impl std::fmt::Display for IssuesSearchResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/issues_status.rs b/src/model/issues_status.rs new file mode 100644 index 00000000..7486e01f --- /dev/null +++ b/src/model/issues_status.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +///The current status of the issue. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IssuesStatus { + #[serde(rename = "REPORTED")] + Reported, + #[serde(rename = "AWAITING_RESOLUTION")] + AwaitingResolution, + #[serde(rename = "FIX_IN_PROGRESS")] + FixInProgress, + #[serde(rename = "FIX_PENDING_VALIDATION")] + FixPendingValidation, + #[serde(rename = "CANNOT_FIX")] + CannotFix, + #[serde(rename = "RESOLVED")] + Resolved, +} diff --git a/src/model/issues_subscribe_response.rs b/src/model/issues_subscribe_response.rs new file mode 100644 index 00000000..61e51355 --- /dev/null +++ b/src/model/issues_subscribe_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///IssuesSubscribeResponse defines the response schema for `/issues/subscribe`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct IssuesSubscribeResponse { + ///A unique identifier for the API request. + pub request_id: String, +} +impl std::fmt::Display for IssuesSubscribeResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/issuing_country.rs b/src/model/issuing_country.rs new file mode 100644 index 00000000..35c6c2cf --- /dev/null +++ b/src/model/issuing_country.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +/**A binary match indicator specifying whether the country that issued the provided document matches the country that the user separately provided to Plaid. + +Note: You can configure whether a `no_match` on `issuing_country` fails the `documentary_verification` by editing your Plaid Template.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum IssuingCountry { + #[serde(rename = "match")] + Match, + #[serde(rename = "no_match")] + NoMatch, +} diff --git a/src/model/item.rs b/src/model/item.rs index 4baf4d40..74779e5b 100644 --- a/src/model/item.rs +++ b/src/model/item.rs @@ -1,23 +1,21 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, Products}; ///Metadata about the Item. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Item { ///A list of products available for the Item that have not yet been accessed. The contents of this array will be mutually exclusive with `billed_products`. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub available_products: Vec, + pub available_products: Vec, ///A list of products that have been billed for the Item. The contents of this array will be mutually exclusive with `available_products`. Note - `billed_products` is populated in all environments but only requests in Production are billed. Also note that products that are billed on a pay-per-call basis rather than a pay-per-Item basis, such as `balance`, will not appear here. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub billed_products: Vec, - /**The RFC 3339 timestamp after which the consent provided by the end user will expire. Upon consent expiration, the item will enter the `ITEM_LOGIN_REQUIRED` error state. To circumvent the `ITEM_LOGIN_REQUIRED` error and maintain continuous consent, the end user can reauthenticate via Link’s update mode in advance of the consent expiration time. - -Note - This is only relevant for certain OAuth-based institutions. For all other institutions, this field will be null.*/ + pub billed_products: Vec, + ///The date and time at which the Item's access consent will expire, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format #[serde(default, skip_serializing_if = "Option::is_none")] pub consent_expiration_time: Option>, - ///A list of products that have gone through consent collection for the Item. Only present for those enabled in the [Data Transparency](https://plaid.com/docs/link/data-transparency-messaging-migration-guide) beta. If you are not enrolled in Data Transparency, this field is not used. + ///A list of products that the user has consented to for the Item via [Data Transparency Messaging](/docs/link/data-transparency-messaging-migration-guide). This will consist of all products where both of the following are true: the user has consented to the required data scopes for that product and you have Production access for that product. #[serde(default, skip_serializing_if = "Option::is_none")] - pub consented_products: Option>, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub consented_products: Option>, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The Plaid Institution ID associated with the Item. Field is `null` for Items created via Same Day Micro-deposits. @@ -27,7 +25,7 @@ Note - This is only relevant for certain OAuth-based institutions. For all other pub item_id: String, ///A list of products added to the Item. In almost all cases, this will be the same as the `billed_products` field. For some products, it is possible for the product to be added to an Item but not yet billed (e.g. Assets, before `/asset_report/create` has been called, or Auth or Identity when added as Optional Products but before their endpoints have been called), in which case the product may appear in `products` but not in `billed_products`. #[serde(default, skip_serializing_if = "Option::is_none")] - pub products: Option>, + pub products: Option>, /**Indicates whether an Item requires user interaction to be updated, which can be the case for Items with some forms of two-factor authentication. `background` - Item can be updated in the background @@ -42,4 +40,4 @@ impl std::fmt::Display for Item { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_access_token_invalidate_response.rs b/src/model/item_access_token_invalidate_response.rs index df2df6ef..6134e7ef 100644 --- a/src/model/item_access_token_invalidate_response.rs +++ b/src/model/item_access_token_invalidate_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for ItemAccessTokenInvalidateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_activity_list_response.rs b/src/model/item_activity_list_response.rs index 8ed4b871..51ef37a4 100644 --- a/src/model/item_activity_list_response.rs +++ b/src/model/item_activity_list_response.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for ItemActivityListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_add_result_webhook.rs b/src/model/item_add_result_webhook.rs new file mode 100644 index 00000000..e518893d --- /dev/null +++ b/src/model/item_add_result_webhook.rs @@ -0,0 +1,23 @@ +use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; +///Fired when a user successfully adds a Plaid Item during a Link session when using Hosted Link or Multi-Item Link sessions. Contains the public token for the Item. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ItemAddResultWebhook { + ///The Plaid environment the webhook was sent from + pub environment: WebhookEnvironmentValues, + ///The identifier for the Link session. + pub link_session_id: String, + ///The link token used to create the Link session. + pub link_token: String, + ///The public token corresponding to the item that was added. + pub public_token: String, + ///`ITEM_ADD_RESULT` + pub webhook_code: String, + ///`LINK` + pub webhook_type: String, +} +impl std::fmt::Display for ItemAddResultWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/item_application_list_response.rs b/src/model/item_application_list_response.rs index 0d7ee728..e97dd450 100644 --- a/src/model/item_application_list_response.rs +++ b/src/model/item_application_list_response.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for ItemApplicationListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_application_scopes_update_response.rs b/src/model/item_application_scopes_update_response.rs index 6ba13d14..244536a8 100644 --- a/src/model/item_application_scopes_update_response.rs +++ b/src/model/item_application_scopes_update_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for ItemApplicationScopesUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_application_unlink_response.rs b/src/model/item_application_unlink_response.rs index e0ba14b5..634eb8c3 100644 --- a/src/model/item_application_unlink_response.rs +++ b/src/model/item_application_unlink_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for ItemApplicationUnlinkResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_create_authentication.rs b/src/model/item_create_authentication.rs new file mode 100644 index 00000000..7cdca57b --- /dev/null +++ b/src/model/item_create_authentication.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Enum representing the entity authenticating the user. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ItemCreateAuthentication { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "DATA_PARTNER")] + DataPartner, + #[serde(rename = "PLAID")] + Plaid, +} diff --git a/src/model/item_error_webhook.rs b/src/model/item_error_webhook.rs index a071b8e0..eb985733 100644 --- a/src/model/item_error_webhook.rs +++ b/src/model/item_error_webhook.rs @@ -1,11 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired when an error is encountered with an Item. The error can be resolved by having the user go through Link’s update mode. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ItemErrorWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -19,4 +19,4 @@ impl std::fmt::Display for ItemErrorWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_get_response.rs b/src/model/item_get_response.rs index 74d1e854..66f0f31e 100644 --- a/src/model/item_get_response.rs +++ b/src/model/item_get_response.rs @@ -1,10 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::{Item, ItemStatus}; +use super::{ItemStatus, ItemWithConsentFields}; ///ItemGetResponse defines the response schema for `/item/get` and `/item/webhook/update` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ItemGetResponse { - ///Metadata about the Item. - pub item: Item, + ///Metadata about the Item + pub item: ItemWithConsentFields, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, ///Information about the last successful and failed transactions update for the Item. @@ -15,4 +15,4 @@ impl std::fmt::Display for ItemGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_import_request_options.rs b/src/model/item_import_request_options.rs index 5b7a0344..d25d09c5 100644 --- a/src/model/item_import_request_options.rs +++ b/src/model/item_import_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for ItemImportRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_import_request_user_auth.rs b/src/model/item_import_request_user_auth.rs index 4efb3674..c9918f41 100644 --- a/src/model/item_import_request_user_auth.rs +++ b/src/model/item_import_request_user_auth.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for ItemImportRequestUserAuth { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_import_response.rs b/src/model/item_import_response.rs index 0e888f35..b350ad3a 100644 --- a/src/model/item_import_response.rs +++ b/src/model/item_import_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for ItemImportResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_login_repaired_webhook.rs b/src/model/item_login_repaired_webhook.rs index 81024e14..bb31b242 100644 --- a/src/model/item_login_repaired_webhook.rs +++ b/src/model/item_login_repaired_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when an Item has exited the `ITEM_LOGIN_REQUIRED` state without the user having gone through the update mode flow in your app (this can happen if the user completed the update mode in a different app). If you have messaging that tells the user to complete the update mode flow, you should silence this messaging upon receiving the `LOGIN_REPAIRED` webhook. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ItemLoginRepairedWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The `item_id` of the Item associated with this webhook, warning, or error pub item_id: String, ///`LOGIN_REPAIRED` @@ -15,4 +16,4 @@ impl std::fmt::Display for ItemLoginRepairedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_product_ready_webhook.rs b/src/model/item_product_ready_webhook.rs index aebd00fc..f494691a 100644 --- a/src/model/item_product_ready_webhook.rs +++ b/src/model/item_product_ready_webhook.rs @@ -1,11 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired once Plaid calculates income from an Item. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ItemProductReadyWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -19,4 +19,4 @@ impl std::fmt::Display for ItemProductReadyWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_public_token_create_response.rs b/src/model/item_public_token_create_response.rs index 4521269a..4824ad85 100644 --- a/src/model/item_public_token_create_response.rs +++ b/src/model/item_public_token_create_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for ItemPublicTokenCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_public_token_exchange_response.rs b/src/model/item_public_token_exchange_response.rs index 9c7eb1b9..25cf5473 100644 --- a/src/model/item_public_token_exchange_response.rs +++ b/src/model/item_public_token_exchange_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for ItemPublicTokenExchangeResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_remove_response.rs b/src/model/item_remove_response.rs index 42a00582..39f88b0d 100644 --- a/src/model/item_remove_response.rs +++ b/src/model/item_remove_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for ItemRemoveResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_status.rs b/src/model/item_status.rs index 5dacf081..d8241476 100644 --- a/src/model/item_status.rs +++ b/src/model/item_status.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for ItemStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_status_investments.rs b/src/model/item_status_investments.rs index fc7c2b06..6249dcfb 100644 --- a/src/model/item_status_investments.rs +++ b/src/model/item_status_investments.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for ItemStatusInvestments { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_status_last_webhook.rs b/src/model/item_status_last_webhook.rs index d12aab36..16b1d74b 100644 --- a/src/model/item_status_last_webhook.rs +++ b/src/model/item_status_last_webhook.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for ItemStatusLastWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_status_transactions.rs b/src/model/item_status_transactions.rs index 852fad70..96fcbabf 100644 --- a/src/model/item_status_transactions.rs +++ b/src/model/item_status_transactions.rs @@ -2,10 +2,10 @@ use serde::{Serialize, Deserialize}; ///Information about the last successful and failed transactions update for the Item. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ItemStatusTransactions { - ///[ISO 8601](https://wikipedia.org/wiki/ISO_8601) timestamp of the last failed transactions update for the Item. The status will update each time Plaid fails an attempt to connect with the institution, regardless of whether any new data is available in the update. + ///[ISO 8601](https://wikipedia.org/wiki/ISO_8601) timestamp of the last failed transactions update for the Item. The status will update each time Plaid fails an attempt to connect with the institution, regardless of whether any new data is available in the update. This field does not reflect transactions updates performed by non-Transactions products (e.g. Signal). #[serde(default, skip_serializing_if = "Option::is_none")] pub last_failed_update: Option>, - ///[ISO 8601](https://wikipedia.org/wiki/ISO_8601) timestamp of the last successful transactions update for the Item. The status will update each time Plaid successfully connects with the institution, regardless of whether any new data is available in the update. + ///[ISO 8601](https://wikipedia.org/wiki/ISO_8601) timestamp of the last successful transactions update for the Item. The status will update each time Plaid successfully connects with the institution, regardless of whether any new data is available in the update. This field does not reflect transactions updates performed by non-Transactions products (e.g. Signal). #[serde(default, skip_serializing_if = "Option::is_none")] pub last_successful_update: Option>, } @@ -13,4 +13,4 @@ impl std::fmt::Display for ItemStatusTransactions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_webhook_update_response.rs b/src/model/item_webhook_update_response.rs index 83bd38bc..f2577dc6 100644 --- a/src/model/item_webhook_update_response.rs +++ b/src/model/item_webhook_update_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::Item; ///ItemWebhookUpdateResponse defines the response schema for `/item/webhook/update` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ItemWebhookUpdateResponse { ///Metadata about the Item. pub item: Item, @@ -12,4 +12,4 @@ impl std::fmt::Display for ItemWebhookUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/item_with_consent_fields.rs b/src/model/item_with_consent_fields.rs new file mode 100644 index 00000000..90320afb --- /dev/null +++ b/src/model/item_with_consent_fields.rs @@ -0,0 +1,2 @@ +use serde::{Serialize, Deserialize}; +pub type ItemWithConsentFields = serde_json::Value; diff --git a/src/model/jwk_public_key.rs b/src/model/jwk_public_key.rs index ae48329c..16fc946c 100644 --- a/src/model/jwk_public_key.rs +++ b/src/model/jwk_public_key.rs @@ -27,4 +27,4 @@ impl std::fmt::Display for JwkPublicKey { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/kyc_check_address_summary.rs b/src/model/kyc_check_address_summary.rs index 0311066a..8877a7cc 100644 --- a/src/model/kyc_check_address_summary.rs +++ b/src/model/kyc_check_address_summary.rs @@ -1,9 +1,30 @@ use serde::{Serialize, Deserialize}; +use super::{ + AddressPurposeLabel, HiddenMatchSummaryCode, KycCheckDetailsInternationalAddress, + MatchSummaryCode, PoBoxStatus, +}; ///Result summary object specifying how the `address` field matched. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct KycCheckAddressSummary { + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub city: Option, + ///Result summary object specifying how the `address` field matched for fields that are only present on an international KYC check. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub international_details: Option, ///Field describing whether the associated address is a post office box. Will be `yes` when a P.O. box is detected, `no` when Plaid confirmed the address is not a P.O. box, and `no_data` when Plaid was not able to determine if the address is a P.O. box. - pub po_box: String, + pub po_box: PoBoxStatus, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -16,15 +37,57 @@ pub struct KycCheckAddressSummary { `no_data` indicates that Plaid was unable to find external data to compare against the provided input data. `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ - pub summary: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street: Option, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + pub summary: MatchSummaryCode, /**Field describing whether the associated address is being used for commercial or residential purposes. Note: This value will be `no_data` when Plaid does not have sufficient data to determine the address's use.*/ #[serde(rename = "type")] - pub type_: String, + pub type_: AddressPurposeLabel, } impl std::fmt::Display for KycCheckAddressSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/kyc_check_date_of_birth_summary.rs b/src/model/kyc_check_date_of_birth_summary.rs index 11bdfa83..30fa3900 100644 --- a/src/model/kyc_check_date_of_birth_summary.rs +++ b/src/model/kyc_check_date_of_birth_summary.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::{HiddenMatchSummaryCode, MatchSummaryCode}; ///Result summary object specifying how the `date_of_birth` field matched. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct KycCheckDateOfBirthSummary { /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -14,10 +15,52 @@ pub struct KycCheckDateOfBirthSummary { `no_data` indicates that Plaid was unable to find external data to compare against the provided input data. `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ - pub summary: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub day: Option, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub month: Option, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + pub summary: MatchSummaryCode, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub year: Option, } impl std::fmt::Display for KycCheckDateOfBirthSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/kyc_check_details.rs b/src/model/kyc_check_details.rs index 53c5250c..267df732 100644 --- a/src/model/kyc_check_details.rs +++ b/src/model/kyc_check_details.rs @@ -3,8 +3,8 @@ use super::{ KycCheckAddressSummary, KycCheckDateOfBirthSummary, KycCheckIdNumberSummary, KycCheckNameSummary, KycCheckPhoneSummary, }; -///Additional information for the `kyc_check` step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +///Additional information for the `kyc_check` (Data Source Verification) step. This field will be `null` unless `steps.kyc_check` has reached a terminal state of either `success` or `failed`. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct KycCheckDetails { ///Result summary object specifying how the `address` field matched. pub address: KycCheckAddressSummary, @@ -23,4 +23,4 @@ impl std::fmt::Display for KycCheckDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/kyc_check_details_international_address.rs b/src/model/kyc_check_details_international_address.rs new file mode 100644 index 00000000..96147354 --- /dev/null +++ b/src/model/kyc_check_details_international_address.rs @@ -0,0 +1,89 @@ +use serde::{Serialize, Deserialize}; +use super::HiddenMatchSummaryCode; +///Result summary object specifying how the `address` field matched for fields that are only present on an international KYC check. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct KycCheckDetailsInternationalAddress { + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + pub building: HiddenMatchSummaryCode, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + pub county: HiddenMatchSummaryCode, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + pub district: HiddenMatchSummaryCode, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + pub house_number: HiddenMatchSummaryCode, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + pub subpremise: HiddenMatchSummaryCode, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + pub thoroughfare: HiddenMatchSummaryCode, +} +impl std::fmt::Display for KycCheckDetailsInternationalAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/kyc_check_id_number_summary.rs b/src/model/kyc_check_id_number_summary.rs index 89c622b0..3cd43b02 100644 --- a/src/model/kyc_check_id_number_summary.rs +++ b/src/model/kyc_check_id_number_summary.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::MatchSummaryCode; ///Result summary object specifying how the `id_number` field matched. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct KycCheckIdNumberSummary { /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -14,10 +15,10 @@ pub struct KycCheckIdNumberSummary { `no_data` indicates that Plaid was unable to find external data to compare against the provided input data. `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ - pub summary: String, + pub summary: MatchSummaryCode, } impl std::fmt::Display for KycCheckIdNumberSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/kyc_check_name_summary.rs b/src/model/kyc_check_name_summary.rs index 94bbe443..30e3896a 100644 --- a/src/model/kyc_check_name_summary.rs +++ b/src/model/kyc_check_name_summary.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::{HiddenMatchSummaryCode, MatchSummaryCode}; ///Result summary object specifying how the `name` field matched. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct KycCheckNameSummary { /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -14,10 +15,38 @@ pub struct KycCheckNameSummary { `no_data` indicates that Plaid was unable to find external data to compare against the provided input data. `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ - pub summary: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub family_name: Option, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub given_name: Option, + /**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ + pub summary: MatchSummaryCode, } impl std::fmt::Display for KycCheckNameSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/kyc_check_phone_summary.rs b/src/model/kyc_check_phone_summary.rs index 60d33e13..973582f2 100644 --- a/src/model/kyc_check_phone_summary.rs +++ b/src/model/kyc_check_phone_summary.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::MatchSummaryCode; ///Result summary object specifying how the `phone` field matched. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct KycCheckPhoneSummary { /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -14,7 +15,7 @@ pub struct KycCheckPhoneSummary { `no_data` indicates that Plaid was unable to find external data to compare against the provided input data. `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ - pub area_code: String, + pub area_code: MatchSummaryCode, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -27,10 +28,10 @@ pub struct KycCheckPhoneSummary { `no_data` indicates that Plaid was unable to find external data to compare against the provided input data. `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ - pub summary: String, + pub summary: MatchSummaryCode, } impl std::fmt::Display for KycCheckPhoneSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/last_data_access_times.rs b/src/model/last_data_access_times.rs index dbc3de0c..b8be0287 100644 --- a/src/model/last_data_access_times.rs +++ b/src/model/last_data_access_times.rs @@ -33,4 +33,4 @@ impl std::fmt::Display for LastDataAccessTimes { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/liabilities_account_ids_with_updated_liabilities.rs b/src/model/liabilities_account_ids_with_updated_liabilities.rs index e480bf87..7e0c7a0d 100644 --- a/src/model/liabilities_account_ids_with_updated_liabilities.rs +++ b/src/model/liabilities_account_ids_with_updated_liabilities.rs @@ -1,11 +1,2 @@ use serde::{Serialize, Deserialize}; -/**An object with keys of `account_id`'s that are mapped to their respective liabilities fields that changed. - -Example: `{ "XMBvvyMGQ1UoLbKByoMqH3nXMj84ALSdE5B58": ["past_amount_due"] }`*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct LiabilitiesAccountIdsWithUpdatedLiabilities {} -impl std::fmt::Display for LiabilitiesAccountIdsWithUpdatedLiabilities { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type LiabilitiesAccountIdsWithUpdatedLiabilities = Vec; diff --git a/src/model/liabilities_default_update_webhook.rs b/src/model/liabilities_default_update_webhook.rs index aba41760..e3e524ad 100644 --- a/src/model/liabilities_default_update_webhook.rs +++ b/src/model/liabilities_default_update_webhook.rs @@ -1,7 +1,9 @@ use serde::{Serialize, Deserialize}; -use super::{LiabilitiesAccountIdsWithUpdatedLiabilities, PlaidError}; +use super::{ + LiabilitiesAccountIdsWithUpdatedLiabilities, PlaidError, WebhookEnvironmentValues, +}; ///The webhook of type `LIABILITIES` and code `DEFAULT_UPDATE` will be fired when new or updated liabilities have been detected on a liabilities item. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LiabilitiesDefaultUpdateWebhook { ///An array of `account_id`'s for accounts that contain new liabilities.' #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -11,8 +13,8 @@ pub struct LiabilitiesDefaultUpdateWebhook { Example: `{ "XMBvvyMGQ1UoLbKByoMqH3nXMj84ALSdE5B58": ["past_amount_due"] }`*/ pub account_ids_with_updated_liabilities: LiabilitiesAccountIdsWithUpdatedLiabilities, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -26,4 +28,4 @@ impl std::fmt::Display for LiabilitiesDefaultUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/liabilities_get_request_options.rs b/src/model/liabilities_get_request_options.rs index 5a322901..bed128fd 100644 --- a/src/model/liabilities_get_request_options.rs +++ b/src/model/liabilities_get_request_options.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for LiabilitiesGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/liabilities_get_response.rs b/src/model/liabilities_get_response.rs index 89ca0966..2b657e42 100644 --- a/src/model/liabilities_get_response.rs +++ b/src/model/liabilities_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountBase, Item, LiabilitiesObject}; ///LiabilitiesGetResponse defines the response schema for `/liabilities/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LiabilitiesGetResponse { ///An array of accounts associated with the Item #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -17,4 +17,4 @@ impl std::fmt::Display for LiabilitiesGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/liabilities_object.rs b/src/model/liabilities_object.rs index 050bd970..8fb51894 100644 --- a/src/model/liabilities_object.rs +++ b/src/model/liabilities_object.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for LiabilitiesObject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/liability_override.rs b/src/model/liability_override.rs index 5f342de9..0a8f1847 100644 --- a/src/model/liability_override.rs +++ b/src/model/liability_override.rs @@ -33,7 +33,7 @@ pub struct LiabilityOverride { pub payment_reference_number: String, ///The original loan principal. Can only be set if `type` is `student`. pub principal: f64, - ///Information about the student's eligibility in the Public Service Loan Forgiveness program. This is only returned if the institution is FedLoan (`ins_116527`). + ///Information about the student's eligibility in the Public Service Loan Forgiveness program. This is only returned if the institution is FedLoan (`ins_116527`). Since FedLoan no longer services student loans, this field is no longer returned. pub pslf_status: PslfStatus, ///The purchase APR percentage value. For simplicity, this is the only interest rate used to calculate interest charges. Can only be set if `type` is `credit`. pub purchase_apr: f64, @@ -41,7 +41,7 @@ pub struct LiabilityOverride { pub repayment_model: StudentLoanRepaymentModel, ///Override the `repayment_plan.description` field. Can only be set if `type` is `student`. pub repayment_plan_description: String, - ///Override the `repayment_plan.type` field. Can only be set if `type` is `student`. Possible values are: `"extended graduated"`, `"extended standard"`, `"graduated"`, `"income-contingent repayment"`, `"income-based repayment"`, `"interest only"`, `"other"`, `"pay as you earn"`, `"revised pay as you earn"`, `"standard"`, or `"saving on a valuable education"`. + ///Override the `repayment_plan.type` field. Can only be set if `type` is `student`. Possible values are: `"extended graduated"`, `"extended standard"`, `"graduated"`, `"income-contingent repayment"`, `"income-based repayment"`, `"income-sensitive repayment"`, `"interest only"`, `"other"`, `"pay as you earn"`, `"revised pay as you earn"`, `"standard"`, or `"saving on a valuable education"`. pub repayment_plan_type: String, ///Override the `sequence_number` field. Can only be set if `type` is `student`. pub sequence_number: String, @@ -57,4 +57,4 @@ impl std::fmt::Display for LiabilityOverride { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_callback_metadata.rs b/src/model/link_callback_metadata.rs index f80e53e5..b001ed56 100644 --- a/src/model/link_callback_metadata.rs +++ b/src/model/link_callback_metadata.rs @@ -1,17 +1,20 @@ use serde::{Serialize, Deserialize}; -use super::{LinkDeliveryAccount, LinkDeliveryInstitution}; +use super::{ + LinkDeliveryAccount, LinkDeliveryInstitution, LinkDeliveryWebhookCallbackType, + LinkEventName, +}; ///Information related to the callback from the Hosted Link session. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkCallbackMetadata { ///A list of accounts attached to the connected Item. If Account Select is enabled via the developer dashboard, accounts will only include selected accounts. #[serde(default, skip_serializing_if = "Option::is_none")] pub accounts: Option>, ///The type of Link callback event #[serde(default, skip_serializing_if = "Option::is_none")] - pub callback_type: Option, + pub callback_type: Option, ///A string representing the event that has just occurred in the Link flow. #[serde(default, skip_serializing_if = "Option::is_none")] - pub event_name: Option, + pub event_name: Option, ///Information related to the financial institution. #[serde(default, skip_serializing_if = "Option::is_none")] pub institution: Option, @@ -29,4 +32,4 @@ impl std::fmt::Display for LinkCallbackMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_account.rs b/src/model/link_delivery_account.rs index b83e4cc8..a0c57866 100644 --- a/src/model/link_delivery_account.rs +++ b/src/model/link_delivery_account.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::LinkDeliveryVerificationStatus; ///Information related to account attached to the connected Item -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkDeliveryAccount { ///If micro-deposit verification is being used, indicates whether the account being verified is a `business` or `personal` account. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -21,12 +22,12 @@ pub struct LinkDeliveryAccount { #[serde(rename = "type")] #[serde(default, skip_serializing_if = "Option::is_none")] pub type_: Option, - ///Indicates an Item's micro-deposit-based verification status. + ///Indicates an Item's micro-deposit-based verification or database verification status. #[serde(default, skip_serializing_if = "Option::is_none")] - pub verification_status: Option, + pub verification_status: Option, } impl std::fmt::Display for LinkDeliveryAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_callback_webhook.rs b/src/model/link_delivery_callback_webhook.rs index 076cecde..c36696e0 100644 --- a/src/model/link_delivery_callback_webhook.rs +++ b/src/model/link_delivery_callback_webhook.rs @@ -1,9 +1,9 @@ use serde::{Serialize, Deserialize}; use super::{LinkCallbackMetadata, PlaidError}; ///Webhook containing metadata proxied over from Link callback e.g `onEvent`, `onExit`, `onSuccess`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkDeliveryCallbackWebhook { - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///Information related to the callback from the Hosted Link session. @@ -21,4 +21,4 @@ impl std::fmt::Display for LinkDeliveryCallbackWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_communication_method.rs b/src/model/link_delivery_communication_method.rs index 5095c00f..bf6b9f1e 100644 --- a/src/model/link_delivery_communication_method.rs +++ b/src/model/link_delivery_communication_method.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::LinkDeliveryDeliveryMethod; ///The communication method containing both the type and address to send the URL. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkDeliveryCommunicationMethod { ///The phone number / email address that Hosted Link sessions are delivered to. Phone numbers must be in E.164 format. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -11,10 +12,10 @@ pub struct LinkDeliveryCommunicationMethod { `EMAIL`: The URL will be delivered through email*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub method: Option, + pub method: Option, } impl std::fmt::Display for LinkDeliveryCommunicationMethod { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_create_response.rs b/src/model/link_delivery_create_response.rs index aea66eaf..1a9683a3 100644 --- a/src/model/link_delivery_create_response.rs +++ b/src/model/link_delivery_create_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for LinkDeliveryCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_delivery_method.rs b/src/model/link_delivery_delivery_method.rs new file mode 100644 index 00000000..054bca9f --- /dev/null +++ b/src/model/link_delivery_delivery_method.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**The delivery method to be used to deliver the Hosted Link session URL. + +`SMS`: The URL will be delivered through SMS + +`EMAIL`: The URL will be delivered through email*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum LinkDeliveryDeliveryMethod { + #[serde(rename = "SMS")] + Sms, + #[serde(rename = "EMAIL")] + Email, +} diff --git a/src/model/link_delivery_get_response.rs b/src/model/link_delivery_get_response.rs index 9fa5295a..2d2ba7ec 100644 --- a/src/model/link_delivery_get_response.rs +++ b/src/model/link_delivery_get_response.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::LinkDeliverySessionStatus; ///LinkDeliveryGetRequest defines the response schema for `/link_delivery/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkDeliveryGetResponse { ///An array of access tokens associated with the Hosted Link session. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -26,10 +27,10 @@ pub struct LinkDeliveryGetResponse { `COMPLETED`: The session has been completed by the user `EXPIRED`: The session has expired*/ - pub status: String, + pub status: LinkDeliverySessionStatus, } impl std::fmt::Display for LinkDeliveryGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_institution.rs b/src/model/link_delivery_institution.rs index eba44019..9d903a58 100644 --- a/src/model/link_delivery_institution.rs +++ b/src/model/link_delivery_institution.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for LinkDeliveryInstitution { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_metadata.rs b/src/model/link_delivery_metadata.rs index 367466dd..af52841c 100644 --- a/src/model/link_delivery_metadata.rs +++ b/src/model/link_delivery_metadata.rs @@ -1,16 +1,17 @@ use serde::{Serialize, Deserialize}; +use super::{LinkDeliveryWebhookCommunicationMethod, LinkDeliveryWebhookDeliveryStatus}; ///Information related to the related to the delivery of the link session to users -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkDeliveryMetadata { ///The communication method used to deliver the Hosted Link session #[serde(default, skip_serializing_if = "Option::is_none")] - pub communication_method: Option, + pub communication_method: Option, ///The status of the delivery of the Hosted Link to the user #[serde(default, skip_serializing_if = "Option::is_none")] - pub delivery_status: Option, + pub delivery_status: Option, } impl std::fmt::Display for LinkDeliveryMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_options.rs b/src/model/link_delivery_options.rs index 3fa76433..c9239e21 100644 --- a/src/model/link_delivery_options.rs +++ b/src/model/link_delivery_options.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for LinkDeliveryOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_recipient.rs b/src/model/link_delivery_recipient.rs index c9665b04..1ce7258b 100644 --- a/src/model/link_delivery_recipient.rs +++ b/src/model/link_delivery_recipient.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for LinkDeliveryRecipient { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_delivery_session_status.rs b/src/model/link_delivery_session_status.rs new file mode 100644 index 00000000..79d19124 --- /dev/null +++ b/src/model/link_delivery_session_status.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +/**The status of the given Hosted Link session. + +`CREATED`: The session is created but not yet accessed by the user + +`OPENED`: The session is opened by the user but not yet completed + +`EXITED`: The session has been exited by the user + +`COMPLETED`: The session has been completed by the user + +`EXPIRED`: The session has expired*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum LinkDeliverySessionStatus { + #[serde(rename = "CREATED")] + Created, + #[serde(rename = "OPENED")] + Opened, + #[serde(rename = "EXITED")] + Exited, + #[serde(rename = "COMPLETED")] + Completed, + #[serde(rename = "EXPIRED")] + Expired, +} diff --git a/src/model/link_delivery_verification_status.rs b/src/model/link_delivery_verification_status.rs new file mode 100644 index 00000000..f6884190 --- /dev/null +++ b/src/model/link_delivery_verification_status.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +///Indicates an Item's micro-deposit-based verification or database verification status. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum LinkDeliveryVerificationStatus { + #[serde(rename = "automatically_verified")] + AutomaticallyVerified, + #[serde(rename = "pending_automatic_verification")] + PendingAutomaticVerification, + #[serde(rename = "pending_manual_verification")] + PendingManualVerification, + #[serde(rename = "manually_verified")] + ManuallyVerified, + #[serde(rename = "verification_expired")] + VerificationExpired, + #[serde(rename = "verification_failed")] + VerificationFailed, + #[serde(rename = "database_matched")] + DatabaseMatched, + #[serde(rename = "database_insights_pending")] + DatabaseInsightsPending, +} diff --git a/src/model/link_delivery_webhook_callback_type.rs b/src/model/link_delivery_webhook_callback_type.rs new file mode 100644 index 00000000..5f62ae15 --- /dev/null +++ b/src/model/link_delivery_webhook_callback_type.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///The type of Link callback event +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum LinkDeliveryWebhookCallbackType { + #[serde(rename = "ON_SUCCESS")] + OnSuccess, + #[serde(rename = "ON_EVENT")] + OnEvent, + #[serde(rename = "ON_EXIT")] + OnExit, +} diff --git a/src/model/link_delivery_webhook_communication_method.rs b/src/model/link_delivery_webhook_communication_method.rs new file mode 100644 index 00000000..b840ba91 --- /dev/null +++ b/src/model/link_delivery_webhook_communication_method.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The communication method used to deliver the Hosted Link session +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum LinkDeliveryWebhookCommunicationMethod { + #[serde(rename = "SMS")] + Sms, + #[serde(rename = "EMAIL")] + Email, +} diff --git a/src/model/link_delivery_webhook_delivery_status.rs b/src/model/link_delivery_webhook_delivery_status.rs new file mode 100644 index 00000000..10741659 --- /dev/null +++ b/src/model/link_delivery_webhook_delivery_status.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The status of the delivery of the Hosted Link to the user +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum LinkDeliveryWebhookDeliveryStatus { + #[serde(rename = "SUCCESS")] + Success, + #[serde(rename = "FAILURE")] + Failure, +} diff --git a/src/model/link_event.rs b/src/model/link_event.rs index 7ccda110..6b03d0b5 100644 --- a/src/model/link_event.rs +++ b/src/model/link_event.rs @@ -1,9 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::LinkEventMetadata; ///An event that occurred while the user was going through Link #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkEvent { ///UUID that can be used to deduplicate events pub event_id: String, + ///Metadata about an event that occurred while the user was going through Link + pub event_metadata: LinkEventMetadata, ///Event name pub event_name: String, ///Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. @@ -13,4 +16,4 @@ impl std::fmt::Display for LinkEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_event_metadata.rs b/src/model/link_event_metadata.rs new file mode 100644 index 00000000..2b950abd --- /dev/null +++ b/src/model/link_event_metadata.rs @@ -0,0 +1,55 @@ +use serde::{Serialize, Deserialize}; +///Metadata about an event that occurred while the user was going through Link +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkEventMetadata { + ///The account number mask extracted from the user-provided account number. If the user-inputted account number is four digits long, `account_number_mask` is empty. Emitted by `SUBMIT_ACCOUNT_NUMBER`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_number_mask: Option, + ///The name of the selected brand. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub brand_name: Option, + ///The error code that the user encountered. Emitted by `ERROR`, `EXIT`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code: Option, + ///The error message that the user encountered. Emitted by: `ERROR`, `EXIT`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_message: Option, + ///The error type that the user encountered. Emitted by: `ERROR`, `EXIT`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_type: Option, + ///The status key indicates the point at which the user exited the Link flow. Emitted by: `EXIT`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exit_status: Option, + ///The ID of the selected institution. Emitted by: all events. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution_id: Option, + ///The name of the selected institution. Emitted by: all events. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution_name: Option, + ///The query used to search for institutions. Emitted by: `SEARCH_INSTITUTION`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution_search_query: Option, + ///The reason this institution was matched, which will be either `returning_user` or `routing_number`. Emitted by: `MATCHED_SELECT_INSTITUTION`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub match_reason: Option, + ///If set, the user has encountered one of the following MFA types: code, device, questions, selections. Emitted by: `SUBMIT_MFA` and `TRANSITION_VIEW` when `view_name` is `MFA`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mfa_type: Option, + ///The request ID for the last request made by Link. This can be shared with Plaid Support to expedite investigation. Emitted by: all events. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_id: Option, + ///The routing number submitted by user at the micro-deposits routing number pane. Emitted by `SUBMIT_ROUTING_NUMBER`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub routing_number: Option, + ///Either the verification method for a matched institution selected by the user or the Auth Type Select flow type selected by the user. If selection is used to describe selected verification method, then possible values are `phoneotp` or `password`; if selection is used to describe the selected Auth Type Select flow, then possible values are `flow_type_manual` or `flow_type_instant`. Emitted by: `MATCHED_SELECT_VERIFY_METHOD` and `SELECT_AUTH_TYPE`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub selection: Option, + ///The name of the view that is being transitioned to. Emitted by: `TRANSITION_VIEW`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub view_name: Option, +} +impl std::fmt::Display for LinkEventMetadata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_event_name.rs b/src/model/link_event_name.rs new file mode 100644 index 00000000..bbaa4914 --- /dev/null +++ b/src/model/link_event_name.rs @@ -0,0 +1,57 @@ +use serde::{Serialize, Deserialize}; +///A string representing the event that has just occurred in the Link flow. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum LinkEventName { + #[serde(rename = "BANK_INCOME_INSIGHTS_COMPLETED")] + BankIncomeInsightsCompleted, + #[serde(rename = "CLOSE_OAUTH")] + CloseOauth, + #[serde(rename = "ERROR")] + Error, + #[serde(rename = "EXIT")] + Exit, + #[serde(rename = "FAIL_OAUTH")] + FailOauth, + #[serde(rename = "HANDOFF")] + Handoff, + #[serde(rename = "ISSUE_FOLLOWED")] + IssueFollowed, + #[serde(rename = "OPEN")] + Open, + #[serde(rename = "OPEN_MY_PLAID")] + OpenMyPlaid, + #[serde(rename = "OPEN_OAUTH")] + OpenOauth, + #[serde(rename = "SEARCH_INSTITUTION")] + SearchInstitution, + #[serde(rename = "SELECT_AUTH_TYPE")] + SelectAuthType, + #[serde(rename = "SELECT_BRAND")] + SelectBrand, + #[serde(rename = "SELECT_DEGRADED_INSTITUTION")] + SelectDegradedInstitution, + #[serde(rename = "SELECT_DOWN_INSTITUTION")] + SelectDownInstitution, + #[serde(rename = "SELECT_FILTERED_INSTITUTION")] + SelectFilteredInstitution, + #[serde(rename = "SELECT_INSTITUTION")] + SelectInstitution, + #[serde(rename = "SUBMIT_ACCOUNT_NUMBER")] + SubmitAccountNumber, + #[serde(rename = "SUBMIT_CREDENTIALS")] + SubmitCredentials, + #[serde(rename = "SUBMIT_DOCUMENTS")] + SubmitDocuments, + #[serde(rename = "SUBMIT_DOCUMENTS_ERROR")] + SubmitDocumentsError, + #[serde(rename = "SUBMIT_DOCUMENTS_SUCCESS")] + SubmitDocumentsSuccess, + #[serde(rename = "SUBMIT_MFA")] + SubmitMfa, + #[serde(rename = "SUBMIT_ROUTING_NUMBER")] + SubmitRoutingNumber, + #[serde(rename = "TRANSITION_VIEW")] + TransitionView, + #[serde(rename = "VIEW_DATA_TYPES")] + ViewDataTypes, +} diff --git a/src/model/link_events_webhook.rs b/src/model/link_events_webhook.rs index 18cdb71c..b27db74d 100644 --- a/src/model/link_events_webhook.rs +++ b/src/model/link_events_webhook.rs @@ -1,14 +1,16 @@ use serde::{Serialize, Deserialize}; use super::LinkEvent; -///Contains a summary of the events from a link session +/**This webhook contains a summary of the events from a Link session and will be fired after the user finishes going through Link. If the user abandons the Link flow (i.e., closes the hosted link webpage or leaves Link open for too long without taking any action), the webhook will be fired 5-15 minutes after the last user interaction. A single Link session may occasionally generate multiple `EVENTS` webhooks. If this occurs, the new webhook will contain all previous events for the session, as well as new events that occurred since the previous `EVENTS` webhook was sent. If this occurs, events can be grouped using the `link_session_id` field and, if necessary, de-duplicated using the `event_id` field. + +By default, the `EVENTS` webhook is sent only for sessions where the end user goes through a Hosted Link flow (including Link Recovery flows). If you would like to receive this webhook for sessions not using Hosted Link, contact your Account Manager or Support.*/ #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkEventsWebhook { - ///The link events emitted during the link session + ///The Link events emitted during the Link session #[serde(default, skip_serializing_if = "Vec::is_empty")] pub events: Vec, - ///An identifier for the link session these events occurred in + ///An identifier for the Link session these events occurred in pub link_session_id: String, - ///The link token used to create the link session these events are from + ///The Link token used to create the Link session these events are from pub link_token: String, ///`EVENTS` pub webhook_code: String, @@ -19,4 +21,4 @@ impl std::fmt::Display for LinkEventsWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_o_auth_correlation_id_exchange_response.rs b/src/model/link_o_auth_correlation_id_exchange_response.rs index 00b772a6..56ffb68c 100644 --- a/src/model/link_o_auth_correlation_id_exchange_response.rs +++ b/src/model/link_o_auth_correlation_id_exchange_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for LinkOAuthCorrelationIdExchangeResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_profile_eligibility_check_response.rs b/src/model/link_profile_eligibility_check_response.rs new file mode 100644 index 00000000..8a4c13bb --- /dev/null +++ b/src/model/link_profile_eligibility_check_response.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///LinkProfileEligibilityCheckResponse defines the response schema for `/link/profile/eligibility/check` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkProfileEligibilityCheckResponse { + ///Indicates whether Plaid has a profile matching the customer's eligibility requirements for this user + pub profile_matches: bool, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for LinkProfileEligibilityCheckResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_profile_eligibility_check_user.rs b/src/model/link_profile_eligibility_check_user.rs new file mode 100644 index 00000000..4206f8c7 --- /dev/null +++ b/src/model/link_profile_eligibility_check_user.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///An object specifying information about the end user who will be sharing their profile in this Link session +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkProfileEligibilityCheckUser { + ///The user's phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format + pub phone_number: String, +} +impl std::fmt::Display for LinkProfileEligibilityCheckUser { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_session_bank_income_result.rs b/src/model/link_session_bank_income_result.rs new file mode 100644 index 00000000..4b2b05d9 --- /dev/null +++ b/src/model/link_session_bank_income_result.rs @@ -0,0 +1,28 @@ +use serde::{Serialize, Deserialize}; +use super::{CreditSessionBankIncomeStatus, LinkSessionSuccessMetadataInstitution}; +///The details of a bank income verification in Link. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct LinkSessionBankIncomeResult { + ///An institution object. If the Item was created via Same-Day or Instant micro-deposit verification, will be `null`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution: Option, + ///The Plaid Item ID. The `item_id` is always unique; linking the same account at the same institution twice will result in two Items with different `item_id` values. Like all Plaid identifiers, the `item_id` is case-sensitive. + pub item_id: String, + /**Status of the Bank Income Link session. + +`APPROVED`: User has approved and verified their income + +`NO_DEPOSITS_FOUND`: We attempted, but were unable to find any income in the connected account. + +`USER_REPORTED_NO_INCOME`: The user explicitly indicated that they don't receive income in the connected account. + +`STARTED`: The user began the bank income portion of the link flow. + +`INTERNAL_ERROR`: The user encountered an internal error.*/ + pub status: CreditSessionBankIncomeStatus, +} +impl std::fmt::Display for LinkSessionBankIncomeResult { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_session_cra_item_add_result.rs b/src/model/link_session_cra_item_add_result.rs new file mode 100644 index 00000000..b77a3673 --- /dev/null +++ b/src/model/link_session_cra_item_add_result.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::{LinkSessionSuccessMetadataAccount, LinkSessionSuccessMetadataInstitution}; +///The details of a Plaid Check Item add in Link. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkSessionCraItemAddResult { + ///A list of accounts attached to the connected Item. If Account Select is enabled via the developer dashboard, `accounts` will only include selected accounts. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub accounts: Vec, + ///An institution object. If the Item was created via Same-Day or Instant micro-deposit verification, will be `null`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution: Option, + ///The Plaid Check Item ID. The `item_id` is always unique; linking the same account at the same institution twice will result in two Items with different `item_id` values. The `item_id` is case-sensitive. + pub item_id: String, +} +impl std::fmt::Display for LinkSessionCraItemAddResult { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_session_exit.rs b/src/model/link_session_exit.rs index e96d5ce4..06b8224b 100644 --- a/src/model/link_session_exit.rs +++ b/src/model/link_session_exit.rs @@ -1,9 +1,9 @@ use serde::{Serialize, Deserialize}; use super::{LinkSessionExitMetadata, PlaidError}; ///An object representing an [onExit](https://plaid.com/docs/link/web/#onexit) callback from Link. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkSessionExit { - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///Displayed if a user exits Link without successfully linking an Item. @@ -14,4 +14,4 @@ impl std::fmt::Display for LinkSessionExit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_session_exit_deprecated.rs b/src/model/link_session_exit_deprecated.rs new file mode 100644 index 00000000..cd22897d --- /dev/null +++ b/src/model/link_session_exit_deprecated.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::{LinkSessionExitMetadata, PlaidError}; +///An object representing an [onExit](https://plaid.com/docs/link/web/#onexit) callback from Link. This field has been deprecated in favor of [`exit`](https://plaid.com/docs/api/link/#link-token-get-response-link-sessions-exit), for improved naming consistency. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct LinkSessionExitDeprecated { + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, + ///Displayed if a user exits Link without successfully linking an Item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, +} +impl std::fmt::Display for LinkSessionExitDeprecated { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_session_exit_metadata.rs b/src/model/link_session_exit_metadata.rs index d8947c60..4a9c03c9 100644 --- a/src/model/link_session_exit_metadata.rs +++ b/src/model/link_session_exit_metadata.rs @@ -3,7 +3,7 @@ use super::LinkSessionExitMetadataInstitution; ///Displayed if a user exits Link without successfully linking an Item. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkSessionExitMetadata { - ///An institution object. If the Item was created via Same-Day micro-deposit verification, will be `null`. + ///An institution object. If the Item was created via Same-Day or Instant micro-deposit verification, will be `null`. #[serde(default, skip_serializing_if = "Option::is_none")] pub institution: Option, ///A unique identifier associated with a user's actions and events through the Link flow. Include this identifier when opening a support ticket for faster turnaround. @@ -20,4 +20,4 @@ impl std::fmt::Display for LinkSessionExitMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_session_exit_metadata_institution.rs b/src/model/link_session_exit_metadata_institution.rs index 5916dd1b..e815c46e 100644 --- a/src/model/link_session_exit_metadata_institution.rs +++ b/src/model/link_session_exit_metadata_institution.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///An institution object. If the Item was created via Same-Day micro-deposit verification, will be `null`. +///An institution object. If the Item was created via Same-Day or Instant micro-deposit verification, will be `null`. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkSessionExitMetadataInstitution { ///The Plaid institution identifier @@ -13,4 +13,4 @@ impl std::fmt::Display for LinkSessionExitMetadataInstitution { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_session_finished_webhook.rs b/src/model/link_session_finished_webhook.rs index 9a931a60..f1ac426a 100644 --- a/src/model/link_session_finished_webhook.rs +++ b/src/model/link_session_finished_webhook.rs @@ -1,16 +1,22 @@ use serde::{Serialize, Deserialize}; -///Contains the state of a completed Link session, along with the public token if available. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::WebhookEnvironmentValues; +/**Contains the state of a completed Link session, along with the public token(s) if available. + +By default, the `EVENTS` webhook is sent only for sessions where the end user goes through a Hosted Link flow (including Link Recovery flows) or a Multi-Item Link flow. If you would like to receive this webhook for other sessions, contact your Account Manager or Support.*/ +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkSessionFinishedWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The identifier for the Link session. pub link_session_id: String, ///The link token used to create the Link session. pub link_token: String, - ///The public token generated by the Link session. + ///The public token generated by the Link session. This field has been deprecated; please use `public_tokens` instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub public_token: Option, + ///The public tokens generated by the Link session. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub public_tokens: Option>, ///The final status of the Link session. Will always be "SUCCESS" or "EXITED". pub status: String, ///`SESSION_FINISHED` @@ -22,4 +28,4 @@ impl std::fmt::Display for LinkSessionFinishedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_session_item_add_result.rs b/src/model/link_session_item_add_result.rs new file mode 100644 index 00000000..14708655 --- /dev/null +++ b/src/model/link_session_item_add_result.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::{LinkSessionSuccessMetadataAccount, LinkSessionSuccessMetadataInstitution}; +///The details of an Item add in Link. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkSessionItemAddResult { + ///A list of accounts attached to the connected Item. If Account Select is enabled via the developer dashboard, `accounts` will only include selected accounts. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub accounts: Vec, + ///An institution object. If the Item was created via Same-Day or Instant micro-deposit verification, will be `null`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution: Option, + ///Returned once a user has successfully linked their Item. + pub public_token: String, +} +impl std::fmt::Display for LinkSessionItemAddResult { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_session_payroll_income_result.rs b/src/model/link_session_payroll_income_result.rs new file mode 100644 index 00000000..dbc4c3e5 --- /dev/null +++ b/src/model/link_session_payroll_income_result.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::LinkSessionSuccessMetadataInstitution; +///The details of a digital payroll income verification in Link. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkSessionPayrollIncomeResult { + ///An institution object. If the Item was created via Same-Day or Instant micro-deposit verification, will be `null`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub institution: Option, + ///The number of paystubs retrieved from a payroll provider. + pub num_paystubs_retrieved: i64, + ///The number of W-2s retrieved from a payroll provider. + #[serde(rename = "num_w2s_retrieved")] + pub num_w2_s_retrieved: i64, +} +impl std::fmt::Display for LinkSessionPayrollIncomeResult { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_session_results.rs b/src/model/link_session_results.rs new file mode 100644 index 00000000..15f60b80 --- /dev/null +++ b/src/model/link_session_results.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +use super::{ + CreditSessionDocumentIncomeResult, LinkSessionBankIncomeResult, + LinkSessionCraItemAddResult, LinkSessionItemAddResult, LinkSessionPayrollIncomeResult, +}; +///The set of results for a Link session. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkSessionResults { + ///The set of bank income verifications for the Link session. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub bank_income_results: Vec, + ///The set of Plaid Check Item adds for the Link session. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub cra_item_add_results: Vec, + ///The details of a document income verification in Link + #[serde(default, skip_serializing_if = "Option::is_none")] + pub document_income_results: Option, + ///The set of Item adds for the Link session. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub item_add_results: Vec, + ///The set of payroll income verifications for the Link session. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub payroll_income_results: Vec, +} +impl std::fmt::Display for LinkSessionResults { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_session_success.rs b/src/model/link_session_success.rs index aaeb1527..627e77c4 100644 --- a/src/model/link_session_success.rs +++ b/src/model/link_session_success.rs @@ -1,6 +1,6 @@ use serde::{Serialize, Deserialize}; use super::LinkSessionSuccessMetadata; -///An object representing an [onSuccess](https://plaid.com/docs/link/web/#onsuccess) callback from Link. +///An object representing an [onSuccess](https://plaid.com/docs/link/web/#onsuccess) callback from Link. This object has been deprecated in favor of the newer [`results.item_add_result`](https://plaid.com/docs/api/link/#link-token-get-response-link-sessions-results-item-add-results), which can support multiple public tokens in a single Link session. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkSessionSuccess { ///Displayed once a user has successfully linked their Item. @@ -13,4 +13,4 @@ impl std::fmt::Display for LinkSessionSuccess { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_session_success_metadata.rs b/src/model/link_session_success_metadata.rs index 10d7da9a..1ae6674e 100644 --- a/src/model/link_session_success_metadata.rs +++ b/src/model/link_session_success_metadata.rs @@ -1,12 +1,15 @@ use serde::{Serialize, Deserialize}; -use super::{LinkSessionSuccessMetadataAccount, LinkSessionSuccessMetadataInstitution}; +use super::{ + LinkSessionSuccessMetadataAccount, LinkSessionSuccessMetadataInstitution, + LinkSessionSuccessMetadataTransferStatus, +}; ///Displayed once a user has successfully linked their Item. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkSessionSuccessMetadata { ///A list of accounts attached to the connected Item. If Account Select is enabled via the developer dashboard, `accounts` will only include selected accounts. #[serde(default, skip_serializing_if = "Option::is_none")] pub accounts: Option>, - ///An institution object. If the Item was created via Same-Day micro-deposit verification, will be `null`. + ///An institution object. If the Item was created via Same-Day or Instant micro-deposit verification, will be `null`. #[serde(default, skip_serializing_if = "Option::is_none")] pub institution: Option, ///A unique identifier associated with a user's actions and events through the Link flow. Include this identifier when opening a support ticket for faster turnaround. @@ -17,10 +20,10 @@ pub struct LinkSessionSuccessMetadata { - `COMPLETE` – The transfer was completed. - `INCOMPLETE` – The transfer could not be completed. For help, see [Troubleshooting transfers](/docs/transfer/using-transfer-ui#troubleshooting-transfers).*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub transfer_status: Option, + pub transfer_status: Option, } impl std::fmt::Display for LinkSessionSuccessMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_session_success_metadata_account.rs b/src/model/link_session_success_metadata_account.rs index 134d47e0..8a413f89 100644 --- a/src/model/link_session_success_metadata_account.rs +++ b/src/model/link_session_success_metadata_account.rs @@ -21,11 +21,11 @@ pub struct LinkSessionSuccessMetadataAccount { #[serde(rename = "type")] #[serde(default, skip_serializing_if = "Option::is_none")] pub type_: Option, - /**Indicates an Item's micro-deposit-based verification status. Possible values are: + /**Indicates an Item's micro-deposit-based verification or database verification status. Possible values are: `pending_automatic_verification`: The Item is pending automatic verification -`pending_manual_verification`: The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the two amounts. +`pending_manual_verification`: The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the code. `automatically_verified`: The Item has successfully been automatically verified @@ -35,9 +35,11 @@ pub struct LinkSessionSuccessMetadataAccount { `verification_failed`: The Item failed manual micro-deposit verification because the user exhausted all 3 verification attempts. Users may retry by submitting their information again through Link. -`database_matched`: The Item has successfully been verified using Plaid's data sources. Note: Database Match is currently a beta feature, please contact your account manager for more information. +`database_matched`: The Item has successfully been verified using Plaid's data sources. -`null`: micro-deposit-based verification is not being used for the Item.*/ +`database_insights_pending`: The Database Insights result is pending and will be available upon Auth request. Note: Database Insights is currently a beta feature, please contact your account manager for more information. + +`null`: Neither micro-deposit-based verification nor database verification are being used for the Item.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub verification_status: Option, } @@ -45,4 +47,4 @@ impl std::fmt::Display for LinkSessionSuccessMetadataAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_session_success_metadata_institution.rs b/src/model/link_session_success_metadata_institution.rs index 07e031a0..a97684b5 100644 --- a/src/model/link_session_success_metadata_institution.rs +++ b/src/model/link_session_success_metadata_institution.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///An institution object. If the Item was created via Same-Day micro-deposit verification, will be `null`. +///An institution object. If the Item was created via Same-Day or Instant micro-deposit verification, will be `null`. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkSessionSuccessMetadataInstitution { ///The Plaid institution identifier @@ -13,4 +13,4 @@ impl std::fmt::Display for LinkSessionSuccessMetadataInstitution { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_session_success_metadata_transfer_status.rs b/src/model/link_session_success_metadata_transfer_status.rs new file mode 100644 index 00000000..b35b5513 --- /dev/null +++ b/src/model/link_session_success_metadata_transfer_status.rs @@ -0,0 +1,3 @@ +use serde::{Serialize, Deserialize}; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkSessionSuccessMetadataTransferStatus(pub serde_json::Value); diff --git a/src/model/link_token_account_filters.rs b/src/model/link_token_account_filters.rs index 5e22f3fb..f3639169 100644 --- a/src/model/link_token_account_filters.rs +++ b/src/model/link_token_account_filters.rs @@ -25,4 +25,4 @@ impl std::fmt::Display for LinkTokenAccountFilters { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_card_switch.rs b/src/model/link_token_create_card_switch.rs index 89688aa8..c415278b 100644 --- a/src/model/link_token_create_card_switch.rs +++ b/src/model/link_token_create_card_switch.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for LinkTokenCreateCardSwitch { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_hosted_link.rs b/src/model/link_token_create_hosted_link.rs index af67684b..80950f26 100644 --- a/src/model/link_token_create_hosted_link.rs +++ b/src/model/link_token_create_hosted_link.rs @@ -1,16 +1,20 @@ use serde::{Serialize, Deserialize}; -///Configuration parameters for Hosted Link (beta). Only available for participants in the Hosted Link beta program. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::HostedLinkDeliveryMethod; +///Configuration parameters for Hosted Link. To enable the session for Hosted Link, send this object in the request. It can be empty. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkTokenCreateHostedLink { ///URI that Hosted Link will redirect to upon completion of the Link flow. This will only occur in Hosted Link sessions, not in other implementation methods. #[serde(default, skip_serializing_if = "Option::is_none")] pub completion_redirect_uri: Option, - /**How Plaid should deliver the Plaid Link session to the customer. + /**How Plaid should deliver the Plaid Link session to the customer. Only available to customers enabled for Link Delivery (beta). To request Link Delivery access, contact your account manager. 'sms' will deliver via SMS. Must pass `user.phone_number`. -'email' will deliver via email. Must pass `user.email_address`. In the Sandbox environment, this field will be ignored; use the Production or Development environment to test Hosted Link session delivery instead.*/ +'email' will deliver via email. Must pass `user.email_address`. In the Sandbox environment, this field will be ignored; use the Production environment to test Link Delivery instead.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub delivery_method: Option, - ///How many seconds the link will be valid for. Must be positive. Cannot be longer than 21 days. The default lifetime is 4 hours. + pub delivery_method: Option, + ///This indicates whether the client is opening hosted Link in a mobile app in an out of process web view (OOPWV) (i.e., an `AsWebAuthenticationSession` / `SFSafariViewController` or Android Custom Tab). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_mobile_app: Option, + ///How many seconds the link will be valid for. Must be positive. Cannot be longer than 21 days. The default lifetime is 7 days for links delivered by email, 1 day for links delivered via SMS, and 30 minutes for links not sent via Plaid Link delivery. This parameter will override the value of all three link types. #[serde(default, skip_serializing_if = "Option::is_none")] pub url_lifetime_seconds: Option, } @@ -18,4 +22,4 @@ impl std::fmt::Display for LinkTokenCreateHostedLink { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_identity.rs b/src/model/link_token_create_identity.rs new file mode 100644 index 00000000..d62fa024 --- /dev/null +++ b/src/model/link_token_create_identity.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +use super::IncomeVerificationDocParsingConfig; +///Identity object used to specify document upload +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkTokenCreateIdentity { + ///An array of `account_ids`. Currently can only contain one `account_id`. Must be populated if using Document Upload. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub account_ids: Option>, + ///Used to specify whether the Link session is Identity Document Upload + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_document_upload: Option, + ///An array of parsing configurations. Valid parsing configurations are `ocr` and `risk_signals`. If parsing configurations are omitted, defaults to `ocr` + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parsing_configs: Option>, +} +impl std::fmt::Display for LinkTokenCreateIdentity { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_token_create_institution_data.rs b/src/model/link_token_create_institution_data.rs index 221d32de..df82e945 100644 --- a/src/model/link_token_create_institution_data.rs +++ b/src/model/link_token_create_institution_data.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for LinkTokenCreateInstitutionData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_auth.rs b/src/model/link_token_create_request_auth.rs index 01469f67..37567fc8 100644 --- a/src/model/link_token_create_request_auth.rs +++ b/src/model/link_token_create_request_auth.rs @@ -1,34 +1,40 @@ use serde::{Serialize, Deserialize}; -///Specifies options for initializing Link for use with the Auth product. This field can be used to enable or disable extended Auth flows for the resulting Link session. Omitting any field will result in a default that can be configured by your account manager. +///Specifies options for initializing Link for use with the Auth product. This field can be used to enable or disable extended Auth flows for the resulting Link session. Omitting any field will result in a default that can be configured by your account manager. The default behavior described in the documentation is the default behavior that will apply if you have not requested your account manager to apply a different default. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenCreateRequestAuth { - ///Specifies whether Auth Type Select is enabled for the Link session, allowing the end user to choose between linking instantly or manually prior to selecting their financial institution. Note that this can only be true if `same_day_microdeposits_enabled` is set to true. + ///Specifies whether Auth Type Select is enabled for the Link session, allowing the end user to choose between linking via a credentials-based flow (i.e. Instant Auth, Instant Match, Automated Micro-deposits) or a manual flow that does not require login (all other Auth flows) prior to selecting their financial institution. Default behavior is `false`. #[serde(default, skip_serializing_if = "Option::is_none")] pub auth_type_select_enabled: Option, - ///Specifies whether the Link session is enabled for the Automated Micro-deposits flow. + ///Specifies whether the Link session is enabled for the Automated Micro-deposits flow. Default behavior is `false`. #[serde(default, skip_serializing_if = "Option::is_none")] pub automated_microdeposits_enabled: Option, - ///Specifies whether the Link session is enabled for the Database Match flow. + ///Specifies whether the Link session is enabled for the Database Insights flow. Database Insights is currently in closed beta; for access, contact your Account Manager. Default behavior is `false`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub database_insights_enabled: Option, + ///Specifies whether the Link session is enabled for the Database Match flow. Default behavior is `false`. #[serde(default, skip_serializing_if = "Option::is_none")] pub database_match_enabled: Option, ///This field has been deprecated in favor of `auth_type_select_enabled`. #[serde(default, skip_serializing_if = "Option::is_none")] pub flow_type: Option, - ///Specifies whether the Link session is enabled for the Instant Match flow. As of November 2022, Instant Match will be enabled by default. Instant Match can be disabled by setting this field to `false`. + ///Specifies whether the Link session is enabled for the Instant Match flow. Instant Match is enabled by default. Instant Match can be disabled by setting this field to `false`. #[serde(default, skip_serializing_if = "Option::is_none")] pub instant_match_enabled: Option, - ///Specifies whether the Link session is enabled for the Instant Micro-deposits flow. + ///Specifies whether the Link session is enabled for the Instant Micro-deposits flow. Default behavior for Plaid teams created after November 2023 is `false`; default behavior for Plaid teams created before that date is `true`. #[serde(default, skip_serializing_if = "Option::is_none")] pub instant_microdeposits_enabled: Option, - ///Specifies what type of [Reroute to Credentials](https://plaid.com/docs/auth/coverage/same-day/#reroute-to-credentials) pane should be used in the Link session for the Same Day Micro-deposits flow. As of October 15 2023, the default setting is `OPTIONAL`. + ///Specifies what type of [Reroute to Credentials](https://plaid.com/docs/auth/coverage/same-day/#reroute-to-credentials) pane should be used in the Link session for the Same Day Micro-deposits flow. Default behavior is `OPTIONAL`. #[serde(default, skip_serializing_if = "Option::is_none")] pub reroute_to_credentials: Option, - ///Specifies whether the Link session is enabled for the Same Day Micro-deposits flow. + ///Specifies whether the Link session is enabled for the Same Day Micro-deposits flow. Default behavior is `false`. #[serde(default, skip_serializing_if = "Option::is_none")] pub same_day_microdeposits_enabled: Option, + ///Specifies whether the Link session is enabled for SMS micro-deposits verification. Default behavior is `true`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sms_microdeposits_verification_enabled: Option, } impl std::fmt::Display for LinkTokenCreateRequestAuth { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_base_report.rs b/src/model/link_token_create_request_base_report.rs index 5d2f96d6..15310165 100644 --- a/src/model/link_token_create_request_base_report.rs +++ b/src/model/link_token_create_request_base_report.rs @@ -2,6 +2,9 @@ use serde::{Serialize, Deserialize}; ///Specifies options for initializing Link for use with the Base Report product. This field is required if `assets` is included in the `products` array and the client is CRA-enabled. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenCreateRequestBaseReport { + ///Client-generated identifier, which can be used by lenders to track loan applications. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub client_report_id: Option, ///The maximum integer number of days of history to include in the Base Report. pub days_requested: i64, } @@ -9,4 +12,4 @@ impl std::fmt::Display for LinkTokenCreateRequestBaseReport { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_cra_options.rs b/src/model/link_token_create_request_cra_options.rs new file mode 100644 index 00000000..21d80505 --- /dev/null +++ b/src/model/link_token_create_request_cra_options.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +use super::{ + LinkTokenCreateRequestCraOptionsBaseReport, + LinkTokenCreateRequestCraOptionsCashflowInsights, + LinkTokenCreateRequestCraOptionsPartnerInsights, +}; +///Specifies options for initializing Link for use with Plaid Check products +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct LinkTokenCreateRequestCraOptions { + ///Specifies options for initializing Link for use with the Base Report product. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub base_report: Option, + ///Specifies options for initializing Link for use with the Cashflow Insights product. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cashflow_insights: Option, + ///The number of days of history to include in Plaid Check products. Default value is 365; maximum is 730; minimum is 180. If a value lower than 180 is provided, a minimum of 180 days of history will be requested. + pub days_requested: i64, + ///The minimum number of days of data required for the report to be successfully generated. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_required: Option, + ///Specifies options for initializing Link for use with the Credit Partner Insights product. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub partner_insights: Option, +} +impl std::fmt::Display for LinkTokenCreateRequestCraOptions { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_token_create_request_cra_options_base_report.rs b/src/model/link_token_create_request_cra_options_base_report.rs new file mode 100644 index 00000000..14664692 --- /dev/null +++ b/src/model/link_token_create_request_cra_options_base_report.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///Specifies options for initializing Link for use with the Base Report product. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkTokenCreateRequestCraOptionsBaseReport { + ///Client-generated identifier, which can be used by lenders to track loan applications. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub client_report_id: Option, +} +impl std::fmt::Display for LinkTokenCreateRequestCraOptionsBaseReport { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_token_create_request_cra_options_cashflow_insights.rs b/src/model/link_token_create_request_cra_options_cashflow_insights.rs new file mode 100644 index 00000000..a844b2a2 --- /dev/null +++ b/src/model/link_token_create_request_cra_options_cashflow_insights.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::CashflowAttributesVersion; +///Specifies options for initializing Link for use with the Cashflow Insights product. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct LinkTokenCreateRequestCraOptionsCashflowInsights { + ///The versions of cashflow attributes + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attributes_version: Option, + ///The version of the Plaid Check score to return + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plaid_check_score_version: Option, +} +impl std::fmt::Display for LinkTokenCreateRequestCraOptionsCashflowInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_token_create_request_cra_options_partner_insights.rs b/src/model/link_token_create_request_cra_options_partner_insights.rs new file mode 100644 index 00000000..17c69305 --- /dev/null +++ b/src/model/link_token_create_request_cra_options_partner_insights.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::{PrismProduct, PrismVersions}; +///Specifies options for initializing Link for use with the Credit Partner Insights product. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkTokenCreateRequestCraOptionsPartnerInsights { + ///The specific Prism products to return. If none are passed in, then all products will be returned. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub prism_products: Option>, + ///The versions of Prism products to evaluate + #[serde(default, skip_serializing_if = "Option::is_none")] + pub prism_versions: Option, +} +impl std::fmt::Display for LinkTokenCreateRequestCraOptionsPartnerInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_token_create_request_credit_partner_insights.rs b/src/model/link_token_create_request_credit_partner_insights.rs new file mode 100644 index 00000000..d9031d23 --- /dev/null +++ b/src/model/link_token_create_request_credit_partner_insights.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::PrismProduct; +///Specifies options for initializing Link for use with the Credit Partner Insights product. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkTokenCreateRequestCreditPartnerInsights { + ///The maximum integer number of days of history to compute Credit Partner Insights. Defaults to 180 if not specified + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_requested: Option, + ///The specific Prism products to return. If none are passed in, then all products will be returned. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub prism_products: Option>, +} +impl std::fmt::Display for LinkTokenCreateRequestCreditPartnerInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_token_create_request_deposit_switch.rs b/src/model/link_token_create_request_deposit_switch.rs index e1509713..2c569ea3 100644 --- a/src/model/link_token_create_request_deposit_switch.rs +++ b/src/model/link_token_create_request_deposit_switch.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///Specifies options for initializing Link for use with the Deposit Switch (beta) product. This field is required if `deposit_switch` is included in the `products` array. +///(Deprecated) Specifies options for initializing Link for use with the Deposit Switch (beta) product. This field is required if `deposit_switch` is included in the `products` array. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenCreateRequestDepositSwitch { ///The `deposit_switch_id` provided by the `/deposit_switch/create` endpoint. @@ -9,4 +9,4 @@ impl std::fmt::Display for LinkTokenCreateRequestDepositSwitch { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_employment.rs b/src/model/link_token_create_request_employment.rs index 1f93276f..b152fc60 100644 --- a/src/model/link_token_create_request_employment.rs +++ b/src/model/link_token_create_request_employment.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -use super::LinkTokenCreateRequestEmploymentBankIncome; +use super::{EmploymentSourceType, LinkTokenCreateRequestEmploymentBankIncome}; ///Specifies options for initializing Link for use with the Employment product. This field is required if `employment` is included in the `products` array. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenCreateRequestEmployment { @@ -8,10 +8,10 @@ pub struct LinkTokenCreateRequestEmployment { pub bank_employment: Option, ///The types of source employment data that users will be permitted to share. Options include `bank` and `payroll`. Currently you can only specify one of these options. #[serde(default, skip_serializing_if = "Option::is_none")] - pub employment_source_types: Option>, + pub employment_source_types: Option>, } impl std::fmt::Display for LinkTokenCreateRequestEmployment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_employment_bank_income.rs b/src/model/link_token_create_request_employment_bank_income.rs index df1f90f9..36a2d765 100644 --- a/src/model/link_token_create_request_employment_bank_income.rs +++ b/src/model/link_token_create_request_employment_bank_income.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for LinkTokenCreateRequestEmploymentBankIncome { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_identity_verification.rs b/src/model/link_token_create_request_identity_verification.rs index 5d31b408..d1773b42 100644 --- a/src/model/link_token_create_request_identity_verification.rs +++ b/src/model/link_token_create_request_identity_verification.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for LinkTokenCreateRequestIdentityVerification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_income_verification.rs b/src/model/link_token_create_request_income_verification.rs index 75ed2cfa..1a1d5f92 100644 --- a/src/model/link_token_create_request_income_verification.rs +++ b/src/model/link_token_create_request_income_verification.rs @@ -1,6 +1,6 @@ use serde::{Serialize, Deserialize}; use super::{ - LinkTokenCreateRequestIncomeVerificationBankIncome, + IncomeVerificationSourceType, LinkTokenCreateRequestIncomeVerificationBankIncome, LinkTokenCreateRequestIncomeVerificationPayrollIncome, LinkTokenCreateRequestUserStatedIncomeSource, }; @@ -20,8 +20,8 @@ This field should only be used with the `payroll` income source type.*/ pub bank_income: Option, ///The types of source income data that users will be permitted to share. Options include `bank` and `payroll`. Currently you can only specify one of these options. #[serde(default, skip_serializing_if = "Option::is_none")] - pub income_source_types: Option>, - ///The `income_verification_id` of the verification instance, as provided by `/income/verification/create`. + pub income_source_types: Option>, + ///The `income_verification_id` of the verification instance, as provided by `/income/verification/create`. Replaced by the user token. #[serde(default, skip_serializing_if = "Option::is_none")] pub income_verification_id: Option, ///Specifies options for initializing Link for use with Payroll Income (including Document Income). Further customization options for Document Income, such as customizing which document types may be uploaded, are also available via the [Link Customization pane](https://dashboard.plaid.com/link) in the Dashboard. (Requires Production enablement.) @@ -35,4 +35,4 @@ impl std::fmt::Display for LinkTokenCreateRequestIncomeVerification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_income_verification_bank_income.rs b/src/model/link_token_create_request_income_verification_bank_income.rs index 97a11b45..fa2345f3 100644 --- a/src/model/link_token_create_request_income_verification_bank_income.rs +++ b/src/model/link_token_create_request_income_verification_bank_income.rs @@ -4,7 +4,7 @@ use serde::{Serialize, Deserialize}; pub struct LinkTokenCreateRequestIncomeVerificationBankIncome { ///The number of days of data to request for the Bank Income product pub days_requested: i64, - ///Whether to enable multiple Items to be added in the Link session + ///Whether to enable multiple Items to be added in the Link session. This setting is deprecated and has been replaced by the more general `enable_multi_item_link` setting, which supports all products. #[serde(default, skip_serializing_if = "Option::is_none")] pub enable_multiple_items: Option, } @@ -12,4 +12,4 @@ impl std::fmt::Display for LinkTokenCreateRequestIncomeVerificationBankIncome { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_income_verification_payroll_income.rs b/src/model/link_token_create_request_income_verification_payroll_income.rs index ac73c4aa..592f93bc 100644 --- a/src/model/link_token_create_request_income_verification_payroll_income.rs +++ b/src/model/link_token_create_request_income_verification_payroll_income.rs @@ -1,10 +1,11 @@ use serde::{Serialize, Deserialize}; +use super::{IncomeVerificationDocParsingConfig, IncomeVerificationPayrollFlowType}; ///Specifies options for initializing Link for use with Payroll Income (including Document Income). Further customization options for Document Income, such as customizing which document types may be uploaded, are also available via the [Link Customization pane](https://dashboard.plaid.com/link) in the Dashboard. (Requires Production enablement.) #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenCreateRequestIncomeVerificationPayrollIncome { ///The types of payroll income verification to enable for the Link session. If none are specified, then users will see both document and digital payroll income. #[serde(default, skip_serializing_if = "Option::is_none")] - pub flow_types: Option>, + pub flow_types: Option>, ///An identifier to indicate whether the income verification Link token will be used for update mode. This field is only relevant for participants in the Payroll Income Refresh beta. #[serde(default, skip_serializing_if = "Option::is_none")] pub is_update_mode: Option, @@ -13,10 +14,10 @@ pub struct LinkTokenCreateRequestIncomeVerificationPayrollIncome { pub item_id_to_update: Option, ///The types of analysis to enable for document uploads. If this field is not provided, then docs will undergo OCR parsing only. #[serde(default, skip_serializing_if = "Option::is_none")] - pub parsing_config: Option>, + pub parsing_config: Option>, } impl std::fmt::Display for LinkTokenCreateRequestIncomeVerificationPayrollIncome { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_payment_configuration.rs b/src/model/link_token_create_request_payment_configuration.rs new file mode 100644 index 00000000..2bb49ef4 --- /dev/null +++ b/src/model/link_token_create_request_payment_configuration.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///Specifies options for initializing Link for use with the Pay By Bank flow. This is an optional field to configure the user experience, and currently requires the amount field to be set. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LinkTokenCreateRequestPaymentConfiguration { + ///The amount of the transfer (decimal string with two digits of precision e.g. "10.00"). + pub amount: String, + ///The description of the transfer that provides the payment context. The max length is 256. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, +} +impl std::fmt::Display for LinkTokenCreateRequestPaymentConfiguration { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/link_token_create_request_payment_initiation.rs b/src/model/link_token_create_request_payment_initiation.rs index f428de57..c491a18c 100644 --- a/src/model/link_token_create_request_payment_initiation.rs +++ b/src/model/link_token_create_request_payment_initiation.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for LinkTokenCreateRequestPaymentInitiation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_statements.rs b/src/model/link_token_create_request_statements.rs index 8b6d42b7..1c850f36 100644 --- a/src/model/link_token_create_request_statements.rs +++ b/src/model/link_token_create_request_statements.rs @@ -1,16 +1,14 @@ use serde::{Serialize, Deserialize}; -///Specifies options for initializing Link for use with the Statements product. +///Specifies options for initializing Link for use with the Statements product. This field is required for the statements product. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenCreateRequestStatements { - ///The end date for statements, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) “YYYY-MM-DD” format, e.g. "2020-10-30". If no value is provided, this will default to the current date. You can request up to two years of data. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, - ///The start date for statements, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) “YYYY-MM-DD” format, e.g. "2020-10-30". If no value is provided, this will default to 3 months prior to the current date. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, + ///The end date for statements, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) "YYYY-MM-DD" format, e.g. "2020-10-30". You can request up to two years of data. + pub end_date: chrono::NaiveDate, + ///The start date for statements, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) "YYYY-MM-DD" format, e.g. "2020-10-30". + pub start_date: chrono::NaiveDate, } impl std::fmt::Display for LinkTokenCreateRequestStatements { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_transfer.rs b/src/model/link_token_create_request_transfer.rs index ed3771f3..b522c3b3 100644 --- a/src/model/link_token_create_request_transfer.rs +++ b/src/model/link_token_create_request_transfer.rs @@ -2,6 +2,9 @@ use serde::{Serialize, Deserialize}; ///Specifies options for initializing Link for use with the Transfer product. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenCreateRequestTransfer { + ///The `id` returned by the `/transfer/authorization/create` endpoint. Used to indicate Link session to complete required user action in order to make a decision for the authorization. If set, `access_token` can be omitted. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorization_id: Option, ///The `id` returned by the `/transfer/intent/create` endpoint. #[serde(default, skip_serializing_if = "Option::is_none")] pub intent_id: Option, @@ -13,4 +16,4 @@ impl std::fmt::Display for LinkTokenCreateRequestTransfer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_update.rs b/src/model/link_token_create_request_update.rs index 60c842bb..b089377b 100644 --- a/src/model/link_token_create_request_update.rs +++ b/src/model/link_token_create_request_update.rs @@ -2,12 +2,21 @@ use serde::{Serialize, Deserialize}; ///Specifies options for initializing Link for [update mode](https://plaid.com/docs/link/update-mode). #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenCreateRequestUpdate { - ///If `true`, enables [update mode with Account Select](https://plaid.com/docs/link/update-mode/#using-update-mode-to-request-new-accounts) for institutions that do not use OAuth, or that use OAuth but do not have their own account selection flow. For institutions that have an OAuth account selection flow (i.e. most OAuth-enabled institutions), update mode with Account Select will always be enabled, regardless of the value of this field. + ///If `true`, enables [update mode with Account Select](https://plaid.com/docs/link/update-mode/#using-update-mode-to-request-new-accounts) for institutions in the US and Canada that do not use OAuth, or that use OAuth but do not have their own account selection flow. For institutions in the US that have an OAuth account selection flow (i.e. most OAuth-enabled institutions), update mode with Account Select will always be enabled, regardless of the value of this field. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_selection_enabled: Option, + ///An array of `item_id`s associated with the user to be updated in update mode. If empty or `null`, this field will default to initializing update mode for the most recent unhealthy Item associated with the user. A `user_token` must also be provided to use this field. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item_ids: Option>, + ///By default, Plaid will enable the reauthorization flow during update mode for an Item enabled for [Data Transparency Messaging](https://plaid.com/docs/link/data-transparency-messaging-migration-guide/) if the Item expires within six months. During a reauthorization flow, an end user will review Plaid's end user privacy policy, use case and data scope consents, and account access consents; they may also be required to log in to their financial institution's OAuth flow. After the end user successfully completes the reauthorization flow, the Item's expiration date will be extended to 12 months from the time that the reauthorization took place. This field allows you to optionally override the default reauthorization scheduling logic to either forcibly enable or disable the reauthorization flow for a given update mode session. This field does not impact the flow for Items at institutions in the EU or UK. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reauthorization_enabled: Option, + ///If `true`, a `user_token` must also be provided, and Link will open in update mode for the given user. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user: Option, } impl std::fmt::Display for LinkTokenCreateRequestUpdate { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_user.rs b/src/model/link_token_create_request_user.rs index 9e8ffa13..59a2a70f 100644 --- a/src/model/link_token_create_request_user.rs +++ b/src/model/link_token_create_request_user.rs @@ -9,7 +9,7 @@ pub struct LinkTokenCreateRequestUser { ///To be provided in the format "yyyy-mm-dd". Can be used to prefill Link fields when used with Identity Verification. #[serde(default, skip_serializing_if = "Option::is_none")] pub date_of_birth: Option, - ///The user's email address. This field is optional, but required to enable the [pre-authenticated returning user flow](https://plaid.com/docs/link/returning-user/#pre-authenticated-rux). Can also be used to prefill Link fields when used with Identity Verification. + ///The user's email address. Can be used to prefill Link fields when used with [Identity Verification](https://www.plaid.com/docs/identity-verification). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, /**The date and time the email address was verified in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDThh:mm:ssZ`). This was previously an optional field used in the [returning user experience](https://plaid.com/docs/link/returning-user). This field is no longer required to enable the returning user experience. @@ -26,7 +26,7 @@ pub struct LinkTokenCreateRequestUser { pub legal_name: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - ///The user's phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. This field is optional, but required to enable the [returning user experience](https://plaid.com/docs/link/returning-user). Can also be used to prefill Link fields when used with Identity Verification. + ///The user's phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. If supplied, will be used when applicable to prefill phone number fields in Link for the [returning user flow](https://www.plaid.com/docs/link/returning-user) and the [Identity Verification flow](https://www.plaid.com/docs/identity-verification). #[serde(default, skip_serializing_if = "Option::is_none")] pub phone_number: Option, /**The date and time the phone number was verified in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDThh:mm:ssZ`). This was previously an optional field used in the [returning user experience](https://plaid.com/docs/link/returning-user). This field is no longer required to enable the returning user experience. @@ -44,4 +44,4 @@ impl std::fmt::Display for LinkTokenCreateRequestUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_request_user_stated_income_source.rs b/src/model/link_token_create_request_user_stated_income_source.rs index b27d1c85..fd130728 100644 --- a/src/model/link_token_create_request_user_stated_income_source.rs +++ b/src/model/link_token_create_request_user_stated_income_source.rs @@ -1,10 +1,14 @@ use serde::{Serialize, Deserialize}; +use super::{ + UserStatedIncomeSourceCategory, UserStatedIncomeSourceFrequency, + UserStatedIncomeSourcePayType, +}; ///Specifies user stated income sources for the Income product -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkTokenCreateRequestUserStatedIncomeSource { ///The income category for a specified income source #[serde(default, skip_serializing_if = "Option::is_none")] - pub category: Option, + pub category: Option, ///The employer corresponding to an income source specified by the user #[serde(default, skip_serializing_if = "Option::is_none")] pub employer: Option, @@ -13,16 +17,16 @@ pub struct LinkTokenCreateRequestUserStatedIncomeSource { pub pay_annual: Option, ///The pay frequency of a specified income source #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_frequency: Option, + pub pay_frequency: Option, ///The income amount paid per cycle for a specified income source #[serde(default, skip_serializing_if = "Option::is_none")] pub pay_per_cycle: Option, ///The pay type - `GROSS`, `NET`, or `UNKNOWN` for a specified income source #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_type: Option, + pub pay_type: Option, } impl std::fmt::Display for LinkTokenCreateRequestUserStatedIncomeSource { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_create_response.rs b/src/model/link_token_create_response.rs index e9d32c1e..fbbaabb5 100644 --- a/src/model/link_token_create_response.rs +++ b/src/model/link_token_create_response.rs @@ -2,9 +2,9 @@ use serde::{Serialize, Deserialize}; ///LinkTokenCreateResponse defines the response schema for `/link/token/create` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenCreateResponse { - ///The expiration date for the `link_token`, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. A `link_token` created to generate a `public_token` that will be exchanged for a new `access_token` expires after 4 hours. A `link_token` created for an existing Item (such as when updating an existing `access_token` by launching Link in update mode) expires after 30 minutes. + ///The expiration date for the `link_token`, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. By default, a `link_token` created to generate a `public_token` that will be exchanged for a new `access_token` expires after 4 hours, and a `link_token` created for an existing Item (such as when updating an existing `access_token` by launching Link in update mode) expires after 30 minutes. If using [Hosted Link](https://plaid.com/docs/link/hosted-link/), the `link_token` will expire at the same time as the Hosted Link URL, and you can customize the duration using the `hosted_link.url_lifetime_seconds` option in the request. If using Link Delivery (beta), the `link_token` will expire by default after 24 hours if sent via SMS and after 7 days if sent via email. pub expiration: chrono::DateTime, - ///A URL of a Plaid-hosted Link flow that will use the Link token returned by this request. Only present if the client is enabled for Hosted Link (beta). + ///A URL of a Plaid-hosted Link flow that will use the Link token returned by this request. Only present if the session is enabled for Hosted Link. To enable the session for Hosted Link, send a `hosted_link` object in the request. #[serde(default, skip_serializing_if = "Option::is_none")] pub hosted_link_url: Option, ///A `link_token`, which can be supplied to Link in order to initialize it and receive a `public_token`, which can be exchanged for an `access_token`. @@ -16,4 +16,4 @@ impl std::fmt::Display for LinkTokenCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_eu_config.rs b/src/model/link_token_eu_config.rs index 622f9da2..39a02b59 100644 --- a/src/model/link_token_eu_config.rs +++ b/src/model/link_token_eu_config.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for LinkTokenEuConfig { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_get_metadata_response.rs b/src/model/link_token_get_metadata_response.rs index 6e732302..0b286834 100644 --- a/src/model/link_token_get_metadata_response.rs +++ b/src/model/link_token_get_metadata_response.rs @@ -1,5 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{AccountFiltersResponse, LinkTokenCreateInstitutionData}; +use super::{ + AccountFiltersResponse, CountryCode, LinkTokenCreateInstitutionData, Products, +}; ///An object specifying the arguments originally provided to the `/link/token/create` call. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenGetMetadataResponse { @@ -11,10 +13,10 @@ pub struct LinkTokenGetMetadataResponse { pub client_name: Option, ///The `country_codes` specified in the `/link/token/create` call. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub country_codes: Vec, + pub country_codes: Vec, ///The `products` specified in the `/link/token/create` call. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub initial_products: Vec, + pub initial_products: Vec, ///A map containing data used to highlight institutions in Link. #[serde(default, skip_serializing_if = "Option::is_none")] pub institution_data: Option, @@ -24,6 +26,9 @@ pub struct LinkTokenGetMetadataResponse { ///The `redirect_uri` specified in the `/link/token/create` call. #[serde(default, skip_serializing_if = "Option::is_none")] pub redirect_uri: Option, + ///The user token associated with the User data is being requested for. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user_token: Option, ///The `webhook` specified in the `/link/token/create` call. #[serde(default, skip_serializing_if = "Option::is_none")] pub webhook: Option, @@ -32,4 +37,4 @@ impl std::fmt::Display for LinkTokenGetMetadataResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_get_response.rs b/src/model/link_token_get_response.rs index 409f2191..51c919e9 100644 --- a/src/model/link_token_get_response.rs +++ b/src/model/link_token_get_response.rs @@ -9,7 +9,7 @@ pub struct LinkTokenGetResponse { ///The expiration timestamp for the `link_token`, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. #[serde(default, skip_serializing_if = "Option::is_none")] pub expiration: Option>, - ///Information about Link sessions created using this `link_token`. This field will only be present if your client is enabled for Hosted Link (beta). Session data will be provided for up to six hours after the session has ended. + ///Information about Link sessions created using this `link_token`. Session data will be provided for up to six hours after the session has ended. #[serde(default, skip_serializing_if = "Option::is_none")] pub link_sessions: Option>, ///A `link_token`, which can be supplied to Link in order to initialize it and receive a `public_token`, which can be exchanged for an `access_token`. @@ -23,4 +23,4 @@ impl std::fmt::Display for LinkTokenGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_get_sessions_response.rs b/src/model/link_token_get_sessions_response.rs index 39a674d7..74ed308c 100644 --- a/src/model/link_token_get_sessions_response.rs +++ b/src/model/link_token_get_sessions_response.rs @@ -1,19 +1,31 @@ use serde::{Serialize, Deserialize}; -use super::{LinkSessionExit, LinkSessionSuccess}; -///An object containing information about a link session. This field will only be present if your client is enabled for Hosted Link (beta). Session data will be provided for up to six hours after the session has ended. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::{ + LinkEvent, LinkSessionExit, LinkSessionExitDeprecated, LinkSessionResults, + LinkSessionSuccess, +}; +///An object containing information about a link session. Session data will be provided for up to six hours after the session has ended. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkTokenGetSessionsResponse { + ///List of customer-related Link events + #[serde(default, skip_serializing_if = "Option::is_none")] + pub events: Option>, + ///An object representing an [onExit](https://plaid.com/docs/link/web/#onexit) callback from Link. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub exit: Option, ///The timestamp at which the link session was finished, if available, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. #[serde(default, skip_serializing_if = "Option::is_none")] pub finished_at: Option>, ///The unique ID for the link session. pub link_session_id: String, - ///An object representing an [onExit](https://plaid.com/docs/link/web/#onexit) callback from Link. + ///An object representing an [onExit](https://plaid.com/docs/link/web/#onexit) callback from Link. This field has been deprecated in favor of [`exit`](https://plaid.com/docs/api/link/#link-token-get-response-link-sessions-exit), for improved naming consistency. #[serde(default, skip_serializing_if = "Option::is_none")] - pub on_exit: Option, - ///An object representing an [onSuccess](https://plaid.com/docs/link/web/#onsuccess) callback from Link. + pub on_exit: Option, + ///An object representing an [onSuccess](https://plaid.com/docs/link/web/#onsuccess) callback from Link. This object has been deprecated in favor of the newer [`results.item_add_result`](https://plaid.com/docs/api/link/#link-token-get-response-link-sessions-results-item-add-results), which can support multiple public tokens in a single Link session. #[serde(default, skip_serializing_if = "Option::is_none")] pub on_success: Option, + ///The set of results for a Link session. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub results: Option, ///The timestamp at which the link session was first started, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. #[serde(default, skip_serializing_if = "Option::is_none")] pub started_at: Option>, @@ -22,4 +34,4 @@ impl std::fmt::Display for LinkTokenGetSessionsResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_investments.rs b/src/model/link_token_investments.rs index a526daad..2a108577 100644 --- a/src/model/link_token_investments.rs +++ b/src/model/link_token_investments.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for LinkTokenInvestments { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_investments_auth.rs b/src/model/link_token_investments_auth.rs index 36bd2e3e..4aa849df 100644 --- a/src/model/link_token_investments_auth.rs +++ b/src/model/link_token_investments_auth.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///Configuration parameters for the Investments Auth Product +///Configuration parameters for the Investments Move product #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenInvestmentsAuth { ///If `true`, show institutions that use the manual entry fallback flow. @@ -8,9 +8,12 @@ pub struct LinkTokenInvestmentsAuth { ///If `true`, show institutions that use the masked number match fallback flow. #[serde(default, skip_serializing_if = "Option::is_none")] pub masked_number_match_enabled: Option, + ///If `true`, show institutions that use the stated account number fallback flow. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stated_account_number_enabled: Option, } impl std::fmt::Display for LinkTokenInvestmentsAuth { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_token_transactions.rs b/src/model/link_token_transactions.rs index 71ad1de4..710ea4f0 100644 --- a/src/model/link_token_transactions.rs +++ b/src/model/link_token_transactions.rs @@ -2,9 +2,9 @@ use serde::{Serialize, Deserialize}; ///Configuration parameters for the Transactions product #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LinkTokenTransactions { - /**The maximum number of days of transaction history to request for the Transactions product. For developer accounts created after December 3, 2023, if no value is specified, this will default to 90 days. For developer accounts created on December 3, 2023 or earlier, if no value is specified, this will default to 730 days until June 24, 2024, at which point it will default to 90 days. + /**The maximum number of days of transaction history to request for the Transactions product. The more transaction history is requested, the longer the historical update poll will take. The default value is 90 days. If a value under 30 is provided, a minimum of 30 days of history will be requested. Once Transactions has been added to an Item, this value cannot be updated. -We strongly recommend that customers utilizing [Recurring Transactions](https://plaid.com/docs/api/products/transactions/#transactionsrecurringget) request at least 180 days of history for optimal results.*/ +Customers using [Recurring Transactions](https://plaid.com/docs/api/products/transactions/#transactionsrecurringget) should request at least 180 days of history for optimal results.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub days_requested: Option, } @@ -12,4 +12,4 @@ impl std::fmt::Display for LinkTokenTransactions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/link_user_delivery_status_webhook.rs b/src/model/link_user_delivery_status_webhook.rs index 83cb4657..7d5bb1d8 100644 --- a/src/model/link_user_delivery_status_webhook.rs +++ b/src/model/link_user_delivery_status_webhook.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::LinkDeliveryMetadata; ///Webhook indicating that the status of the delivery of the Hosted Link session to a user -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LinkUserDeliveryStatusWebhook { ///Information related to the related to the delivery of the link session to users pub link_delivery_metadata: LinkDeliveryMetadata, @@ -18,4 +18,4 @@ impl std::fmt::Display for LinkUserDeliveryStatusWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/loan.rs b/src/model/loan.rs index f2234a68..007c66c4 100644 --- a/src/model/loan.rs +++ b/src/model/loan.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::LoanIdentifiers; ///Information specific to a mortgage loan agreement between one or more borrowers and a mortgage lender. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Loan { ///Collection of current and previous identifiers for this loan. #[serde(rename = "LOAN_IDENTIFIERS")] @@ -11,4 +11,4 @@ impl std::fmt::Display for Loan { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/loan_account_subtype.rs b/src/model/loan_account_subtype.rs new file mode 100644 index 00000000..10ecbb36 --- /dev/null +++ b/src/model/loan_account_subtype.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +///Valid account subtypes for loan accounts. For a list containing descriptions of each subtype, see [Account schemas](https://plaid.com/docs/api/accounts/#StandaloneAccountType-loan). +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum LoanAccountSubtype { + #[serde(rename = "auto")] + Auto, + #[serde(rename = "business")] + Business, + #[serde(rename = "commercial")] + Commercial, + #[serde(rename = "construction")] + Construction, + #[serde(rename = "consumer")] + Consumer, + #[serde(rename = "home equity")] + HomeEquity, + #[serde(rename = "loan")] + Loan, + #[serde(rename = "mortgage")] + Mortgage, + #[serde(rename = "line of credit")] + LineOfCredit, + #[serde(rename = "student")] + Student, + #[serde(rename = "other")] + Other, + #[serde(rename = "all")] + All, +} diff --git a/src/model/loan_account_subtypes.rs b/src/model/loan_account_subtypes.rs new file mode 100644 index 00000000..8b20d669 --- /dev/null +++ b/src/model/loan_account_subtypes.rs @@ -0,0 +1,4 @@ +use serde::{Serialize, Deserialize}; +use super::LoanAccountSubtype; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LoanAccountSubtypes(pub Vec); diff --git a/src/model/loan_filter.rs b/src/model/loan_filter.rs index 68df36fe..73a90cfd 100644 --- a/src/model/loan_filter.rs +++ b/src/model/loan_filter.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; +use super::LoanAccountSubtypes; ///A filter to apply to `loan`-type accounts #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct LoanFilter { ///An array of account subtypes to display in Link. If not specified, all account subtypes will be shown. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub account_subtypes: Vec, + pub account_subtypes: LoanAccountSubtypes, } impl std::fmt::Display for LoanFilter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/loan_identifier.rs b/src/model/loan_identifier.rs index 4c1f579b..31ab365a 100644 --- a/src/model/loan_identifier.rs +++ b/src/model/loan_identifier.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::LoanIdentifierType; ///The information used to identify this loan by various parties to the transaction or other organizations. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LoanIdentifier { ///The value of the identifier for the specified type. #[serde(rename = "LoanIdentifier")] @@ -9,10 +10,10 @@ pub struct LoanIdentifier { ///A value from a MISMO prescribed list that specifies the type of loan identifier. #[serde(rename = "LoanIdentifierType")] #[serde(default, skip_serializing_if = "Option::is_none")] - pub loan_identifier_type: Option, + pub loan_identifier_type: Option, } impl std::fmt::Display for LoanIdentifier { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/loan_identifier_type.rs b/src/model/loan_identifier_type.rs new file mode 100644 index 00000000..50292abb --- /dev/null +++ b/src/model/loan_identifier_type.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///A value from a MISMO prescribed list that specifies the type of loan identifier. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum LoanIdentifierType { + LenderLoan, + UniversalLoan, +} diff --git a/src/model/loan_identifiers.rs b/src/model/loan_identifiers.rs index e9eeb5d0..6f468c6d 100644 --- a/src/model/loan_identifiers.rs +++ b/src/model/loan_identifiers.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::LoanIdentifier; ///Collection of current and previous identifiers for this loan. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct LoanIdentifiers { ///The information used to identify this loan by various parties to the transaction or other organizations. #[serde(rename = "LOAN_IDENTIFIER")] @@ -11,4 +11,4 @@ impl std::fmt::Display for LoanIdentifiers { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/loan_payments_counts.rs b/src/model/loan_payments_counts.rs new file mode 100644 index 00000000..302d4c72 --- /dev/null +++ b/src/model/loan_payments_counts.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///Details regarding the number of loan payments +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LoanPaymentsCounts { + ///The number of loan payments made in the 30 days before the subscription date + pub baseline_count: f64, + ///The current number of loan payments made in the last 30 days + pub current_count: f64, +} +impl std::fmt::Display for LoanPaymentsCounts { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/loan_payments_merchant_counts.rs b/src/model/loan_payments_merchant_counts.rs new file mode 100644 index 00000000..5a174fdd --- /dev/null +++ b/src/model/loan_payments_merchant_counts.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///Details regarding the number of unique loan payment merchants +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct LoanPaymentsMerchantCounts { + ///The number of unique loan payment merchants detected in the 30 days before the subscription date + pub baseline_count: f64, + ///The current number of unique loan payment merchants detected in the last 30 days + pub current_count: f64, +} +impl std::fmt::Display for LoanPaymentsMerchantCounts { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/loans.rs b/src/model/loans.rs index e299ce49..fe743623 100644 --- a/src/model/loans.rs +++ b/src/model/loans.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::Loan; ///A collection of loans that are part of a single deal. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Loans { ///Information specific to a mortgage loan agreement between one or more borrowers and a mortgage lender. #[serde(rename = "LOAN")] @@ -11,4 +11,4 @@ impl std::fmt::Display for Loans { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/location.rs b/src/model/location.rs index 13319ed3..8e0b9b02 100644 --- a/src/model/location.rs +++ b/src/model/location.rs @@ -31,4 +31,4 @@ impl std::fmt::Display for Location { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/match_summary.rs b/src/model/match_summary.rs index 86ad11d6..bdcd8fc2 100644 --- a/src/model/match_summary.rs +++ b/src/model/match_summary.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::MatchSummaryCode; ///Summary object reflecting the match result of the associated data -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct MatchSummary { /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -14,10 +15,10 @@ pub struct MatchSummary { `no_data` indicates that Plaid was unable to find external data to compare against the provided input data. `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ - pub summary: String, + pub summary: MatchSummaryCode, } impl std::fmt::Display for MatchSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/match_summary_code.rs b/src/model/match_summary_code.rs new file mode 100644 index 00000000..23bbbd75 --- /dev/null +++ b/src/model/match_summary_code.rs @@ -0,0 +1,26 @@ +use serde::{Serialize, Deserialize}; +/**An enum indicating the match type between data provided by user and data checked against an external data source. + + +`match` indicates that the provided input data was a strong match against external data. + +`partial_match` indicates the data approximately matched against external data. For example, "Knope" vs. "Knope-Wyatt" for last name. + +`no_match` indicates that Plaid was able to perform a check against an external data source and it did not match the provided input data. + +`no_data` indicates that Plaid was unable to find external data to compare against the provided input data. + +`no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum MatchSummaryCode { + #[serde(rename = "match")] + Match, + #[serde(rename = "partial_match")] + PartialMatch, + #[serde(rename = "no_match")] + NoMatch, + #[serde(rename = "no_data")] + NoData, + #[serde(rename = "no_input")] + NoInput, +} diff --git a/src/model/merchant_insights.rs b/src/model/merchant_insights.rs index 3f4a09d6..505a6ea5 100644 --- a/src/model/merchant_insights.rs +++ b/src/model/merchant_insights.rs @@ -27,4 +27,4 @@ impl std::fmt::Display for MerchantInsights { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/meta.rs b/src/model/meta.rs index 3492122a..9e7d66f8 100644 --- a/src/model/meta.rs +++ b/src/model/meta.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for Meta { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model.rs b/src/model/mod.rs similarity index 68% rename from src/model.rs rename to src/model/mod.rs index ef0e1949..40c55145 100644 --- a/src/model.rs +++ b/src/model/mod.rs @@ -1,24 +1,36 @@ +pub use ach_class::*; pub use apr::*; pub use account_access::*; pub use account_assets::*; pub use account_balance::*; pub use account_base::*; pub use account_filters_response::*; +pub use account_holder_category::*; pub use account_identity::*; +pub use account_identity_document_upload::*; pub use account_identity_match_score::*; +pub use account_ids_with_updated_auth::*; pub use account_ids_with_updated_identity::*; pub use account_product_access::*; pub use account_subtype::*; +pub use account_type::*; +pub use account_verification_insights::*; +pub use account_verification_insights_account_number_format::*; +pub use account_verification_insights_network_status::*; +pub use account_verification_insights_previous_returns::*; pub use accounts_balance_get_request_options::*; pub use accounts_balance_get_request_payment_details::*; pub use accounts_balance_get_response_payment_risk_assessment::*; pub use accounts_get_request_options::*; pub use accounts_get_response::*; +pub use action_state::*; pub use activity::*; +pub use activity_type::*; pub use address::*; pub use address_data::*; pub use address_data_not_required::*; pub use address_match_score::*; +pub use address_purpose_label::*; pub use application::*; pub use application_get_response::*; pub use asset::*; @@ -28,6 +40,8 @@ pub use asset_holder_name::*; pub use asset_owner::*; pub use asset_owners::*; pub use asset_report::*; +pub use asset_report_account_balance::*; +pub use asset_report_add_ons::*; pub use asset_report_audit_copy_create_response::*; pub use asset_report_audit_copy_remove_response::*; pub use asset_report_create_request_options::*; @@ -44,21 +58,32 @@ pub use asset_report_refresh_request_options::*; pub use asset_report_refresh_response::*; pub use asset_report_remove_response::*; pub use asset_report_transaction::*; +pub use asset_report_transaction_type::*; +pub use asset_report_type::*; pub use asset_report_user::*; pub use asset_transaction::*; +pub use asset_transaction_category_type::*; pub use asset_transaction_description::*; pub use asset_transaction_detail::*; +pub use asset_transaction_type::*; pub use asset_transactions::*; +pub use asset_type::*; pub use assets::*; pub use assets_error_webhook::*; pub use assets_product_ready_webhook::*; +pub use auth_default_update_webhook::*; pub use auth_get_numbers::*; pub use auth_get_request_options::*; pub use auth_get_response::*; pub use auth_metadata::*; pub use auth_supported_methods::*; +pub use auth_update_types::*; pub use automatically_verified_webhook::*; +pub use balance_plus_attributes::*; +pub use balance_plus_risk_level::*; +pub use bank_income_complete_result::*; pub use bank_income_complete_webhook::*; +pub use bank_income_refresh_complete_result::*; pub use bank_income_refresh_complete_webhook::*; pub use bank_income_refresh_update_webhook::*; pub use bank_initiated_return_risk::*; @@ -73,35 +98,55 @@ pub use bank_transfer_event_list_bank_transfer_type::*; pub use bank_transfer_event_list_direction::*; pub use bank_transfer_event_list_response::*; pub use bank_transfer_event_sync_response::*; +pub use bank_transfer_event_type::*; pub use bank_transfer_failure::*; pub use bank_transfer_get_response::*; pub use bank_transfer_list_response::*; pub use bank_transfer_metadata::*; pub use bank_transfer_migrate_account_response::*; +pub use bank_transfer_network::*; +pub use bank_transfer_status::*; pub use bank_transfer_sweep::*; pub use bank_transfer_sweep_get_response::*; pub use bank_transfer_sweep_list_response::*; +pub use bank_transfer_type::*; pub use bank_transfer_user::*; pub use bank_transfers_events_update_webhook::*; pub use base_report::*; pub use base_report_account::*; pub use base_report_account_balances::*; pub use base_report_account_insights::*; +pub use base_report_account_metadata::*; +pub use base_report_attributes::*; pub use base_report_average_flow_insights::*; -pub use base_report_get_response::*; +pub use base_report_average_monthly_balances::*; +pub use base_report_historical_balance::*; pub use base_report_item::*; pub use base_report_longest_gap_insights::*; pub use base_report_number_flow_insights::*; pub use base_report_transaction::*; +pub use base_report_transaction_type::*; pub use base_report_warning::*; +pub use base_report_warning_code::*; pub use base_reports_error_webhook::*; pub use base_reports_product_ready_webhook::*; +pub use beacon_account_risk_attributes::*; +pub use beacon_account_risk_evaluate_account::*; +pub use beacon_account_risk_evaluate_account_attributes::*; +pub use beacon_account_risk_evaluate_evaluation_reason::*; +pub use beacon_account_risk_evaluate_request_options::*; +pub use beacon_account_risk_evaluate_response::*; pub use beacon_audit_trail::*; +pub use beacon_audit_trail_source::*; +pub use beacon_bank_account_insights::*; +pub use beacon_bank_accounts::*; pub use beacon_duplicate_detected_webhook::*; pub use beacon_duplicate_get_response::*; pub use beacon_match_summary_analysis::*; +pub use beacon_match_summary_code::*; pub use beacon_report::*; pub use beacon_report_create_response::*; +pub use beacon_report_create_type::*; pub use beacon_report_created_webhook::*; pub use beacon_report_get_response::*; pub use beacon_report_list_response::*; @@ -111,21 +156,30 @@ pub use beacon_report_syndication_created_webhook::*; pub use beacon_report_syndication_get_response::*; pub use beacon_report_syndication_list_response::*; pub use beacon_report_syndication_original_report::*; +pub use beacon_report_type::*; pub use beacon_report_updated_webhook::*; +pub use beacon_syndicated_report_depository_account_match_analysis::*; +pub use beacon_user::*; +pub use beacon_user_account_insights_get_response::*; pub use beacon_user_address::*; pub use beacon_user_create_response::*; pub use beacon_user_data::*; +pub use beacon_user_depository_account::*; pub use beacon_user_get_response::*; +pub use beacon_user_history_list_response::*; pub use beacon_user_id_number::*; pub use beacon_user_name::*; pub use beacon_user_name_nullable::*; pub use beacon_user_request_address::*; pub use beacon_user_request_address_nullable::*; pub use beacon_user_request_data::*; +pub use beacon_user_request_depository_account::*; pub use beacon_user_revision::*; +pub use beacon_user_status::*; pub use beacon_user_status_updated_webhook::*; pub use beacon_user_update_request_data::*; pub use beacon_user_update_response::*; +pub use cashflow_attributes_version::*; pub use categories_get_response::*; pub use category::*; pub use category_insight_details::*; @@ -137,14 +191,30 @@ pub use client_provided_raw_transaction::*; pub use client_provided_transaction::*; pub use client_provided_transaction_location::*; pub use connected_application::*; +pub use consent_event::*; +pub use consent_event_code::*; +pub use consent_event_initiator::*; +pub use consent_event_type::*; +pub use consent_events_get_response::*; +pub use consented_account::*; +pub use consumer_dispute::*; +pub use consumer_dispute_category::*; +pub use consumer_report_permissible_purpose::*; pub use consumer_report_user_identity::*; pub use counterparty::*; pub use counterparty_insights::*; +pub use counterparty_type::*; +pub use country_code::*; pub use cra_bank_income::*; pub use cra_bank_income_account::*; +pub use cra_bank_income_account_metadata::*; +pub use cra_bank_income_bonus_type::*; pub use cra_bank_income_cause::*; +pub use cra_bank_income_complete_result::*; pub use cra_bank_income_complete_webhook::*; +pub use cra_bank_income_create_response::*; pub use cra_bank_income_employer::*; +pub use cra_bank_income_error_webhook::*; pub use cra_bank_income_get_response::*; pub use cra_bank_income_historical_summary::*; pub use cra_bank_income_item::*; @@ -152,10 +222,58 @@ pub use cra_bank_income_source::*; pub use cra_bank_income_summary::*; pub use cra_bank_income_transaction::*; pub use cra_bank_income_warning::*; +pub use cra_bank_income_warning_code::*; +pub use cra_base_report_create_response::*; +pub use cra_base_report_get_response::*; +pub use cra_check_report_base_report_get_response::*; +pub use cra_check_report_create_response::*; +pub use cra_check_report_failed_webhook::*; +pub use cra_check_report_income_insights_get_response::*; +pub use cra_check_report_network_insights_get_response::*; +pub use cra_check_report_partner_insights_get_options::*; +pub use cra_check_report_partner_insights_get_response::*; +pub use cra_check_report_ready_webhook::*; +pub use cra_income_insights::*; +pub use cra_loan_application::*; +pub use cra_loan_application_decision::*; +pub use cra_loan_closed_status::*; +pub use cra_loan_opened_status::*; +pub use cra_loan_payment_history::*; +pub use cra_loan_payment_schedule::*; +pub use cra_loan_register::*; +pub use cra_loan_register_application::*; +pub use cra_loan_status::*; +pub use cra_loan_status_history_update::*; +pub use cra_loan_type::*; +pub use cra_loan_unregister::*; +pub use cra_loan_unregister_response::*; +pub use cra_loan_update::*; +pub use cra_loans_applications_register_response::*; +pub use cra_loans_register_response::*; +pub use cra_loans_update_response::*; +pub use cra_monitoring_insights_get_response::*; +pub use cra_monitoring_insights_item::*; +pub use cra_monitoring_insights_subscribe_response::*; +pub use cra_monitoring_insights_unsubscribe_response::*; +pub use cra_network_insights_item::*; +pub use cra_network_insights_report::*; +pub use cra_pdf_add_ons::*; +pub use cra_partner_insights::*; +pub use cra_partner_insights_complete_webhook::*; +pub use cra_partner_insights_error_webhook::*; +pub use cra_partner_insights_get_response::*; +pub use cra_partner_insights_item::*; +pub use cra_partner_insights_item_account::*; +pub use cra_partner_insights_item_account_metadata::*; +pub use cra_partner_insights_prism::*; +pub use cra_prediction_interval::*; pub use credit1099::*; pub use credit1099_filer::*; pub use credit1099_payer::*; pub use credit1099_recipient::*; +pub use credit_ach_class::*; +pub use credit_account_subtype::*; +pub use credit_account_subtypes::*; pub use credit_amount_with_currency::*; pub use credit_audit_copy_token_create_response::*; pub use credit_audit_copy_token_remove_response::*; @@ -166,19 +284,26 @@ pub use credit_bank_employment_get_response::*; pub use credit_bank_employment_item::*; pub use credit_bank_employment_report::*; pub use credit_bank_employment_warning::*; +pub use credit_bank_employment_warning_type::*; pub use credit_bank_income::*; pub use credit_bank_income_account::*; +pub use credit_bank_income_account_type::*; +pub use credit_bank_income_category::*; pub use credit_bank_income_cause::*; +pub use credit_bank_income_error_type::*; pub use credit_bank_income_get_request_options::*; pub use credit_bank_income_get_response::*; pub use credit_bank_income_historical_summary::*; pub use credit_bank_income_item::*; +pub use credit_bank_income_pay_frequency::*; pub use credit_bank_income_refresh_request_options::*; pub use credit_bank_income_refresh_response::*; pub use credit_bank_income_source::*; pub use credit_bank_income_summary::*; pub use credit_bank_income_transaction::*; pub use credit_bank_income_warning::*; +pub use credit_bank_income_warning_code::*; +pub use credit_bank_income_warning_type::*; pub use credit_bank_income_webhook_update_response::*; pub use credit_bank_statement_upload_account_owner::*; pub use credit_bank_statement_upload_account_owner_address::*; @@ -187,6 +312,7 @@ pub use credit_bank_statement_upload_bank_account_period::*; pub use credit_bank_statement_upload_item::*; pub use credit_bank_statement_upload_object::*; pub use credit_bank_statement_upload_transaction::*; +pub use credit_bank_statements_uploads_get_request_options::*; pub use credit_bank_statements_uploads_get_response::*; pub use credit_card_liability::*; pub use credit_category::*; @@ -221,6 +347,8 @@ pub use credit_pay_stub_earnings::*; pub use credit_pay_stub_employee::*; pub use credit_pay_stub_employer::*; pub use credit_pay_stub_net_pay::*; +pub use credit_pay_stub_pay_basis_type::*; +pub use credit_payroll_income_get_request_options::*; pub use credit_payroll_income_get_response::*; pub use credit_payroll_income_parsing_config_update_response::*; pub use credit_payroll_income_precheck_response::*; @@ -233,7 +361,9 @@ pub use credit_relay_refresh_response::*; pub use credit_relay_remove_response::*; pub use credit_session::*; pub use credit_session_bank_employment_result::*; +pub use credit_session_bank_employment_status::*; pub use credit_session_bank_income_result::*; +pub use credit_session_bank_income_status::*; pub use credit_session_document_income_result::*; pub use credit_session_error::*; pub use credit_session_item_add_result::*; @@ -245,6 +375,8 @@ pub use customer_initiated_return_risk::*; pub use dashboard_user::*; pub use dashboard_user_get_response::*; pub use dashboard_user_list_response::*; +pub use dashboard_user_status::*; +pub use data_sources::*; pub use date_range::*; pub use deductions::*; pub use deductions_breakdown::*; @@ -259,16 +391,23 @@ pub use deposit_switch_state_update_webhook::*; pub use deposit_switch_target_account::*; pub use deposit_switch_target_user::*; pub use deposit_switch_token_create_response::*; +pub use depository_account_subtype::*; +pub use depository_account_subtypes::*; pub use depository_filter::*; pub use detailed_originator::*; pub use detected_account::*; pub use distribution_breakdown::*; +pub use doc_type::*; pub use document_analysis::*; +pub use document_authenticity_match_code::*; +pub use document_date_of_birth_match_code::*; pub use document_metadata::*; +pub use document_name_match_code::*; pub use document_risk_signal::*; pub use document_risk_signal_institution_metadata::*; pub use document_risk_signals_object::*; pub use document_risk_summary::*; +pub use document_status::*; pub use documentary_verification::*; pub use documentary_verification_document::*; pub use earnings::*; @@ -282,12 +421,15 @@ pub use employer::*; pub use employer_verification::*; pub use employers_search_response::*; pub use employment_details::*; +pub use employment_source_type::*; pub use employment_verification::*; pub use employment_verification_get_response::*; pub use employment_verification_status::*; pub use enhancements::*; +pub use enrich_transaction_direction::*; pub use enrichments::*; pub use entity_document::*; +pub use entity_document_type::*; pub use entity_screening_hit_analysis::*; pub use entity_screening_hit_data::*; pub use entity_screening_hit_documents_items::*; @@ -300,49 +442,79 @@ pub use entity_screening_hit_urls::*; pub use entity_screening_hit_urls_items::*; pub use entity_screening_hits_phone_number_items::*; pub use entity_screening_status_updated_webhook::*; +pub use entity_watchlist_code::*; pub use entity_watchlist_program::*; pub use entity_watchlist_screening::*; pub use entity_watchlist_screening_hit::*; pub use entity_watchlist_screening_review::*; pub use entity_watchlist_screening_search_terms::*; pub use entity_watchlist_search_terms::*; +pub use expiration_date::*; +pub use extended_recipient_metadata::*; pub use external_payment_initiation_consent_options::*; pub use external_payment_options::*; pub use external_payment_refund_details::*; pub use external_payment_schedule_base::*; pub use external_payment_schedule_request::*; +pub use fdx_content_types::*; pub use fdx_fi_attribute::*; pub use fdx_hateoas_link::*; +pub use fdx_hateoas_link_action::*; +pub use fdx_notification_category::*; pub use fdx_notification_payload::*; +pub use fdx_notification_payload_id_type::*; +pub use fdx_notification_priority::*; +pub use fdx_notification_severity::*; +pub use fdx_notification_type::*; pub use fdx_party::*; +pub use fdx_party_registry::*; +pub use fdx_party_type::*; +pub use fdx_recipient_metadata::*; pub use fallback_auth_microdeposit_auto_verified_webhook::*; pub use fallback_auth_microdeposit_verification_expired_webhook::*; pub use financial_institution_insights::*; +pub use forecasted_monthly_income::*; +pub use form1099_type::*; pub use fraud_amount::*; pub use generic_screening_hit_location_items::*; +pub use get_recipient_response::*; +pub use get_recipients_response::*; pub use health_incident::*; +pub use hidden_match_summary_code::*; +pub use historical_annual_income::*; pub use historical_balance::*; pub use historical_update_webhook::*; pub use holding::*; pub use holdings_default_update_webhook::*; pub use holdings_override::*; +pub use hosted_link_delivery_method::*; pub use hosted_mmd_verification_webhook::*; +pub use id_number_type::*; +pub use iso_currency_code::*; pub use identity_default_update_webhook::*; -pub use identity_document::*; -pub use identity_document_metadata::*; +pub use identity_document_upload::*; +pub use identity_document_upload_metadata::*; +pub use identity_document_upload_risk_insights::*; +pub use identity_document_upload_risk_signal::*; +pub use identity_document_upload_risk_summary::*; +pub use identity_documents_uploads_get_request_options::*; +pub use identity_documents_uploads_get_response::*; pub use identity_get_request_options::*; pub use identity_get_response::*; pub use identity_match_request_options::*; pub use identity_match_response::*; pub use identity_match_user::*; pub use identity_refresh_response::*; +pub use identity_update_types::*; pub use identity_verification::*; pub use identity_verification_autofill_address::*; pub use identity_verification_autofill_create_response::*; +pub use identity_verification_autofill_status::*; pub use identity_verification_autofill_user_data::*; pub use identity_verification_create_request_user::*; pub use identity_verification_create_response::*; pub use identity_verification_document_address_response::*; +pub use identity_verification_document_name_response::*; pub use identity_verification_get_response::*; pub use identity_verification_list_response::*; pub use identity_verification_request_user::*; @@ -351,21 +523,28 @@ pub use identity_verification_response_user_name::*; pub use identity_verification_retried_webhook::*; pub use identity_verification_retry_request_steps_object::*; pub use identity_verification_retry_response::*; +pub use identity_verification_status::*; pub use identity_verification_status_updated_webhook::*; +pub use identity_verification_step_status::*; pub use identity_verification_step_summary::*; pub use identity_verification_step_updated_webhook::*; pub use identity_verification_template_reference::*; pub use identity_verification_user_address::*; pub use identity_verification_user_data::*; +pub use image_quality::*; pub use incident_update::*; pub use income_breakdown::*; pub use income_breakdown_type::*; pub use income_override::*; +pub use income_sources_counts::*; pub use income_summary_field_number::*; pub use income_summary_field_string::*; pub use income_verification_create_request_options::*; pub use income_verification_create_response::*; +pub use income_verification_doc_parsing_config::*; +pub use income_verification_payroll_flow_type::*; pub use income_verification_paystubs_get_response::*; +pub use income_verification_precheck_confidence::*; pub use income_verification_precheck_employer::*; pub use income_verification_precheck_employer_address::*; pub use income_verification_precheck_military_info::*; @@ -374,10 +553,12 @@ pub use income_verification_precheck_response::*; pub use income_verification_precheck_user::*; pub use income_verification_refresh_reconnect_needed_webhook::*; pub use income_verification_risk_signals_status_webhook::*; +pub use income_verification_source_type::*; pub use income_verification_status_webhook::*; pub use income_verification_taxforms_get_response::*; pub use individual_name::*; pub use individual_screening_hit_names::*; +pub use individual_watchlist_code::*; pub use individual_watchlist_program::*; pub use inflow_model::*; pub use initial_update_webhook::*; @@ -392,9 +573,14 @@ pub use institutions_get_response::*; pub use institutions_search_payment_initiation_options::*; pub use institutions_search_request_options::*; pub use institutions_search_response::*; +pub use investment_account_subtype::*; +pub use investment_account_subtypes::*; pub use investment_filter::*; pub use investment_holdings_get_request_options::*; pub use investment_transaction::*; +pub use investment_transaction_subtype::*; +pub use investment_transaction_type::*; +pub use investments_auth_data_sources::*; pub use investments_auth_get_numbers::*; pub use investments_auth_get_request_options::*; pub use investments_auth_get_response::*; @@ -406,12 +592,21 @@ pub use investments_refresh_response::*; pub use investments_transactions_get_request_options::*; pub use investments_transactions_get_response::*; pub use investments_transactions_override::*; +pub use issue::*; +pub use issue_resolved_webhook::*; +pub use issues_get_response::*; +pub use issues_search_response::*; +pub use issues_status::*; +pub use issues_subscribe_response::*; +pub use issuing_country::*; pub use item::*; pub use item_access_token_invalidate_response::*; pub use item_activity_list_response::*; +pub use item_add_result_webhook::*; pub use item_application_list_response::*; pub use item_application_scopes_update_response::*; pub use item_application_unlink_response::*; +pub use item_create_authentication::*; pub use item_error_webhook::*; pub use item_get_response::*; pub use item_import_request_options::*; @@ -427,10 +622,12 @@ pub use item_status_investments::*; pub use item_status_last_webhook::*; pub use item_status_transactions::*; pub use item_webhook_update_response::*; +pub use item_with_consent_fields::*; pub use jwk_public_key::*; pub use kyc_check_address_summary::*; pub use kyc_check_date_of_birth_summary::*; pub use kyc_check_details::*; +pub use kyc_check_details_international_address::*; pub use kyc_check_id_number_summary::*; pub use kyc_check_name_summary::*; pub use kyc_check_phone_summary::*; @@ -446,28 +643,51 @@ pub use link_delivery_account::*; pub use link_delivery_callback_webhook::*; pub use link_delivery_communication_method::*; pub use link_delivery_create_response::*; +pub use link_delivery_delivery_method::*; pub use link_delivery_get_response::*; pub use link_delivery_institution::*; pub use link_delivery_metadata::*; pub use link_delivery_options::*; pub use link_delivery_recipient::*; +pub use link_delivery_session_status::*; +pub use link_delivery_verification_status::*; +pub use link_delivery_webhook_callback_type::*; +pub use link_delivery_webhook_communication_method::*; +pub use link_delivery_webhook_delivery_status::*; pub use link_event::*; +pub use link_event_metadata::*; +pub use link_event_name::*; pub use link_events_webhook::*; pub use link_o_auth_correlation_id_exchange_response::*; +pub use link_profile_eligibility_check_response::*; +pub use link_profile_eligibility_check_user::*; +pub use link_session_bank_income_result::*; +pub use link_session_cra_item_add_result::*; pub use link_session_exit::*; +pub use link_session_exit_deprecated::*; pub use link_session_exit_metadata::*; pub use link_session_exit_metadata_institution::*; pub use link_session_finished_webhook::*; +pub use link_session_item_add_result::*; +pub use link_session_payroll_income_result::*; +pub use link_session_results::*; pub use link_session_success::*; pub use link_session_success_metadata::*; pub use link_session_success_metadata_account::*; pub use link_session_success_metadata_institution::*; +pub use link_session_success_metadata_transfer_status::*; pub use link_token_account_filters::*; pub use link_token_create_card_switch::*; pub use link_token_create_hosted_link::*; +pub use link_token_create_identity::*; pub use link_token_create_institution_data::*; pub use link_token_create_request_auth::*; pub use link_token_create_request_base_report::*; +pub use link_token_create_request_cra_options::*; +pub use link_token_create_request_cra_options_base_report::*; +pub use link_token_create_request_cra_options_cashflow_insights::*; +pub use link_token_create_request_cra_options_partner_insights::*; +pub use link_token_create_request_credit_partner_insights::*; pub use link_token_create_request_deposit_switch::*; pub use link_token_create_request_employment::*; pub use link_token_create_request_employment_bank_income::*; @@ -475,6 +695,7 @@ pub use link_token_create_request_identity_verification::*; pub use link_token_create_request_income_verification::*; pub use link_token_create_request_income_verification_bank_income::*; pub use link_token_create_request_income_verification_payroll_income::*; +pub use link_token_create_request_payment_configuration::*; pub use link_token_create_request_payment_initiation::*; pub use link_token_create_request_statements::*; pub use link_token_create_request_transfer::*; @@ -491,20 +712,39 @@ pub use link_token_investments_auth::*; pub use link_token_transactions::*; pub use link_user_delivery_status_webhook::*; pub use loan::*; +pub use loan_account_subtype::*; +pub use loan_account_subtypes::*; pub use loan_filter::*; pub use loan_identifier::*; +pub use loan_identifier_type::*; pub use loan_identifiers::*; +pub use loan_payments_counts::*; +pub use loan_payments_merchant_counts::*; pub use loans::*; pub use location::*; pub use match_summary::*; +pub use match_summary_code::*; pub use merchant_insights::*; pub use meta::*; +pub use monitoring_consumer_report_permissible_purpose::*; +pub use monitoring_income_insights::*; +pub use monitoring_income_source::*; +pub use monitoring_insights::*; +pub use monitoring_insights_item_status::*; +pub use monitoring_insights_status::*; +pub use monitoring_insights_webhook::*; +pub use monitoring_item_status_code::*; +pub use monitoring_loan_insights::*; pub use mortgage_interest_rate::*; pub use mortgage_liability::*; pub use mortgage_property_address::*; pub use multi_document_risk_signal::*; pub use name_match_score::*; pub use net_pay::*; +pub use network_insights_item::*; +pub use network_insights_report::*; +pub use network_insights_report_get_response::*; +pub use network_insights_schema::*; pub use new_accounts_available_webhook::*; pub use numbers::*; pub use numbers_acats::*; @@ -514,12 +754,18 @@ pub use numbers_bacs::*; pub use numbers_eft::*; pub use numbers_international::*; pub use numbers_international_iban::*; +pub use omittable_transfer_type::*; pub use option_contract::*; pub use originator::*; +pub use originator_expected_transfer_frequency::*; +pub use other_account_subtype::*; +pub use other_account_subtypes::*; pub use other_filter::*; +pub use override_account_type::*; pub use owner::*; pub use owner_override::*; pub use ownership_type::*; +pub use po_box_status::*; pub use pslf_status::*; pub use parties::*; pub use partner_customer_create_response::*; @@ -532,13 +778,19 @@ pub use partner_end_customer_address::*; pub use partner_end_customer_assets_under_management::*; pub use partner_end_customer_billing_contact::*; pub use partner_end_customer_customer_support_info::*; +pub use partner_end_customer_flowdown_status::*; pub use partner_end_customer_o_auth_institution::*; +pub use partner_end_customer_o_auth_institution_application_status::*; pub use partner_end_customer_o_auth_institution_environments::*; +pub use partner_end_customer_o_auth_status_updated_values::*; pub use partner_end_customer_o_auth_status_updated_webhook::*; +pub use partner_end_customer_questionnaire_status::*; +pub use partner_end_customer_status::*; pub use partner_end_customer_technical_contact::*; pub use partner_end_customer_with_secrets::*; pub use party::*; pub use party_individual::*; +pub use party_role_type::*; pub use pay::*; pub use pay_frequency_value::*; pub use pay_period_details::*; @@ -551,26 +803,38 @@ pub use pay_stub_earnings_total::*; pub use pay_stub_pay_period_details::*; pub use pay_stub_taxpayer_id::*; pub use payment_amount::*; +pub use payment_amount_currency::*; pub use payment_amount_nullable::*; pub use payment_amount_refunded::*; pub use payment_amount_to_refund::*; +pub use payment_channel::*; pub use payment_consent_max_payment_amount::*; +pub use payment_consent_periodic_alignment::*; pub use payment_consent_periodic_amount::*; pub use payment_consent_periodic_amount_amount::*; +pub use payment_consent_periodic_interval::*; pub use payment_consent_valid_date_time::*; pub use payment_initiation_address::*; pub use payment_initiation_consent_constraints::*; pub use payment_initiation_consent_create_response::*; pub use payment_initiation_consent_get_response::*; +pub use payment_initiation_consent_payer_details::*; +pub use payment_initiation_consent_payer_numbers::*; pub use payment_initiation_consent_payment_execute_response::*; +pub use payment_initiation_consent_processing_mode::*; pub use payment_initiation_consent_revoke_response::*; +pub use payment_initiation_consent_scope::*; +pub use payment_initiation_consent_status::*; +pub use payment_initiation_consent_type::*; pub use payment_initiation_maximum_payment_amount::*; pub use payment_initiation_metadata::*; pub use payment_initiation_payment::*; pub use payment_initiation_payment_create_response::*; +pub use payment_initiation_payment_create_status::*; pub use payment_initiation_payment_get_response::*; pub use payment_initiation_payment_list_response::*; pub use payment_initiation_payment_reverse_response::*; +pub use payment_initiation_payment_status::*; pub use payment_initiation_payment_token_create_response::*; pub use payment_initiation_recipient::*; pub use payment_initiation_recipient_create_response::*; @@ -581,6 +845,8 @@ pub use payment_meta::*; pub use payment_profile_create_response::*; pub use payment_profile_get_response::*; pub use payment_profile_remove_response::*; +pub use payment_profile_status::*; +pub use payment_schedule_interval::*; pub use payment_scheme::*; pub use payment_status_update_webhook::*; pub use payroll_income_account_data::*; @@ -594,22 +860,46 @@ pub use paystub_address::*; pub use paystub_details::*; pub use paystub_employer::*; pub use paystub_override::*; +pub use paystub_override_deductions::*; +pub use paystub_override_deductions_breakdown::*; +pub use paystub_override_deductions_total::*; pub use paystub_override_distribution_breakdown::*; +pub use paystub_override_earnings::*; +pub use paystub_override_earnings_breakdown::*; +pub use paystub_override_earnings_total::*; pub use paystub_override_employee::*; pub use paystub_override_employee_address::*; pub use paystub_override_employer::*; +pub use paystub_override_employer_address::*; +pub use paystub_override_net_pay::*; pub use paystub_override_pay_period_details::*; +pub use paystub_override_taxpayer_id::*; pub use paystub_pay_frequency::*; pub use paystub_ytd_details::*; +pub use pending_disconnect_webhook::*; +pub use pending_disconnect_webhook_reason::*; pub use pending_expiration_webhook::*; pub use personal_finance_category::*; pub use phone_number::*; pub use phone_number_match_score::*; +pub use phone_type::*; +pub use physical_document_category::*; pub use physical_document_extracted_data::*; pub use physical_document_extracted_data_analysis::*; pub use physical_document_images::*; pub use plaid_error::*; +pub use plaid_error_type::*; pub use platform_ids::*; +pub use prism_cash_score::*; +pub use prism_cash_score_metadata::*; +pub use prism_cash_score_version::*; +pub use prism_first_detect::*; +pub use prism_first_detect_version::*; +pub use prism_insights::*; +pub use prism_insights_result::*; +pub use prism_insights_version::*; +pub use prism_product::*; +pub use prism_versions::*; pub use processor_account_get_response::*; pub use processor_auth_get_response::*; pub use processor_balance_get_request_options::*; @@ -644,6 +934,17 @@ pub use product_permissions_required_auth_webhook::*; pub use product_permissions_required_identity_webhook::*; pub use product_status::*; pub use product_status_breakdown::*; +pub use products::*; +pub use profile_get_response::*; +pub use profile_identity::*; +pub use profile_identity_address::*; +pub use profile_identity_name::*; +pub use profile_item::*; +pub use profile_network_status_get_network_status::*; +pub use profile_network_status_get_response::*; +pub use profile_network_status_get_user::*; +pub use program_name_sensitivity::*; +pub use proxy_type::*; pub use recipient_bacs::*; pub use recipient_bacs_nullable::*; pub use recurrence::*; @@ -651,31 +952,51 @@ pub use recurring_cancelled_webhook::*; pub use recurring_frequency::*; pub use recurring_insights_stream::*; pub use recurring_new_transfer_webhook::*; +pub use recurring_transaction_frequency::*; pub use recurring_transactions::*; pub use recurring_transactions_update_webhook::*; pub use recurring_transfer::*; pub use recurring_transfer_nullable::*; pub use recurring_transfer_skipped_webhook::*; pub use removed_transaction::*; +pub use report_type::*; pub use reporting_information::*; pub use risk_check_behavior::*; +pub use risk_check_behavior_bot_detected_label::*; +pub use risk_check_behavior_fraud_ring_detected_label::*; +pub use risk_check_behavior_user_interactions_label::*; pub use risk_check_details::*; pub use risk_check_device::*; pub use risk_check_email::*; +pub use risk_check_email_domain_is_custom::*; +pub use risk_check_email_domain_is_disposable::*; +pub use risk_check_email_domain_is_free_provider::*; +pub use risk_check_email_is_deliverable_status::*; +pub use risk_check_email_top_level_domain_is_suspicious::*; pub use risk_check_identity_abuse_signals::*; +pub use risk_check_linked_service::*; pub use risk_check_phone::*; pub use risk_check_stolen_identity::*; pub use risk_check_synthetic_identity::*; pub use risk_profile::*; +pub use risk_reason::*; pub use risk_signal_document_reference::*; +pub use risk_signal_document_status::*; +pub use risk_signal_document_type::*; +pub use risk_signal_file_type::*; pub use role::*; pub use role_detail::*; pub use roles::*; +pub use ruleset::*; +pub use sms_verification::*; +pub use sms_verification_status::*; pub use sandbox_bank_income_fire_webhook_response::*; +pub use sandbox_bank_income_webhook_fire_request_webhook_code::*; pub use sandbox_bank_income_webhook_fire_request_webhook_fields::*; pub use sandbox_bank_transfer_fire_webhook_response::*; pub use sandbox_bank_transfer_simulate_response::*; pub use sandbox_income_fire_webhook_response::*; +pub use sandbox_income_webhook_fire_request_webhook_code::*; pub use sandbox_item_fire_webhook_response::*; pub use sandbox_item_reset_login_response::*; pub use sandbox_item_set_verification_status_response::*; @@ -686,6 +1007,7 @@ pub use sandbox_processor_token_create_response::*; pub use sandbox_public_token_create_request_income_verification_bank_income::*; pub use sandbox_public_token_create_request_options::*; pub use sandbox_public_token_create_request_options_income_verification::*; +pub use sandbox_public_token_create_request_options_statements::*; pub use sandbox_public_token_create_request_options_transactions::*; pub use sandbox_public_token_create_response::*; pub use sandbox_transfer_fire_webhook_response::*; @@ -700,7 +1022,9 @@ pub use sandbox_transfer_test_clock_advance_response::*; pub use sandbox_transfer_test_clock_create_response::*; pub use sandbox_transfer_test_clock_get_response::*; pub use sandbox_transfer_test_clock_list_response::*; +pub use sandbox_user_reset_login_response::*; pub use scopes::*; +pub use scopes_context::*; pub use screening_hit_analysis::*; pub use screening_hit_data::*; pub use screening_hit_date_of_birth_item::*; @@ -710,19 +1034,28 @@ pub use screening_status_updated_webhook::*; pub use security::*; pub use security_override::*; pub use selfie_analysis::*; +pub use selfie_analysis_document_comparison::*; +pub use selfie_analysis_facial_analysis::*; +pub use selfie_analysis_facial_analysis_outcome::*; +pub use selfie_analysis_liveness_check::*; pub use selfie_capture::*; pub use selfie_check::*; pub use selfie_check_selfie::*; +pub use selfie_check_status::*; +pub use selfie_status::*; pub use service::*; pub use service_product_fulfillment::*; pub use service_product_fulfillment_detail::*; +pub use service_product_fulfillment_identifier::*; pub use servicer_address_data::*; pub use services::*; pub use signal_address_data::*; +pub use signal_decision_outcome::*; pub use signal_decision_report_response::*; pub use signal_device::*; pub use signal_evaluate_core_attributes::*; pub use signal_evaluate_response::*; +pub use signal_payment_method::*; pub use signal_person_name::*; pub use signal_prepare_response::*; pub use signal_return_report_response::*; @@ -731,25 +1064,39 @@ pub use signal_user::*; pub use signal_warning::*; pub use simulated_transfer_sweep::*; pub use single_document_risk_signal::*; +pub use source::*; pub use statements_account::*; pub use statements_list_response::*; +pub use statements_refresh_complete_result::*; pub use statements_refresh_complete_webhook::*; pub use statements_refresh_response::*; pub use statements_statement::*; pub use status::*; pub use statuses::*; +pub use strategy::*; pub use student_loan::*; pub use student_loan_repayment_model::*; pub use student_loan_status::*; pub use student_repayment_plan::*; pub use sweep_status::*; +pub use sweep_trigger::*; pub use sync_updates_available_webhook::*; pub use taxform::*; pub use taxpayer_id::*; pub use taxpayer_identifier::*; +pub use taxpayer_identifier_type::*; pub use taxpayer_identifiers::*; pub use total::*; pub use total_canonical_description::*; +pub use total_inflow_amount::*; +pub use total_inflow_amount30_d::*; +pub use total_inflow_amount60_d::*; +pub use total_inflow_amount90_d::*; +pub use total_monthly_income_insights::*; +pub use total_outflow_amount::*; +pub use total_outflow_amount30_d::*; +pub use total_outflow_amount60_d::*; +pub use total_outflow_amount90_d::*; pub use transaction::*; pub use transaction_base::*; pub use transaction_code::*; @@ -757,6 +1104,7 @@ pub use transaction_counterparty::*; pub use transaction_override::*; pub use transaction_stream::*; pub use transaction_stream_amount::*; +pub use transaction_stream_status::*; pub use transactions_category_rule::*; pub use transactions_enhance_get_response::*; pub use transactions_enrich_request_options::*; @@ -768,25 +1116,34 @@ pub use transactions_recurring_get_response::*; pub use transactions_refresh_response::*; pub use transactions_removed_webhook::*; pub use transactions_rule_details::*; +pub use transactions_rule_field::*; +pub use transactions_rule_type::*; pub use transactions_rules_create_response::*; pub use transactions_rules_list_response::*; pub use transactions_rules_remove_response::*; pub use transactions_sync_request_options::*; pub use transactions_sync_response::*; +pub use transactions_update_status::*; pub use transactions_user_insights_get_response::*; pub use transfer::*; +pub use transfer_ach_network::*; pub use transfer_authorization::*; +pub use transfer_authorization_cancel_response::*; pub use transfer_authorization_create_response::*; +pub use transfer_authorization_decision::*; pub use transfer_authorization_decision_rationale::*; pub use transfer_authorization_decision_rationale_code::*; pub use transfer_authorization_device::*; pub use transfer_authorization_guarantee_decision::*; pub use transfer_authorization_guarantee_decision_rationale::*; +pub use transfer_authorization_guarantee_decision_rationale_code::*; pub use transfer_authorization_payment_risk::*; pub use transfer_authorization_proposed_transfer::*; +pub use transfer_authorization_risk_level::*; pub use transfer_authorization_user_in_request::*; pub use transfer_balance::*; pub use transfer_balance_get_response::*; +pub use transfer_balance_type::*; pub use transfer_cancel_response::*; pub use transfer_capabilities_get_rtp::*; pub use transfer_capabilities_get_response::*; @@ -797,85 +1154,133 @@ pub use transfer_credit_usage_configuration::*; pub use transfer_debit_usage_configuration::*; pub use transfer_device::*; pub use transfer_diligence_document_upload_response::*; +pub use transfer_diligence_status::*; pub use transfer_diligence_submit_response::*; +pub use transfer_document_purpose::*; pub use transfer_event::*; pub use transfer_event_list_response::*; pub use transfer_event_list_transfer_type::*; pub use transfer_event_sync_response::*; +pub use transfer_event_type::*; pub use transfer_events_update_webhook::*; pub use transfer_expected_sweep_settlement_schedule_item::*; pub use transfer_failure::*; pub use transfer_funding_account::*; pub use transfer_get_response::*; +pub use transfer_intent_authorization_decision::*; pub use transfer_intent_create::*; +pub use transfer_intent_create_mode::*; +pub use transfer_intent_create_network::*; pub use transfer_intent_create_response::*; pub use transfer_intent_get::*; pub use transfer_intent_get_failure_reason::*; pub use transfer_intent_get_response::*; +pub use transfer_intent_status::*; pub use transfer_ledger_balance::*; pub use transfer_ledger_deposit_response::*; pub use transfer_ledger_distribute_response::*; pub use transfer_ledger_get_response::*; +pub use transfer_ledger_sweep_simulate_event_type::*; pub use transfer_ledger_withdraw_response::*; pub use transfer_list_response::*; pub use transfer_metadata::*; +pub use transfer_metrics_get_authorization_usage::*; pub use transfer_metrics_get_response::*; +pub use transfer_metrics_get_return_rates::*; +pub use transfer_metrics_get_return_rates_over_interval::*; pub use transfer_migrate_account_response::*; +pub use transfer_network::*; pub use transfer_originator_address::*; pub use transfer_originator_create_response::*; pub use transfer_originator_diligence::*; pub use transfer_originator_funding_account_update_response::*; pub use transfer_originator_get_response::*; pub use transfer_originator_list_response::*; +pub use transfer_platform_originator_create_response::*; +pub use transfer_platform_person_address::*; +pub use transfer_platform_person_create_response::*; +pub use transfer_platform_person_id_number::*; +pub use transfer_platform_person_name::*; +pub use transfer_platform_requirement::*; +pub use transfer_platform_requirement_submission::*; +pub use transfer_platform_requirement_submit_response::*; +pub use transfer_platform_tos_acceptance_metadata::*; pub use transfer_questionnaire_create_response::*; pub use transfer_recurring_cancel_response::*; pub use transfer_recurring_create_response::*; pub use transfer_recurring_get_response::*; pub use transfer_recurring_list_response::*; +pub use transfer_recurring_network::*; pub use transfer_recurring_schedule::*; +pub use transfer_recurring_status::*; pub use transfer_refund::*; pub use transfer_refund_cancel_response::*; pub use transfer_refund_create_response::*; pub use transfer_refund_failure::*; pub use transfer_refund_get_response::*; +pub use transfer_refund_status::*; pub use transfer_repayment::*; pub use transfer_repayment_list_response::*; pub use transfer_repayment_return::*; pub use transfer_repayment_return_list_response::*; +pub use transfer_schedule_interval_unit::*; +pub use transfer_status::*; pub use transfer_sweep::*; pub use transfer_sweep_get_response::*; pub use transfer_sweep_list_response::*; pub use transfer_sweep_status::*; pub use transfer_test_clock::*; +pub use transfer_type::*; pub use transfer_user_address_in_request::*; pub use transfer_user_address_in_response::*; pub use transfer_user_in_request::*; pub use transfer_user_in_request_deprecated::*; pub use transfer_user_in_response::*; +pub use transfer_wire_details::*; pub use update_entity_screening_request_search_terms::*; pub use update_individual_screening_request_search_terms::*; +pub use user_account_identity::*; +pub use user_account_identity_address::*; +pub use user_account_identity_name::*; +pub use user_account_item::*; pub use user_account_revoked_webhook::*; +pub use user_account_session_get_response::*; pub use user_address::*; pub use user_create_response::*; pub use user_data_overview::*; pub use user_id_number::*; +pub use user_items_get_response::*; pub use user_permission_revoked_webhook::*; +pub use user_remove_response::*; +pub use user_stated_income_source_category::*; +pub use user_stated_income_source_frequency::*; +pub use user_stated_income_source_pay_type::*; +pub use user_third_party_token_create_response::*; +pub use user_third_party_token_remove_response::*; pub use user_update_response::*; pub use validation_source::*; pub use validation_sources::*; pub use verification_expired_webhook::*; pub use verification_of_asset::*; pub use verification_of_asset_response::*; +pub use verification_status::*; +pub use verify_sms_details::*; +pub use verify_sms_details_status::*; pub use w2::*; pub use w2_box12::*; +pub use w2_box12_override::*; +pub use w2_override::*; pub use w2_state_and_local_wages::*; +pub use w2_state_and_local_wages_override::*; pub use wallet::*; pub use wallet_balance::*; pub use wallet_create_response::*; pub use wallet_get_response::*; +pub use wallet_iso_currency_code::*; pub use wallet_list_response::*; pub use wallet_numbers::*; pub use wallet_payment_scheme::*; +pub use wallet_status::*; pub use wallet_transaction::*; pub use wallet_transaction_amount::*; pub use wallet_transaction_counterparty::*; @@ -883,13 +1288,17 @@ pub use wallet_transaction_counterparty_bacs::*; pub use wallet_transaction_counterparty_international::*; pub use wallet_transaction_counterparty_numbers::*; pub use wallet_transaction_execute_response::*; +pub use wallet_transaction_failure_reason::*; pub use wallet_transaction_get_response::*; pub use wallet_transaction_list_request_options::*; pub use wallet_transaction_list_response::*; +pub use wallet_transaction_relation::*; +pub use wallet_transaction_status::*; pub use wallet_transaction_status_update_webhook::*; pub use warning::*; pub use watchlist_screening_audit_trail::*; pub use watchlist_screening_document::*; +pub use watchlist_screening_document_type::*; pub use watchlist_screening_entity_create_response::*; pub use watchlist_screening_entity_get_response::*; pub use watchlist_screening_entity_history_list_response::*; @@ -899,9 +1308,12 @@ pub use watchlist_screening_entity_program_get_response::*; pub use watchlist_screening_entity_program_list_response::*; pub use watchlist_screening_entity_review_create_response::*; pub use watchlist_screening_entity_review_list_response::*; +pub use watchlist_screening_entity_update_request_resettable_field::*; +pub use watchlist_screening_entity_update_request_resettable_field_list::*; pub use watchlist_screening_entity_update_response::*; pub use watchlist_screening_hit::*; pub use watchlist_screening_hit_locations::*; +pub use watchlist_screening_hit_status::*; pub use watchlist_screening_individual::*; pub use watchlist_screening_individual_create_response::*; pub use watchlist_screening_individual_get_response::*; @@ -912,33 +1324,51 @@ pub use watchlist_screening_individual_program_get_response::*; pub use watchlist_screening_individual_program_list_response::*; pub use watchlist_screening_individual_review_create_response::*; pub use watchlist_screening_individual_review_list_response::*; +pub use watchlist_screening_individual_update_request_resettable_field::*; +pub use watchlist_screening_individual_update_request_resettable_field_list::*; pub use watchlist_screening_individual_update_response::*; pub use watchlist_screening_request_search_terms::*; pub use watchlist_screening_review::*; pub use watchlist_screening_search_terms::*; +pub use watchlist_screening_status::*; +pub use weak_alias_determination::*; +pub use webhook_environment_values::*; +pub use webhook_type::*; pub use webhook_update_acknowledged_webhook::*; pub use webhook_verification_key_get_response::*; +mod ach_class; mod apr; mod account_access; mod account_assets; mod account_balance; mod account_base; mod account_filters_response; +mod account_holder_category; mod account_identity; +mod account_identity_document_upload; mod account_identity_match_score; +mod account_ids_with_updated_auth; mod account_ids_with_updated_identity; mod account_product_access; mod account_subtype; +mod account_type; +mod account_verification_insights; +mod account_verification_insights_account_number_format; +mod account_verification_insights_network_status; +mod account_verification_insights_previous_returns; mod accounts_balance_get_request_options; mod accounts_balance_get_request_payment_details; mod accounts_balance_get_response_payment_risk_assessment; mod accounts_get_request_options; mod accounts_get_response; +mod action_state; mod activity; +mod activity_type; mod address; mod address_data; mod address_data_not_required; mod address_match_score; +mod address_purpose_label; mod application; mod application_get_response; mod asset; @@ -948,6 +1378,8 @@ mod asset_holder_name; mod asset_owner; mod asset_owners; mod asset_report; +mod asset_report_account_balance; +mod asset_report_add_ons; mod asset_report_audit_copy_create_response; mod asset_report_audit_copy_remove_response; mod asset_report_create_request_options; @@ -964,21 +1396,32 @@ mod asset_report_refresh_request_options; mod asset_report_refresh_response; mod asset_report_remove_response; mod asset_report_transaction; +mod asset_report_transaction_type; +mod asset_report_type; mod asset_report_user; mod asset_transaction; +mod asset_transaction_category_type; mod asset_transaction_description; mod asset_transaction_detail; +mod asset_transaction_type; mod asset_transactions; +mod asset_type; mod assets; mod assets_error_webhook; mod assets_product_ready_webhook; +mod auth_default_update_webhook; mod auth_get_numbers; mod auth_get_request_options; mod auth_get_response; mod auth_metadata; mod auth_supported_methods; +mod auth_update_types; mod automatically_verified_webhook; +mod balance_plus_attributes; +mod balance_plus_risk_level; +mod bank_income_complete_result; mod bank_income_complete_webhook; +mod bank_income_refresh_complete_result; mod bank_income_refresh_complete_webhook; mod bank_income_refresh_update_webhook; mod bank_initiated_return_risk; @@ -993,35 +1436,55 @@ mod bank_transfer_event_list_bank_transfer_type; mod bank_transfer_event_list_direction; mod bank_transfer_event_list_response; mod bank_transfer_event_sync_response; +mod bank_transfer_event_type; mod bank_transfer_failure; mod bank_transfer_get_response; mod bank_transfer_list_response; mod bank_transfer_metadata; mod bank_transfer_migrate_account_response; +mod bank_transfer_network; +mod bank_transfer_status; mod bank_transfer_sweep; mod bank_transfer_sweep_get_response; mod bank_transfer_sweep_list_response; +mod bank_transfer_type; mod bank_transfer_user; mod bank_transfers_events_update_webhook; mod base_report; mod base_report_account; mod base_report_account_balances; mod base_report_account_insights; +mod base_report_account_metadata; +mod base_report_attributes; mod base_report_average_flow_insights; -mod base_report_get_response; +mod base_report_average_monthly_balances; +mod base_report_historical_balance; mod base_report_item; mod base_report_longest_gap_insights; mod base_report_number_flow_insights; mod base_report_transaction; +mod base_report_transaction_type; mod base_report_warning; +mod base_report_warning_code; mod base_reports_error_webhook; mod base_reports_product_ready_webhook; +mod beacon_account_risk_attributes; +mod beacon_account_risk_evaluate_account; +mod beacon_account_risk_evaluate_account_attributes; +mod beacon_account_risk_evaluate_evaluation_reason; +mod beacon_account_risk_evaluate_request_options; +mod beacon_account_risk_evaluate_response; mod beacon_audit_trail; +mod beacon_audit_trail_source; +mod beacon_bank_account_insights; +mod beacon_bank_accounts; mod beacon_duplicate_detected_webhook; mod beacon_duplicate_get_response; mod beacon_match_summary_analysis; +mod beacon_match_summary_code; mod beacon_report; mod beacon_report_create_response; +mod beacon_report_create_type; mod beacon_report_created_webhook; mod beacon_report_get_response; mod beacon_report_list_response; @@ -1031,21 +1494,30 @@ mod beacon_report_syndication_created_webhook; mod beacon_report_syndication_get_response; mod beacon_report_syndication_list_response; mod beacon_report_syndication_original_report; +mod beacon_report_type; mod beacon_report_updated_webhook; +mod beacon_syndicated_report_depository_account_match_analysis; +mod beacon_user; +mod beacon_user_account_insights_get_response; mod beacon_user_address; mod beacon_user_create_response; mod beacon_user_data; +mod beacon_user_depository_account; mod beacon_user_get_response; +mod beacon_user_history_list_response; mod beacon_user_id_number; mod beacon_user_name; mod beacon_user_name_nullable; mod beacon_user_request_address; mod beacon_user_request_address_nullable; mod beacon_user_request_data; +mod beacon_user_request_depository_account; mod beacon_user_revision; +mod beacon_user_status; mod beacon_user_status_updated_webhook; mod beacon_user_update_request_data; mod beacon_user_update_response; +mod cashflow_attributes_version; mod categories_get_response; mod category; mod category_insight_details; @@ -1057,14 +1529,30 @@ mod client_provided_raw_transaction; mod client_provided_transaction; mod client_provided_transaction_location; mod connected_application; +mod consent_event; +mod consent_event_code; +mod consent_event_initiator; +mod consent_event_type; +mod consent_events_get_response; +mod consented_account; +mod consumer_dispute; +mod consumer_dispute_category; +mod consumer_report_permissible_purpose; mod consumer_report_user_identity; mod counterparty; mod counterparty_insights; +mod counterparty_type; +mod country_code; mod cra_bank_income; mod cra_bank_income_account; +mod cra_bank_income_account_metadata; +mod cra_bank_income_bonus_type; mod cra_bank_income_cause; +mod cra_bank_income_complete_result; mod cra_bank_income_complete_webhook; +mod cra_bank_income_create_response; mod cra_bank_income_employer; +mod cra_bank_income_error_webhook; mod cra_bank_income_get_response; mod cra_bank_income_historical_summary; mod cra_bank_income_item; @@ -1072,10 +1560,58 @@ mod cra_bank_income_source; mod cra_bank_income_summary; mod cra_bank_income_transaction; mod cra_bank_income_warning; +mod cra_bank_income_warning_code; +mod cra_base_report_create_response; +mod cra_base_report_get_response; +mod cra_check_report_base_report_get_response; +mod cra_check_report_create_response; +mod cra_check_report_failed_webhook; +mod cra_check_report_income_insights_get_response; +mod cra_check_report_network_insights_get_response; +mod cra_check_report_partner_insights_get_options; +mod cra_check_report_partner_insights_get_response; +mod cra_check_report_ready_webhook; +mod cra_income_insights; +mod cra_loan_application; +mod cra_loan_application_decision; +mod cra_loan_closed_status; +mod cra_loan_opened_status; +mod cra_loan_payment_history; +mod cra_loan_payment_schedule; +mod cra_loan_register; +mod cra_loan_register_application; +mod cra_loan_status; +mod cra_loan_status_history_update; +mod cra_loan_type; +mod cra_loan_unregister; +mod cra_loan_unregister_response; +mod cra_loan_update; +mod cra_loans_applications_register_response; +mod cra_loans_register_response; +mod cra_loans_update_response; +mod cra_monitoring_insights_get_response; +mod cra_monitoring_insights_item; +mod cra_monitoring_insights_subscribe_response; +mod cra_monitoring_insights_unsubscribe_response; +mod cra_network_insights_item; +mod cra_network_insights_report; +mod cra_pdf_add_ons; +mod cra_partner_insights; +mod cra_partner_insights_complete_webhook; +mod cra_partner_insights_error_webhook; +mod cra_partner_insights_get_response; +mod cra_partner_insights_item; +mod cra_partner_insights_item_account; +mod cra_partner_insights_item_account_metadata; +mod cra_partner_insights_prism; +mod cra_prediction_interval; mod credit1099; mod credit1099_filer; mod credit1099_payer; mod credit1099_recipient; +mod credit_ach_class; +mod credit_account_subtype; +mod credit_account_subtypes; mod credit_amount_with_currency; mod credit_audit_copy_token_create_response; mod credit_audit_copy_token_remove_response; @@ -1086,19 +1622,26 @@ mod credit_bank_employment_get_response; mod credit_bank_employment_item; mod credit_bank_employment_report; mod credit_bank_employment_warning; +mod credit_bank_employment_warning_type; mod credit_bank_income; mod credit_bank_income_account; +mod credit_bank_income_account_type; +mod credit_bank_income_category; mod credit_bank_income_cause; +mod credit_bank_income_error_type; mod credit_bank_income_get_request_options; mod credit_bank_income_get_response; mod credit_bank_income_historical_summary; mod credit_bank_income_item; +mod credit_bank_income_pay_frequency; mod credit_bank_income_refresh_request_options; mod credit_bank_income_refresh_response; mod credit_bank_income_source; mod credit_bank_income_summary; mod credit_bank_income_transaction; mod credit_bank_income_warning; +mod credit_bank_income_warning_code; +mod credit_bank_income_warning_type; mod credit_bank_income_webhook_update_response; mod credit_bank_statement_upload_account_owner; mod credit_bank_statement_upload_account_owner_address; @@ -1107,6 +1650,7 @@ mod credit_bank_statement_upload_bank_account_period; mod credit_bank_statement_upload_item; mod credit_bank_statement_upload_object; mod credit_bank_statement_upload_transaction; +mod credit_bank_statements_uploads_get_request_options; mod credit_bank_statements_uploads_get_response; mod credit_card_liability; mod credit_category; @@ -1141,6 +1685,8 @@ mod credit_pay_stub_earnings; mod credit_pay_stub_employee; mod credit_pay_stub_employer; mod credit_pay_stub_net_pay; +mod credit_pay_stub_pay_basis_type; +mod credit_payroll_income_get_request_options; mod credit_payroll_income_get_response; mod credit_payroll_income_parsing_config_update_response; mod credit_payroll_income_precheck_response; @@ -1153,7 +1699,9 @@ mod credit_relay_refresh_response; mod credit_relay_remove_response; mod credit_session; mod credit_session_bank_employment_result; +mod credit_session_bank_employment_status; mod credit_session_bank_income_result; +mod credit_session_bank_income_status; mod credit_session_document_income_result; mod credit_session_error; mod credit_session_item_add_result; @@ -1165,6 +1713,8 @@ mod customer_initiated_return_risk; mod dashboard_user; mod dashboard_user_get_response; mod dashboard_user_list_response; +mod dashboard_user_status; +mod data_sources; mod date_range; mod deductions; mod deductions_breakdown; @@ -1179,16 +1729,23 @@ mod deposit_switch_state_update_webhook; mod deposit_switch_target_account; mod deposit_switch_target_user; mod deposit_switch_token_create_response; +mod depository_account_subtype; +mod depository_account_subtypes; mod depository_filter; mod detailed_originator; mod detected_account; mod distribution_breakdown; +mod doc_type; mod document_analysis; +mod document_authenticity_match_code; +mod document_date_of_birth_match_code; mod document_metadata; +mod document_name_match_code; mod document_risk_signal; mod document_risk_signal_institution_metadata; mod document_risk_signals_object; mod document_risk_summary; +mod document_status; mod documentary_verification; mod documentary_verification_document; mod earnings; @@ -1202,12 +1759,15 @@ mod employer; mod employer_verification; mod employers_search_response; mod employment_details; +mod employment_source_type; mod employment_verification; mod employment_verification_get_response; mod employment_verification_status; mod enhancements; +mod enrich_transaction_direction; mod enrichments; mod entity_document; +mod entity_document_type; mod entity_screening_hit_analysis; mod entity_screening_hit_data; mod entity_screening_hit_documents_items; @@ -1220,49 +1780,79 @@ mod entity_screening_hit_urls; mod entity_screening_hit_urls_items; mod entity_screening_hits_phone_number_items; mod entity_screening_status_updated_webhook; +mod entity_watchlist_code; mod entity_watchlist_program; mod entity_watchlist_screening; mod entity_watchlist_screening_hit; mod entity_watchlist_screening_review; mod entity_watchlist_screening_search_terms; mod entity_watchlist_search_terms; +mod expiration_date; +mod extended_recipient_metadata; mod external_payment_initiation_consent_options; mod external_payment_options; mod external_payment_refund_details; mod external_payment_schedule_base; mod external_payment_schedule_request; +mod fdx_content_types; mod fdx_fi_attribute; mod fdx_hateoas_link; +mod fdx_hateoas_link_action; +mod fdx_notification_category; mod fdx_notification_payload; +mod fdx_notification_payload_id_type; +mod fdx_notification_priority; +mod fdx_notification_severity; +mod fdx_notification_type; mod fdx_party; +mod fdx_party_registry; +mod fdx_party_type; +mod fdx_recipient_metadata; mod fallback_auth_microdeposit_auto_verified_webhook; mod fallback_auth_microdeposit_verification_expired_webhook; mod financial_institution_insights; +mod forecasted_monthly_income; +mod form1099_type; mod fraud_amount; mod generic_screening_hit_location_items; +mod get_recipient_response; +mod get_recipients_response; mod health_incident; +mod hidden_match_summary_code; +mod historical_annual_income; mod historical_balance; mod historical_update_webhook; mod holding; mod holdings_default_update_webhook; mod holdings_override; +mod hosted_link_delivery_method; mod hosted_mmd_verification_webhook; +mod id_number_type; +mod iso_currency_code; mod identity_default_update_webhook; -mod identity_document; -mod identity_document_metadata; +mod identity_document_upload; +mod identity_document_upload_metadata; +mod identity_document_upload_risk_insights; +mod identity_document_upload_risk_signal; +mod identity_document_upload_risk_summary; +mod identity_documents_uploads_get_request_options; +mod identity_documents_uploads_get_response; mod identity_get_request_options; mod identity_get_response; mod identity_match_request_options; mod identity_match_response; mod identity_match_user; mod identity_refresh_response; +mod identity_update_types; mod identity_verification; mod identity_verification_autofill_address; mod identity_verification_autofill_create_response; +mod identity_verification_autofill_status; mod identity_verification_autofill_user_data; mod identity_verification_create_request_user; mod identity_verification_create_response; mod identity_verification_document_address_response; +mod identity_verification_document_name_response; mod identity_verification_get_response; mod identity_verification_list_response; mod identity_verification_request_user; @@ -1271,21 +1861,28 @@ mod identity_verification_response_user_name; mod identity_verification_retried_webhook; mod identity_verification_retry_request_steps_object; mod identity_verification_retry_response; +mod identity_verification_status; mod identity_verification_status_updated_webhook; +mod identity_verification_step_status; mod identity_verification_step_summary; mod identity_verification_step_updated_webhook; mod identity_verification_template_reference; mod identity_verification_user_address; mod identity_verification_user_data; +mod image_quality; mod incident_update; mod income_breakdown; mod income_breakdown_type; mod income_override; +mod income_sources_counts; mod income_summary_field_number; mod income_summary_field_string; mod income_verification_create_request_options; mod income_verification_create_response; +mod income_verification_doc_parsing_config; +mod income_verification_payroll_flow_type; mod income_verification_paystubs_get_response; +mod income_verification_precheck_confidence; mod income_verification_precheck_employer; mod income_verification_precheck_employer_address; mod income_verification_precheck_military_info; @@ -1294,10 +1891,12 @@ mod income_verification_precheck_response; mod income_verification_precheck_user; mod income_verification_refresh_reconnect_needed_webhook; mod income_verification_risk_signals_status_webhook; +mod income_verification_source_type; mod income_verification_status_webhook; mod income_verification_taxforms_get_response; mod individual_name; mod individual_screening_hit_names; +mod individual_watchlist_code; mod individual_watchlist_program; mod inflow_model; mod initial_update_webhook; @@ -1312,9 +1911,14 @@ mod institutions_get_response; mod institutions_search_payment_initiation_options; mod institutions_search_request_options; mod institutions_search_response; +mod investment_account_subtype; +mod investment_account_subtypes; mod investment_filter; mod investment_holdings_get_request_options; mod investment_transaction; +mod investment_transaction_subtype; +mod investment_transaction_type; +mod investments_auth_data_sources; mod investments_auth_get_numbers; mod investments_auth_get_request_options; mod investments_auth_get_response; @@ -1326,12 +1930,21 @@ mod investments_refresh_response; mod investments_transactions_get_request_options; mod investments_transactions_get_response; mod investments_transactions_override; +mod issue; +mod issue_resolved_webhook; +mod issues_get_response; +mod issues_search_response; +mod issues_status; +mod issues_subscribe_response; +mod issuing_country; mod item; mod item_access_token_invalidate_response; mod item_activity_list_response; +mod item_add_result_webhook; mod item_application_list_response; mod item_application_scopes_update_response; mod item_application_unlink_response; +mod item_create_authentication; mod item_error_webhook; mod item_get_response; mod item_import_request_options; @@ -1347,10 +1960,12 @@ mod item_status_investments; mod item_status_last_webhook; mod item_status_transactions; mod item_webhook_update_response; +mod item_with_consent_fields; mod jwk_public_key; mod kyc_check_address_summary; mod kyc_check_date_of_birth_summary; mod kyc_check_details; +mod kyc_check_details_international_address; mod kyc_check_id_number_summary; mod kyc_check_name_summary; mod kyc_check_phone_summary; @@ -1366,28 +1981,51 @@ mod link_delivery_account; mod link_delivery_callback_webhook; mod link_delivery_communication_method; mod link_delivery_create_response; +mod link_delivery_delivery_method; mod link_delivery_get_response; mod link_delivery_institution; mod link_delivery_metadata; mod link_delivery_options; mod link_delivery_recipient; +mod link_delivery_session_status; +mod link_delivery_verification_status; +mod link_delivery_webhook_callback_type; +mod link_delivery_webhook_communication_method; +mod link_delivery_webhook_delivery_status; mod link_event; +mod link_event_metadata; +mod link_event_name; mod link_events_webhook; mod link_o_auth_correlation_id_exchange_response; +mod link_profile_eligibility_check_response; +mod link_profile_eligibility_check_user; +mod link_session_bank_income_result; +mod link_session_cra_item_add_result; mod link_session_exit; +mod link_session_exit_deprecated; mod link_session_exit_metadata; mod link_session_exit_metadata_institution; mod link_session_finished_webhook; +mod link_session_item_add_result; +mod link_session_payroll_income_result; +mod link_session_results; mod link_session_success; mod link_session_success_metadata; mod link_session_success_metadata_account; mod link_session_success_metadata_institution; +mod link_session_success_metadata_transfer_status; mod link_token_account_filters; mod link_token_create_card_switch; mod link_token_create_hosted_link; +mod link_token_create_identity; mod link_token_create_institution_data; mod link_token_create_request_auth; mod link_token_create_request_base_report; +mod link_token_create_request_cra_options; +mod link_token_create_request_cra_options_base_report; +mod link_token_create_request_cra_options_cashflow_insights; +mod link_token_create_request_cra_options_partner_insights; +mod link_token_create_request_credit_partner_insights; mod link_token_create_request_deposit_switch; mod link_token_create_request_employment; mod link_token_create_request_employment_bank_income; @@ -1395,6 +2033,7 @@ mod link_token_create_request_identity_verification; mod link_token_create_request_income_verification; mod link_token_create_request_income_verification_bank_income; mod link_token_create_request_income_verification_payroll_income; +mod link_token_create_request_payment_configuration; mod link_token_create_request_payment_initiation; mod link_token_create_request_statements; mod link_token_create_request_transfer; @@ -1411,20 +2050,39 @@ mod link_token_investments_auth; mod link_token_transactions; mod link_user_delivery_status_webhook; mod loan; +mod loan_account_subtype; +mod loan_account_subtypes; mod loan_filter; mod loan_identifier; +mod loan_identifier_type; mod loan_identifiers; +mod loan_payments_counts; +mod loan_payments_merchant_counts; mod loans; mod location; mod match_summary; +mod match_summary_code; mod merchant_insights; mod meta; +mod monitoring_consumer_report_permissible_purpose; +mod monitoring_income_insights; +mod monitoring_income_source; +mod monitoring_insights; +mod monitoring_insights_item_status; +mod monitoring_insights_status; +mod monitoring_insights_webhook; +mod monitoring_item_status_code; +mod monitoring_loan_insights; mod mortgage_interest_rate; mod mortgage_liability; mod mortgage_property_address; mod multi_document_risk_signal; mod name_match_score; mod net_pay; +mod network_insights_item; +mod network_insights_report; +mod network_insights_report_get_response; +mod network_insights_schema; mod new_accounts_available_webhook; mod numbers; mod numbers_acats; @@ -1434,12 +2092,18 @@ mod numbers_bacs; mod numbers_eft; mod numbers_international; mod numbers_international_iban; +mod omittable_transfer_type; mod option_contract; mod originator; +mod originator_expected_transfer_frequency; +mod other_account_subtype; +mod other_account_subtypes; mod other_filter; +mod override_account_type; mod owner; mod owner_override; mod ownership_type; +mod po_box_status; mod pslf_status; mod parties; mod partner_customer_create_response; @@ -1452,13 +2116,19 @@ mod partner_end_customer_address; mod partner_end_customer_assets_under_management; mod partner_end_customer_billing_contact; mod partner_end_customer_customer_support_info; +mod partner_end_customer_flowdown_status; mod partner_end_customer_o_auth_institution; +mod partner_end_customer_o_auth_institution_application_status; mod partner_end_customer_o_auth_institution_environments; +mod partner_end_customer_o_auth_status_updated_values; mod partner_end_customer_o_auth_status_updated_webhook; +mod partner_end_customer_questionnaire_status; +mod partner_end_customer_status; mod partner_end_customer_technical_contact; mod partner_end_customer_with_secrets; mod party; mod party_individual; +mod party_role_type; mod pay; mod pay_frequency_value; mod pay_period_details; @@ -1471,26 +2141,38 @@ mod pay_stub_earnings_total; mod pay_stub_pay_period_details; mod pay_stub_taxpayer_id; mod payment_amount; +mod payment_amount_currency; mod payment_amount_nullable; mod payment_amount_refunded; mod payment_amount_to_refund; +mod payment_channel; mod payment_consent_max_payment_amount; +mod payment_consent_periodic_alignment; mod payment_consent_periodic_amount; mod payment_consent_periodic_amount_amount; +mod payment_consent_periodic_interval; mod payment_consent_valid_date_time; mod payment_initiation_address; mod payment_initiation_consent_constraints; mod payment_initiation_consent_create_response; mod payment_initiation_consent_get_response; +mod payment_initiation_consent_payer_details; +mod payment_initiation_consent_payer_numbers; mod payment_initiation_consent_payment_execute_response; +mod payment_initiation_consent_processing_mode; mod payment_initiation_consent_revoke_response; +mod payment_initiation_consent_scope; +mod payment_initiation_consent_status; +mod payment_initiation_consent_type; mod payment_initiation_maximum_payment_amount; mod payment_initiation_metadata; mod payment_initiation_payment; mod payment_initiation_payment_create_response; +mod payment_initiation_payment_create_status; mod payment_initiation_payment_get_response; mod payment_initiation_payment_list_response; mod payment_initiation_payment_reverse_response; +mod payment_initiation_payment_status; mod payment_initiation_payment_token_create_response; mod payment_initiation_recipient; mod payment_initiation_recipient_create_response; @@ -1501,6 +2183,8 @@ mod payment_meta; mod payment_profile_create_response; mod payment_profile_get_response; mod payment_profile_remove_response; +mod payment_profile_status; +mod payment_schedule_interval; mod payment_scheme; mod payment_status_update_webhook; mod payroll_income_account_data; @@ -1514,22 +2198,46 @@ mod paystub_address; mod paystub_details; mod paystub_employer; mod paystub_override; +mod paystub_override_deductions; +mod paystub_override_deductions_breakdown; +mod paystub_override_deductions_total; mod paystub_override_distribution_breakdown; +mod paystub_override_earnings; +mod paystub_override_earnings_breakdown; +mod paystub_override_earnings_total; mod paystub_override_employee; mod paystub_override_employee_address; mod paystub_override_employer; +mod paystub_override_employer_address; +mod paystub_override_net_pay; mod paystub_override_pay_period_details; +mod paystub_override_taxpayer_id; mod paystub_pay_frequency; mod paystub_ytd_details; +mod pending_disconnect_webhook; +mod pending_disconnect_webhook_reason; mod pending_expiration_webhook; mod personal_finance_category; mod phone_number; mod phone_number_match_score; +mod phone_type; +mod physical_document_category; mod physical_document_extracted_data; mod physical_document_extracted_data_analysis; mod physical_document_images; mod plaid_error; +mod plaid_error_type; mod platform_ids; +mod prism_cash_score; +mod prism_cash_score_metadata; +mod prism_cash_score_version; +mod prism_first_detect; +mod prism_first_detect_version; +mod prism_insights; +mod prism_insights_result; +mod prism_insights_version; +mod prism_product; +mod prism_versions; mod processor_account_get_response; mod processor_auth_get_response; mod processor_balance_get_request_options; @@ -1564,6 +2272,17 @@ mod product_permissions_required_auth_webhook; mod product_permissions_required_identity_webhook; mod product_status; mod product_status_breakdown; +mod products; +mod profile_get_response; +mod profile_identity; +mod profile_identity_address; +mod profile_identity_name; +mod profile_item; +mod profile_network_status_get_network_status; +mod profile_network_status_get_response; +mod profile_network_status_get_user; +mod program_name_sensitivity; +mod proxy_type; mod recipient_bacs; mod recipient_bacs_nullable; mod recurrence; @@ -1571,31 +2290,51 @@ mod recurring_cancelled_webhook; mod recurring_frequency; mod recurring_insights_stream; mod recurring_new_transfer_webhook; +mod recurring_transaction_frequency; mod recurring_transactions; mod recurring_transactions_update_webhook; mod recurring_transfer; mod recurring_transfer_nullable; mod recurring_transfer_skipped_webhook; mod removed_transaction; +mod report_type; mod reporting_information; mod risk_check_behavior; +mod risk_check_behavior_bot_detected_label; +mod risk_check_behavior_fraud_ring_detected_label; +mod risk_check_behavior_user_interactions_label; mod risk_check_details; mod risk_check_device; mod risk_check_email; +mod risk_check_email_domain_is_custom; +mod risk_check_email_domain_is_disposable; +mod risk_check_email_domain_is_free_provider; +mod risk_check_email_is_deliverable_status; +mod risk_check_email_top_level_domain_is_suspicious; mod risk_check_identity_abuse_signals; +mod risk_check_linked_service; mod risk_check_phone; mod risk_check_stolen_identity; mod risk_check_synthetic_identity; mod risk_profile; +mod risk_reason; mod risk_signal_document_reference; +mod risk_signal_document_status; +mod risk_signal_document_type; +mod risk_signal_file_type; mod role; mod role_detail; mod roles; +mod ruleset; +mod sms_verification; +mod sms_verification_status; mod sandbox_bank_income_fire_webhook_response; +mod sandbox_bank_income_webhook_fire_request_webhook_code; mod sandbox_bank_income_webhook_fire_request_webhook_fields; mod sandbox_bank_transfer_fire_webhook_response; mod sandbox_bank_transfer_simulate_response; mod sandbox_income_fire_webhook_response; +mod sandbox_income_webhook_fire_request_webhook_code; mod sandbox_item_fire_webhook_response; mod sandbox_item_reset_login_response; mod sandbox_item_set_verification_status_response; @@ -1606,6 +2345,7 @@ mod sandbox_processor_token_create_response; mod sandbox_public_token_create_request_income_verification_bank_income; mod sandbox_public_token_create_request_options; mod sandbox_public_token_create_request_options_income_verification; +mod sandbox_public_token_create_request_options_statements; mod sandbox_public_token_create_request_options_transactions; mod sandbox_public_token_create_response; mod sandbox_transfer_fire_webhook_response; @@ -1620,7 +2360,9 @@ mod sandbox_transfer_test_clock_advance_response; mod sandbox_transfer_test_clock_create_response; mod sandbox_transfer_test_clock_get_response; mod sandbox_transfer_test_clock_list_response; +mod sandbox_user_reset_login_response; mod scopes; +mod scopes_context; mod screening_hit_analysis; mod screening_hit_data; mod screening_hit_date_of_birth_item; @@ -1630,19 +2372,28 @@ mod screening_status_updated_webhook; mod security; mod security_override; mod selfie_analysis; +mod selfie_analysis_document_comparison; +mod selfie_analysis_facial_analysis; +mod selfie_analysis_facial_analysis_outcome; +mod selfie_analysis_liveness_check; mod selfie_capture; mod selfie_check; mod selfie_check_selfie; +mod selfie_check_status; +mod selfie_status; mod service; mod service_product_fulfillment; mod service_product_fulfillment_detail; +mod service_product_fulfillment_identifier; mod servicer_address_data; mod services; mod signal_address_data; +mod signal_decision_outcome; mod signal_decision_report_response; mod signal_device; mod signal_evaluate_core_attributes; mod signal_evaluate_response; +mod signal_payment_method; mod signal_person_name; mod signal_prepare_response; mod signal_return_report_response; @@ -1651,25 +2402,39 @@ mod signal_user; mod signal_warning; mod simulated_transfer_sweep; mod single_document_risk_signal; +mod source; mod statements_account; mod statements_list_response; +mod statements_refresh_complete_result; mod statements_refresh_complete_webhook; mod statements_refresh_response; mod statements_statement; mod status; mod statuses; +mod strategy; mod student_loan; mod student_loan_repayment_model; mod student_loan_status; mod student_repayment_plan; mod sweep_status; +mod sweep_trigger; mod sync_updates_available_webhook; mod taxform; mod taxpayer_id; mod taxpayer_identifier; +mod taxpayer_identifier_type; mod taxpayer_identifiers; mod total; mod total_canonical_description; +mod total_inflow_amount; +mod total_inflow_amount30_d; +mod total_inflow_amount60_d; +mod total_inflow_amount90_d; +mod total_monthly_income_insights; +mod total_outflow_amount; +mod total_outflow_amount30_d; +mod total_outflow_amount60_d; +mod total_outflow_amount90_d; mod transaction; mod transaction_base; mod transaction_code; @@ -1677,6 +2442,7 @@ mod transaction_counterparty; mod transaction_override; mod transaction_stream; mod transaction_stream_amount; +mod transaction_stream_status; mod transactions_category_rule; mod transactions_enhance_get_response; mod transactions_enrich_request_options; @@ -1688,25 +2454,34 @@ mod transactions_recurring_get_response; mod transactions_refresh_response; mod transactions_removed_webhook; mod transactions_rule_details; +mod transactions_rule_field; +mod transactions_rule_type; mod transactions_rules_create_response; mod transactions_rules_list_response; mod transactions_rules_remove_response; mod transactions_sync_request_options; mod transactions_sync_response; +mod transactions_update_status; mod transactions_user_insights_get_response; mod transfer; +mod transfer_ach_network; mod transfer_authorization; +mod transfer_authorization_cancel_response; mod transfer_authorization_create_response; +mod transfer_authorization_decision; mod transfer_authorization_decision_rationale; mod transfer_authorization_decision_rationale_code; mod transfer_authorization_device; mod transfer_authorization_guarantee_decision; mod transfer_authorization_guarantee_decision_rationale; +mod transfer_authorization_guarantee_decision_rationale_code; mod transfer_authorization_payment_risk; mod transfer_authorization_proposed_transfer; +mod transfer_authorization_risk_level; mod transfer_authorization_user_in_request; mod transfer_balance; mod transfer_balance_get_response; +mod transfer_balance_type; mod transfer_cancel_response; mod transfer_capabilities_get_rtp; mod transfer_capabilities_get_response; @@ -1717,85 +2492,133 @@ mod transfer_credit_usage_configuration; mod transfer_debit_usage_configuration; mod transfer_device; mod transfer_diligence_document_upload_response; +mod transfer_diligence_status; mod transfer_diligence_submit_response; +mod transfer_document_purpose; mod transfer_event; mod transfer_event_list_response; mod transfer_event_list_transfer_type; mod transfer_event_sync_response; +mod transfer_event_type; mod transfer_events_update_webhook; mod transfer_expected_sweep_settlement_schedule_item; mod transfer_failure; mod transfer_funding_account; mod transfer_get_response; +mod transfer_intent_authorization_decision; mod transfer_intent_create; +mod transfer_intent_create_mode; +mod transfer_intent_create_network; mod transfer_intent_create_response; mod transfer_intent_get; mod transfer_intent_get_failure_reason; mod transfer_intent_get_response; +mod transfer_intent_status; mod transfer_ledger_balance; mod transfer_ledger_deposit_response; mod transfer_ledger_distribute_response; mod transfer_ledger_get_response; +mod transfer_ledger_sweep_simulate_event_type; mod transfer_ledger_withdraw_response; mod transfer_list_response; mod transfer_metadata; +mod transfer_metrics_get_authorization_usage; mod transfer_metrics_get_response; +mod transfer_metrics_get_return_rates; +mod transfer_metrics_get_return_rates_over_interval; mod transfer_migrate_account_response; +mod transfer_network; mod transfer_originator_address; mod transfer_originator_create_response; mod transfer_originator_diligence; mod transfer_originator_funding_account_update_response; mod transfer_originator_get_response; mod transfer_originator_list_response; +mod transfer_platform_originator_create_response; +mod transfer_platform_person_address; +mod transfer_platform_person_create_response; +mod transfer_platform_person_id_number; +mod transfer_platform_person_name; +mod transfer_platform_requirement; +mod transfer_platform_requirement_submission; +mod transfer_platform_requirement_submit_response; +mod transfer_platform_tos_acceptance_metadata; mod transfer_questionnaire_create_response; mod transfer_recurring_cancel_response; mod transfer_recurring_create_response; mod transfer_recurring_get_response; mod transfer_recurring_list_response; +mod transfer_recurring_network; mod transfer_recurring_schedule; +mod transfer_recurring_status; mod transfer_refund; mod transfer_refund_cancel_response; mod transfer_refund_create_response; mod transfer_refund_failure; mod transfer_refund_get_response; +mod transfer_refund_status; mod transfer_repayment; mod transfer_repayment_list_response; mod transfer_repayment_return; mod transfer_repayment_return_list_response; +mod transfer_schedule_interval_unit; +mod transfer_status; mod transfer_sweep; mod transfer_sweep_get_response; mod transfer_sweep_list_response; mod transfer_sweep_status; mod transfer_test_clock; +mod transfer_type; mod transfer_user_address_in_request; mod transfer_user_address_in_response; mod transfer_user_in_request; mod transfer_user_in_request_deprecated; mod transfer_user_in_response; +mod transfer_wire_details; mod update_entity_screening_request_search_terms; mod update_individual_screening_request_search_terms; +mod user_account_identity; +mod user_account_identity_address; +mod user_account_identity_name; +mod user_account_item; mod user_account_revoked_webhook; +mod user_account_session_get_response; mod user_address; mod user_create_response; mod user_data_overview; mod user_id_number; +mod user_items_get_response; mod user_permission_revoked_webhook; +mod user_remove_response; +mod user_stated_income_source_category; +mod user_stated_income_source_frequency; +mod user_stated_income_source_pay_type; +mod user_third_party_token_create_response; +mod user_third_party_token_remove_response; mod user_update_response; mod validation_source; mod validation_sources; mod verification_expired_webhook; mod verification_of_asset; mod verification_of_asset_response; +mod verification_status; +mod verify_sms_details; +mod verify_sms_details_status; mod w2; mod w2_box12; +mod w2_box12_override; +mod w2_override; mod w2_state_and_local_wages; +mod w2_state_and_local_wages_override; mod wallet; mod wallet_balance; mod wallet_create_response; mod wallet_get_response; +mod wallet_iso_currency_code; mod wallet_list_response; mod wallet_numbers; mod wallet_payment_scheme; +mod wallet_status; mod wallet_transaction; mod wallet_transaction_amount; mod wallet_transaction_counterparty; @@ -1803,13 +2626,17 @@ mod wallet_transaction_counterparty_bacs; mod wallet_transaction_counterparty_international; mod wallet_transaction_counterparty_numbers; mod wallet_transaction_execute_response; +mod wallet_transaction_failure_reason; mod wallet_transaction_get_response; mod wallet_transaction_list_request_options; mod wallet_transaction_list_response; +mod wallet_transaction_relation; +mod wallet_transaction_status; mod wallet_transaction_status_update_webhook; mod warning; mod watchlist_screening_audit_trail; mod watchlist_screening_document; +mod watchlist_screening_document_type; mod watchlist_screening_entity_create_response; mod watchlist_screening_entity_get_response; mod watchlist_screening_entity_history_list_response; @@ -1819,9 +2646,12 @@ mod watchlist_screening_entity_program_get_response; mod watchlist_screening_entity_program_list_response; mod watchlist_screening_entity_review_create_response; mod watchlist_screening_entity_review_list_response; +mod watchlist_screening_entity_update_request_resettable_field; +mod watchlist_screening_entity_update_request_resettable_field_list; mod watchlist_screening_entity_update_response; mod watchlist_screening_hit; mod watchlist_screening_hit_locations; +mod watchlist_screening_hit_status; mod watchlist_screening_individual; mod watchlist_screening_individual_create_response; mod watchlist_screening_individual_get_response; @@ -1832,9 +2662,15 @@ mod watchlist_screening_individual_program_get_response; mod watchlist_screening_individual_program_list_response; mod watchlist_screening_individual_review_create_response; mod watchlist_screening_individual_review_list_response; +mod watchlist_screening_individual_update_request_resettable_field; +mod watchlist_screening_individual_update_request_resettable_field_list; mod watchlist_screening_individual_update_response; mod watchlist_screening_request_search_terms; mod watchlist_screening_review; mod watchlist_screening_search_terms; +mod watchlist_screening_status; +mod weak_alias_determination; +mod webhook_environment_values; +mod webhook_type; mod webhook_update_acknowledged_webhook; -mod webhook_verification_key_get_response; \ No newline at end of file +mod webhook_verification_key_get_response; diff --git a/src/model/monitoring_consumer_report_permissible_purpose.rs b/src/model/monitoring_consumer_report_permissible_purpose.rs new file mode 100644 index 00000000..0335f5ab --- /dev/null +++ b/src/model/monitoring_consumer_report_permissible_purpose.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**Describes the reason you are generating a Consumer Report for this user. + +`ACCOUNT_REVIEW_CREDIT`: In connection with a consumer credit transaction for the review or collection of an account pursuant to FCRA Section 604(a)(3)(A). + +`WRITTEN_INSTRUCTION_OTHER`: In accordance with the written instructions of the consumer pursuant to FCRA Section 604(a)(2), such as when an individual agrees to act as a guarantor or assumes personal liability for a consumer, business, or commercial loan.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum MonitoringConsumerReportPermissiblePurpose { + #[serde(rename = "ACCOUNT_REVIEW_CREDIT")] + AccountReviewCredit, + #[serde(rename = "WRITTEN_INSTRUCTION_OTHER")] + WrittenInstructionOther, +} diff --git a/src/model/monitoring_income_insights.rs b/src/model/monitoring_income_insights.rs new file mode 100644 index 00000000..e238c7e8 --- /dev/null +++ b/src/model/monitoring_income_insights.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +use super::{ + ForecastedMonthlyIncome, HistoricalAnnualIncome, IncomeSourcesCounts, + MonitoringIncomeSource, TotalMonthlyIncomeInsights, +}; +///An object representing the income subcategory of the report +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct MonitoringIncomeInsights { + ///An object representing the predicted average monthly net income amount. This amount reflects the funds deposited into the account and may not include any withheld income such as taxes or other payroll deductions + pub forecasted_monthly_income: ForecastedMonthlyIncome, + ///An object representing the historical annual income amount. + pub historical_annual_income: HistoricalAnnualIncome, + ///The income sources for this Item. Each entry in the array is a single income source + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub income_sources: Vec, + ///Details about the number of income sources + pub income_sources_counts: IncomeSourcesCounts, + ///Details about about the total monthly income + pub total_monthly_income: TotalMonthlyIncomeInsights, +} +impl std::fmt::Display for MonitoringIncomeInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/monitoring_income_source.rs b/src/model/monitoring_income_source.rs new file mode 100644 index 00000000..681dfd5f --- /dev/null +++ b/src/model/monitoring_income_source.rs @@ -0,0 +1,34 @@ +use serde::{Serialize, Deserialize}; +use super::CreditBankIncomeCategory; +///An object representing an income source +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct MonitoringIncomeSource { + /**The income category. +`BANK_INTEREST`: Interest earned from a bank account. +`BENEFIT_OTHER`: Government benefits other than retirement, unemployment, child support, or disability. Currently used only in the UK, to represent benefits such as Cost of Living Payments. +`CASH`: Deprecated and used only for existing legacy implementations. Has been replaced by `CASH_DEPOSIT` and `TRANSFER_FROM_APPLICATION`. +`CASH_DEPOSIT`: A cash or check deposit. +`CHILD_SUPPORT`: Child support payments received. +`GIG_ECONOMY`: Income earned as a gig economy worker, e.g. driving for Uber, Lyft, Postmates, DoorDash, etc. +`LONG_TERM_DISABILITY`: Disability payments, including Social Security disability benefits. +`OTHER`: Income that could not be categorized as any other income category. +`MILITARY`: Veterans benefits. Income earned as salary for serving in the military (e.g. through DFAS) will be classified as `SALARY` rather than `MILITARY`. +`RENTAL`: Income earned from a rental property. Income may be identified as rental when the payment is received through a rental platform, e.g. Airbnb; rent paid directly by the tenant to the property owner (e.g. via cash, check, or ACH) will typically not be classified as rental income. +`RETIREMENT`: Payments from private retirement systems, pensions, and government retirement programs, including Social Security retirement benefits. +`SALARY`: Payment from an employer to an earner or other form of permanent employment. +`TAX_REFUND`: A tax refund. +`TRANSFER_FROM_APPLICATION`: Deposits from a money transfer app, such as Venmo, Cash App, or Zelle. +`UNEMPLOYMENT`: Unemployment benefits. In the UK, includes certain low-income benefits such as the Universal Credit.*/ + pub income_category: CreditBankIncomeCategory, + ///The most common name or original description for the underlying income transactions + pub income_description: String, + ///A unique identifier for an income source + pub income_source_id: String, + ///The last detected transaction date for this income source + pub last_transaction_date: chrono::NaiveDate, +} +impl std::fmt::Display for MonitoringIncomeSource { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/monitoring_insights.rs b/src/model/monitoring_insights.rs new file mode 100644 index 00000000..df993b96 --- /dev/null +++ b/src/model/monitoring_insights.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::{MonitoringIncomeInsights, MonitoringLoanInsights}; +///An object representing the Monitoring Insights for the given Item +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct MonitoringInsights { + ///An object representing the income subcategory of the report + pub income: MonitoringIncomeInsights, + ///An object representing the loan exposure subcategory of the report + pub loans: MonitoringLoanInsights, +} +impl std::fmt::Display for MonitoringInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/monitoring_insights_item_status.rs b/src/model/monitoring_insights_item_status.rs new file mode 100644 index 00000000..16418788 --- /dev/null +++ b/src/model/monitoring_insights_item_status.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::MonitoringItemStatusCode; +///An object with details of the Monitoring Insights Item's status. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct MonitoringInsightsItemStatus { + /**A reason for why a Monitoring Insights Report is not available. +This field will only be populated when the `status_code` is not `AVAILABLE`*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + ///Enum for the status of the Item's insights + pub status_code: MonitoringItemStatusCode, +} +impl std::fmt::Display for MonitoringInsightsItemStatus { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/monitoring_insights_status.rs b/src/model/monitoring_insights_status.rs new file mode 100644 index 00000000..af179cf1 --- /dev/null +++ b/src/model/monitoring_insights_status.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///Enum for the status of the insights +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum MonitoringInsightsStatus { + #[serde(rename = "AVAILABLE")] + Available, + #[serde(rename = "FAILED")] + Failed, + #[serde(rename = "PENDING")] + Pending, + #[serde(rename = "UNSUPPORTED")] + Unsupported, + #[serde(rename = "UNHEALTHY")] + Unhealthy, +} diff --git a/src/model/monitoring_insights_webhook.rs b/src/model/monitoring_insights_webhook.rs new file mode 100644 index 00000000..bc2ec821 --- /dev/null +++ b/src/model/monitoring_insights_webhook.rs @@ -0,0 +1,24 @@ +use serde::{Serialize, Deserialize}; +use super::{MonitoringInsightsStatus, WebhookEnvironmentValues}; +///For each user enabled for Cash Flow Updates, this webhook will fire every 14 days with information on the status of the update. Upon receiving the webhook, call `/cra/monitoring_insights/get` to retrieve the updated insights. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct MonitoringInsightsWebhook { + ///The Plaid environment the webhook was sent from + pub environment: WebhookEnvironmentValues, + ///The reason for why insights may not be `AVAILABLE` + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + ///Enum for the status of the insights + pub status: MonitoringInsightsStatus, + ///The `user_id` that the report is associated with + pub user_id: String, + ///`INSIGHTS_UPDATED` + pub webhook_code: String, + ///`CRA_MONITORING` + pub webhook_type: String, +} +impl std::fmt::Display for MonitoringInsightsWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/monitoring_item_status_code.rs b/src/model/monitoring_item_status_code.rs new file mode 100644 index 00000000..c6655545 --- /dev/null +++ b/src/model/monitoring_item_status_code.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///Enum for the status of the Item's insights +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum MonitoringItemStatusCode { + #[serde(rename = "AVAILABLE")] + Available, + #[serde(rename = "FAILED")] + Failed, + #[serde(rename = "PENDING")] + Pending, + #[serde(rename = "ITEM_NOT_SUPPORTED")] + ItemNotSupported, + #[serde(rename = "ITEM_LOGIN_REQUIRED")] + ItemLoginRequired, +} diff --git a/src/model/monitoring_loan_insights.rs b/src/model/monitoring_loan_insights.rs new file mode 100644 index 00000000..38077f32 --- /dev/null +++ b/src/model/monitoring_loan_insights.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::{LoanPaymentsCounts, LoanPaymentsMerchantCounts}; +///An object representing the loan exposure subcategory of the report +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct MonitoringLoanInsights { + ///The number of loan disbursements detected in the last 30 days + pub loan_disbursements_count: f64, + ///Details regarding the number of unique loan payment merchants + pub loan_payment_merchants_counts: LoanPaymentsMerchantCounts, + ///Details regarding the number of loan payments + pub loan_payments_counts: LoanPaymentsCounts, +} +impl std::fmt::Display for MonitoringLoanInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/mortgage_interest_rate.rs b/src/model/mortgage_interest_rate.rs index 6ff1334f..1c1316c9 100644 --- a/src/model/mortgage_interest_rate.rs +++ b/src/model/mortgage_interest_rate.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for MortgageInterestRate { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/mortgage_liability.rs b/src/model/mortgage_liability.rs index af045681..f206eae8 100644 --- a/src/model/mortgage_liability.rs +++ b/src/model/mortgage_liability.rs @@ -64,4 +64,4 @@ impl std::fmt::Display for MortgageLiability { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/mortgage_property_address.rs b/src/model/mortgage_property_address.rs index bf02145b..fafa6412 100644 --- a/src/model/mortgage_property_address.rs +++ b/src/model/mortgage_property_address.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for MortgagePropertyAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/multi_document_risk_signal.rs b/src/model/multi_document_risk_signal.rs index 0d45e69b..81b65a58 100644 --- a/src/model/multi_document_risk_signal.rs +++ b/src/model/multi_document_risk_signal.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for MultiDocumentRiskSignal { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/name_match_score.rs b/src/model/name_match_score.rs index d7a00cc2..533c6eb3 100644 --- a/src/model/name_match_score.rs +++ b/src/model/name_match_score.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; ///Score found by matching name provided by the API with the name on the account at the financial institution. If the account contains multiple owners, the maximum match score is filled. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct NameMatchScore { - ///Is `true` if the name on either of the names that was matched for the score contained strings indicative of a business name, such as "CORP", "LLC", "INC", or "LTD". A `true` result generally indicates the entity is a business. However, a `false` result does not mean the entity is not a business, as some businesses do not use these strings in the names used for their financial institution accounts. + ///Is `true` if the name on either of the names that was matched for the score contained strings indicative of a business name, such as "CORP", "LLC", "INC", or "LTD". A `true` result generally indicates that an account's name is a business name. However, a `false` result does not mean the account name is not a business name, as some businesses do not use these strings in the names used for their financial institution accounts. #[serde(default, skip_serializing_if = "Option::is_none")] pub is_business_name_detected: Option, ///first or last name completely matched, likely a family member @@ -19,4 +19,4 @@ impl std::fmt::Display for NameMatchScore { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/net_pay.rs b/src/model/net_pay.rs index 98bfe481..e9f8caa7 100644 --- a/src/model/net_pay.rs +++ b/src/model/net_pay.rs @@ -28,4 +28,4 @@ impl std::fmt::Display for NetPay { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/network_insights_item.rs b/src/model/network_insights_item.rs new file mode 100644 index 00000000..62e5f2cb --- /dev/null +++ b/src/model/network_insights_item.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///Contains data about the connected Item. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct NetworkInsightsItem { + ///The ID for the institution the user linked. + pub institution_id: String, + ///The name of the institution the user linked. + pub institution_name: String, + ///The identifier for the Item. + pub item_id: String, +} +impl std::fmt::Display for NetworkInsightsItem { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/network_insights_report.rs b/src/model/network_insights_report.rs new file mode 100644 index 00000000..1baf7acc --- /dev/null +++ b/src/model/network_insights_report.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +use super::{NetworkInsightsItem, NetworkInsightsSchema}; +///Contains data for the Network Insights Report. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct NetworkInsightsReport { + ///The time when the Network Insights Report was generated. + pub generated_time: chrono::DateTime, + ///A list of Items associated with the provided access_tokens. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub items: Vec, + ///A map of network attributes, where the key is a string, and the value is a float, int, or boolean. + pub network_attributes: NetworkInsightsSchema, + ///The unique identifier associated with the Network Insights report object. + pub report_id: String, +} +impl std::fmt::Display for NetworkInsightsReport { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/network_insights_report_get_response.rs b/src/model/network_insights_report_get_response.rs new file mode 100644 index 00000000..bc939bb7 --- /dev/null +++ b/src/model/network_insights_report_get_response.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::NetworkInsightsReport; +///NetworkInsightsReportGetResponse defines the response schema for `/network_insights/report/get`. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct NetworkInsightsReportGetResponse { + ///Contains data for the Network Insights Report. + pub report: NetworkInsightsReport, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for NetworkInsightsReportGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/network_insights_schema.rs b/src/model/network_insights_schema.rs new file mode 100644 index 00000000..1b42e7dd --- /dev/null +++ b/src/model/network_insights_schema.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///A map of network attributes, where the key is a string, and the value is a float, int, or boolean. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct NetworkInsightsSchema {} +impl std::fmt::Display for NetworkInsightsSchema { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/new_accounts_available_webhook.rs b/src/model/new_accounts_available_webhook.rs index 330ef09f..907e1e22 100644 --- a/src/model/new_accounts_available_webhook.rs +++ b/src/model/new_accounts_available_webhook.rs @@ -1,12 +1,12 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; -///Fired when Plaid detects a new account for Items created or updated with [Account Select v2](https://plaid.com/docs/link/customization/#account-select). Upon receiving this webhook, you can prompt your users to share new accounts with you through [Account Select v2 update mode](https://plaid.com/docs/link/update-mode/#using-update-mode-to-request-new-accounts). -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::{PlaidError, WebhookEnvironmentValues}; +///Fired when Plaid detects a new account. Upon receiving this webhook, you can prompt your users to share new accounts with you through [update mode](https://plaid.com/docs/link/update-mode/#using-update-mode-to-request-new-accounts) (US/CA only). If the end user has opted not to share new accounts with Plaid via their institution's OAuth settings, Plaid will not detect new accounts and this webhook will not fire. For end user accounts in the EU and UK, upon receiving this webhook, you can prompt your user to re-link their account and then delete the old Item via `/item/remove`. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct NewAccountsAvailableWebhook { ///The Plaid environment the webhook was sent from #[serde(default, skip_serializing_if = "Option::is_none")] - pub environment: Option, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: Option, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -23,4 +23,4 @@ impl std::fmt::Display for NewAccountsAvailableWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/numbers.rs b/src/model/numbers.rs index d560c742..da2dd17e 100644 --- a/src/model/numbers.rs +++ b/src/model/numbers.rs @@ -5,7 +5,7 @@ pub struct Numbers { ///Will be used for the account number. #[serde(default, skip_serializing_if = "Option::is_none")] pub account: Option, - ///Must be a valid ACH routing number. + ///Must be a valid ACH routing number. To test `/transfer/capabilities/get`, set this to 322271627 to force a `true` result. #[serde(default, skip_serializing_if = "Option::is_none")] pub ach_routing: Option, ///Must be a valid wire transfer routing number. @@ -31,4 +31,4 @@ impl std::fmt::Display for Numbers { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/numbers_acats.rs b/src/model/numbers_acats.rs index 5c4fdbbe..02585a26 100644 --- a/src/model/numbers_acats.rs +++ b/src/model/numbers_acats.rs @@ -6,7 +6,7 @@ pub struct NumbersAcats { pub account: String, ///The Plaid account ID associated with the account numbers pub account_id: String, - ///Identifiers for the clearinghouses that are assocciated with the account in order of relevance. This array will be empty if we can't provide any account level data. Institution level data can be retrieved from the institutions/get endpoints. + ///Identifiers for the clearinghouses that are associated with the account in order of relevance. This array will be empty if we can't provide any account level data. Institution level data can be retrieved from the institutions/get endpoints. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub dtc_numbers: Vec, } @@ -14,4 +14,4 @@ impl std::fmt::Display for NumbersAcats { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/numbers_ach.rs b/src/model/numbers_ach.rs index aaf2cdbf..fd3806ab 100644 --- a/src/model/numbers_ach.rs +++ b/src/model/numbers_ach.rs @@ -4,7 +4,7 @@ use serde::{Serialize, Deserialize}; pub struct NumbersAch { /**The ACH account number for the account. -Note that when using OAuth with Chase Bank (`ins_56`), Chase will issue "tokenized" routing and account numbers, which are not the user's actual account and routing numbers. These tokenized account numbers (also known as TANs) should work identically to normal account and routing numbers. The digits returned in the `mask` field will continue to reflect the actual account number, rather than the tokenized account number; for this reason, when displaying account numbers to the user to help them identify their account in your UI, always use the `mask` rather than truncating the `account` number. If a user revokes their permissions to your app, the tokenized numbers will no longer work.*/ +At certain institutions, including Chase and PNC, you will receive "tokenized" routing and account numbers, which are not the user's actual account and routing numbers. For important details on how this may impact your integration and on how to avoid fraud, user confusion, and ACH returns, see [Tokenized account numbers](https://plaid.com/docs/auth/#tokenized-account-numbers).*/ pub account: String, ///The Plaid account ID associated with the account numbers pub account_id: String, @@ -14,7 +14,7 @@ Note that when using OAuth with Chase Bank (`ins_56`), Chase will issue "tokeniz ///Whether the account supports ACH transfers out of the account #[serde(default, skip_serializing_if = "Option::is_none")] pub can_transfer_out: Option, - ///The ACH routing number for the account. If the institution is `ins_56`, this may be a tokenized routing number. For more information, see the description of the `account` field. + ///The ACH routing number for the account. This may be a tokenized routing number. For more information, see [Tokenized account numbers](https://plaid.com/docs/auth/#tokenized-account-numbers). pub routing: String, ///The wire transfer routing number for the account, if available #[serde(default, skip_serializing_if = "Option::is_none")] @@ -24,4 +24,4 @@ impl std::fmt::Display for NumbersAch { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/numbers_aton.rs b/src/model/numbers_aton.rs index a8483069..d07cecdd 100644 --- a/src/model/numbers_aton.rs +++ b/src/model/numbers_aton.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for NumbersAton { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/numbers_bacs.rs b/src/model/numbers_bacs.rs index ae4809c5..e390488b 100644 --- a/src/model/numbers_bacs.rs +++ b/src/model/numbers_bacs.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for NumbersBacs { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/numbers_eft.rs b/src/model/numbers_eft.rs index 9fd86192..69dafd0c 100644 --- a/src/model/numbers_eft.rs +++ b/src/model/numbers_eft.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for NumbersEft { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/numbers_international.rs b/src/model/numbers_international.rs index baeb2467..0ec0998b 100644 --- a/src/model/numbers_international.rs +++ b/src/model/numbers_international.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for NumbersInternational { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/numbers_international_iban.rs b/src/model/numbers_international_iban.rs index 8b84e806..9fb24a54 100644 --- a/src/model/numbers_international_iban.rs +++ b/src/model/numbers_international_iban.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for NumbersInternationalIban { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/omittable_transfer_type.rs b/src/model/omittable_transfer_type.rs new file mode 100644 index 00000000..96cd12fe --- /dev/null +++ b/src/model/omittable_transfer_type.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The type of transfer. Valid values are `debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account. This field is omitted for Plaid Ledger Sweep events. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum OmittableTransferType { + #[serde(rename = "debit")] + Debit, + #[serde(rename = "credit")] + Credit, +} diff --git a/src/model/option_contract.rs b/src/model/option_contract.rs index 9adb5264..5c82e154 100644 --- a/src/model/option_contract.rs +++ b/src/model/option_contract.rs @@ -21,4 +21,4 @@ impl std::fmt::Display for OptionContract { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/originator.rs b/src/model/originator.rs index 3e5eba11..c8faf293 100644 --- a/src/model/originator.rs +++ b/src/model/originator.rs @@ -1,14 +1,13 @@ use serde::{Serialize, Deserialize}; +use super::TransferDiligenceStatus; ///Originator and their status. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Originator { - ///The company name of the end customer. - pub company_name: String, ///Originator’s diligence status. - pub transfer_diligence_status: String, + pub transfer_diligence_status: TransferDiligenceStatus, } impl std::fmt::Display for Originator { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/originator_expected_transfer_frequency.rs b/src/model/originator_expected_transfer_frequency.rs new file mode 100644 index 00000000..7a935dd9 --- /dev/null +++ b/src/model/originator_expected_transfer_frequency.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///The originator's expected transfer frequency. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum OriginatorExpectedTransferFrequency { + #[serde(rename = "once_per_month")] + OncePerMonth, + #[serde(rename = "twice_per_month")] + TwicePerMonth, + #[serde(rename = "once_per_week")] + OncePerWeek, + #[serde(rename = "daily")] + Daily, +} diff --git a/src/model/other_account_subtype.rs b/src/model/other_account_subtype.rs new file mode 100644 index 00000000..02b71562 --- /dev/null +++ b/src/model/other_account_subtype.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///Valid account subtypes for other accounts. For a list containing descriptions of each subtype, see [Account schemas](https://plaid.com/docs/api/accounts/#StandaloneAccountType-other). +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum OtherAccountSubtype { + #[serde(rename = "other")] + Other, + #[serde(rename = "all")] + All, +} diff --git a/src/model/other_account_subtypes.rs b/src/model/other_account_subtypes.rs new file mode 100644 index 00000000..4aab17a2 --- /dev/null +++ b/src/model/other_account_subtypes.rs @@ -0,0 +1,4 @@ +use serde::{Serialize, Deserialize}; +use super::OtherAccountSubtype; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct OtherAccountSubtypes(pub Vec); diff --git a/src/model/other_filter.rs b/src/model/other_filter.rs index 393e27d7..171d95dc 100644 --- a/src/model/other_filter.rs +++ b/src/model/other_filter.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; +use super::OtherAccountSubtypes; ///A filter to apply to `other`-type accounts #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct OtherFilter { ///An array of account subtypes to display in Link. If not specified, all account subtypes will be shown. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub account_subtypes: Vec, + pub account_subtypes: OtherAccountSubtypes, } impl std::fmt::Display for OtherFilter { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/override_account_type.rs b/src/model/override_account_type.rs new file mode 100644 index 00000000..1c0f5445 --- /dev/null +++ b/src/model/override_account_type.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +/**`investment:` Investment account. + +`credit:` Credit card + +`depository:` Depository account + +`loan:` Loan account + +`payroll:` Payroll account + +`other:` Non-specified account type + +See the [Account type schema](https://plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum OverrideAccountType { + #[serde(rename = "investment")] + Investment, + #[serde(rename = "credit")] + Credit, + #[serde(rename = "depository")] + Depository, + #[serde(rename = "loan")] + Loan, + #[serde(rename = "payroll")] + Payroll, + #[serde(rename = "other")] + Other, +} diff --git a/src/model/owner.rs b/src/model/owner.rs index bc9df4a9..b6df0088 100644 --- a/src/model/owner.rs +++ b/src/model/owner.rs @@ -6,9 +6,6 @@ pub struct Owner { ///Data about the various addresses associated with the account by the financial institution. May be an empty array if no relevant information is returned from the financial institution. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub addresses: Vec
, - ///document_id is the id of the document that this identity belongs to - #[serde(default, skip_serializing_if = "Option::is_none")] - pub document_id: Option, ///A list of email addresses associated with the account by the financial institution. May be an empty array if no relevant information is returned from the financial institution. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub emails: Vec, @@ -25,4 +22,4 @@ impl std::fmt::Display for Owner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/owner_override.rs b/src/model/owner_override.rs index 1993b5c9..2fb9b4d0 100644 --- a/src/model/owner_override.rs +++ b/src/model/owner_override.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for OwnerOverride { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/ownership_type.rs b/src/model/ownership_type.rs index ced431fb..b3ec9682 100644 --- a/src/model/ownership_type.rs +++ b/src/model/ownership_type.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct OwnershipType(pub serde_json::Value); \ No newline at end of file +pub struct OwnershipType(pub serde_json::Value); diff --git a/src/model/parties.rs b/src/model/parties.rs index fdae9ee1..2f8631a5 100644 --- a/src/model/parties.rs +++ b/src/model/parties.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for Parties { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_customer_create_response.rs b/src/model/partner_customer_create_response.rs index 715bb142..56a4e872 100644 --- a/src/model/partner_customer_create_response.rs +++ b/src/model/partner_customer_create_response.rs @@ -3,7 +3,7 @@ use super::PartnerEndCustomerWithSecrets; ///Response schema for `/partner/customer/create`. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PartnerCustomerCreateResponse { - ///The details for the newly created end customer, including secrets for non-Production environments. + ///The details for the newly created end customer, including secrets for Sandbox and Limited Production. #[serde(default, skip_serializing_if = "Option::is_none")] pub end_customer: Option, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. @@ -14,4 +14,4 @@ impl std::fmt::Display for PartnerCustomerCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_customer_enable_response.rs b/src/model/partner_customer_enable_response.rs index d15a8909..830fd28b 100644 --- a/src/model/partner_customer_enable_response.rs +++ b/src/model/partner_customer_enable_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PartnerCustomerEnableResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_customer_get_response.rs b/src/model/partner_customer_get_response.rs index 7eee89d4..0de0d1bc 100644 --- a/src/model/partner_customer_get_response.rs +++ b/src/model/partner_customer_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::PartnerEndCustomer; ///Response schema for `/partner/customer/get`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PartnerCustomerGetResponse { ///The details for an end customer. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for PartnerCustomerGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_customer_o_auth_institutions_get_response.rs b/src/model/partner_customer_o_auth_institutions_get_response.rs index 5846367d..e8ba0e5a 100644 --- a/src/model/partner_customer_o_auth_institutions_get_response.rs +++ b/src/model/partner_customer_o_auth_institutions_get_response.rs @@ -1,17 +1,20 @@ use serde::{Serialize, Deserialize}; -use super::PartnerEndCustomerOAuthInstitution; +use super::{ + PartnerEndCustomerFlowdownStatus, PartnerEndCustomerOAuthInstitution, + PartnerEndCustomerQuestionnaireStatus, +}; ///Response schema for `/partner/customer/oauth_institutions/get`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PartnerCustomerOAuthInstitutionsGetResponse { ///The status of the addendum to the Plaid MSA ("flowdown") for the end customer. #[serde(default, skip_serializing_if = "Option::is_none")] - pub flowdown_status: Option, + pub flowdown_status: Option, ///The OAuth institutions with which the end customer's application is being registered. #[serde(default, skip_serializing_if = "Option::is_none")] pub institutions: Option>, ///The status of the end customer's security questionnaire. #[serde(default, skip_serializing_if = "Option::is_none")] - pub questionnaire_status: Option, + pub questionnaire_status: Option, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. #[serde(default, skip_serializing_if = "Option::is_none")] pub request_id: Option, @@ -20,4 +23,4 @@ impl std::fmt::Display for PartnerCustomerOAuthInstitutionsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_customer_remove_response.rs b/src/model/partner_customer_remove_response.rs index 9619b469..b99925bf 100644 --- a/src/model/partner_customer_remove_response.rs +++ b/src/model/partner_customer_remove_response.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for PartnerCustomerRemoveResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer.rs b/src/model/partner_end_customer.rs index 88a88c5a..4c68c6f1 100644 --- a/src/model/partner_end_customer.rs +++ b/src/model/partner_end_customer.rs @@ -1,24 +1,25 @@ use serde::{Serialize, Deserialize}; +use super::PartnerEndCustomerStatus; ///The details for an end customer. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PartnerEndCustomer { ///The company name associated with the end customer. #[serde(default, skip_serializing_if = "Option::is_none")] pub company_name: Option, /**The status of the given end customer. -`UNDER_REVIEW`: The end customer has been created and enabled in the non-Production environments. The end customer must be manually reviewed by the Plaid team before it can be enabled in production, at which point its status will automatically transition to `PENDING_ENABLEMENT` or `DENIED`. +`UNDER_REVIEW`: The end customer has been created and enabled in Sandbox and Limited Production. The end customer must be manually reviewed by the Plaid team before it can be enabled in full production, at which point its status will automatically transition to `PENDING_ENABLEMENT` or `DENIED`. -`PENDING_ENABLEMENT`: The end customer is ready to be enabled in the Production environment. Call the `/partner/customer/enable` endpoint to enable the end customer in Production. +`PENDING_ENABLEMENT`: The end customer is ready to be fully enabled in the Production environment. Call the `/partner/customer/enable` endpoint to enable the end customer in full Production. -`ACTIVE`: The end customer has been enabled in all environments. +`ACTIVE`: The end customer has been fully enabled in all environments. -`DENIED`: The end customer has been created and enabled in the non-Production environments, but it did not pass review by the Plaid team and therefore cannot be enabled in the Production environment. Talk to your Account Manager for more information.*/ +`DENIED`: The end customer has been created and enabled in Sandbox and Limited Production, but it did not pass review by the Plaid team and therefore cannot be enabled for full Production access. Talk to your Account Manager for more information.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, + pub status: Option, } impl std::fmt::Display for PartnerEndCustomer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer_address.rs b/src/model/partner_end_customer_address.rs index da44b6ac..f0bc977e 100644 --- a/src/model/partner_end_customer_address.rs +++ b/src/model/partner_end_customer_address.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for PartnerEndCustomerAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer_assets_under_management.rs b/src/model/partner_end_customer_assets_under_management.rs index 62a1e7bd..592d7ca6 100644 --- a/src/model/partner_end_customer_assets_under_management.rs +++ b/src/model/partner_end_customer_assets_under_management.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for PartnerEndCustomerAssetsUnderManagement { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer_billing_contact.rs b/src/model/partner_end_customer_billing_contact.rs index d7237d22..996f6e5d 100644 --- a/src/model/partner_end_customer_billing_contact.rs +++ b/src/model/partner_end_customer_billing_contact.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PartnerEndCustomerBillingContact { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer_customer_support_info.rs b/src/model/partner_end_customer_customer_support_info.rs index e3a538e1..9c49f21c 100644 --- a/src/model/partner_end_customer_customer_support_info.rs +++ b/src/model/partner_end_customer_customer_support_info.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for PartnerEndCustomerCustomerSupportInfo { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer_flowdown_status.rs b/src/model/partner_end_customer_flowdown_status.rs new file mode 100644 index 00000000..ab218c7e --- /dev/null +++ b/src/model/partner_end_customer_flowdown_status.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///The status of the addendum to the Plaid MSA ("flowdown") for the end customer. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PartnerEndCustomerFlowdownStatus { + #[serde(rename = "NOT_STARTED")] + NotStarted, + #[serde(rename = "IN_REVIEW")] + InReview, + #[serde(rename = "NEGOTIATION")] + Negotiation, + #[serde(rename = "COMPLETE")] + Complete, +} diff --git a/src/model/partner_end_customer_o_auth_institution.rs b/src/model/partner_end_customer_o_auth_institution.rs index 8466f68b..5cabf8e6 100644 --- a/src/model/partner_end_customer_o_auth_institution.rs +++ b/src/model/partner_end_customer_o_auth_institution.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::PartnerEndCustomerOAuthInstitutionEnvironments; ///The OAuth registration information for an institution. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PartnerEndCustomerOAuthInstitution { ///The date on which non-OAuth Item adds will no longer be supported for this institution, or an empty string if no such date has been set by the institution. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -21,4 +21,4 @@ impl std::fmt::Display for PartnerEndCustomerOAuthInstitution { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer_o_auth_institution_application_status.rs b/src/model/partner_end_customer_o_auth_institution_application_status.rs new file mode 100644 index 00000000..5ab8d433 --- /dev/null +++ b/src/model/partner_end_customer_o_auth_institution_application_status.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///The registration status for the end customer's application. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PartnerEndCustomerOAuthInstitutionApplicationStatus { + #[serde(rename = "NOT_STARTED")] + NotStarted, + #[serde(rename = "PROCESSING")] + Processing, + #[serde(rename = "APPROVED")] + Approved, + #[serde(rename = "ENABLED")] + Enabled, + #[serde(rename = "ATTENTION_REQUIRED")] + AttentionRequired, +} diff --git a/src/model/partner_end_customer_o_auth_institution_environments.rs b/src/model/partner_end_customer_o_auth_institution_environments.rs index 6358e0bb..d68eeff3 100644 --- a/src/model/partner_end_customer_o_auth_institution_environments.rs +++ b/src/model/partner_end_customer_o_auth_institution_environments.rs @@ -1,16 +1,17 @@ use serde::{Serialize, Deserialize}; +use super::PartnerEndCustomerOAuthInstitutionApplicationStatus; ///Registration statuses by environment. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PartnerEndCustomerOAuthInstitutionEnvironments { ///The registration status for the end customer's application. #[serde(default, skip_serializing_if = "Option::is_none")] - pub development: Option, + pub development: Option, ///The registration status for the end customer's application. #[serde(default, skip_serializing_if = "Option::is_none")] - pub production: Option, + pub production: Option, } impl std::fmt::Display for PartnerEndCustomerOAuthInstitutionEnvironments { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer_o_auth_status_updated_values.rs b/src/model/partner_end_customer_o_auth_status_updated_values.rs new file mode 100644 index 00000000..7de0d28f --- /dev/null +++ b/src/model/partner_end_customer_o_auth_status_updated_values.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///The OAuth status of the update +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PartnerEndCustomerOAuthStatusUpdatedValues { + #[serde(rename = "not-started")] + NotStarted, + #[serde(rename = "processing")] + Processing, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "enabled")] + Enabled, + #[serde(rename = "attention-required")] + AttentionRequired, +} diff --git a/src/model/partner_end_customer_o_auth_status_updated_webhook.rs b/src/model/partner_end_customer_o_auth_status_updated_webhook.rs index b46ebb60..0df9f3c4 100644 --- a/src/model/partner_end_customer_o_auth_status_updated_webhook.rs +++ b/src/model/partner_end_customer_o_auth_status_updated_webhook.rs @@ -1,17 +1,18 @@ use serde::{Serialize, Deserialize}; +use super::{PartnerEndCustomerOAuthStatusUpdatedValues, WebhookEnvironmentValues}; ///The webhook of type `PARTNER` and code `END_CUSTOMER_OAUTH_STATUS_UPDATED` will be fired when a partner's end customer has an update on their OAuth registration status with an institution. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PartnerEndCustomerOAuthStatusUpdatedWebhook { ///The client ID of the end customer pub end_customer_client_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The institution ID pub institution_id: String, ///The institution name pub institution_name: String, ///The OAuth status of the update - pub status: String, + pub status: PartnerEndCustomerOAuthStatusUpdatedValues, ///`END_CUSTOMER_OAUTH_STATUS_UPDATED` pub webhook_code: String, ///`PARTNER` @@ -21,4 +22,4 @@ impl std::fmt::Display for PartnerEndCustomerOAuthStatusUpdatedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer_questionnaire_status.rs b/src/model/partner_end_customer_questionnaire_status.rs new file mode 100644 index 00000000..2f36944b --- /dev/null +++ b/src/model/partner_end_customer_questionnaire_status.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///The status of the end customer's security questionnaire. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PartnerEndCustomerQuestionnaireStatus { + #[serde(rename = "NOT_STARTED")] + NotStarted, + #[serde(rename = "RECEIVED")] + Received, + #[serde(rename = "COMPLETE")] + Complete, +} diff --git a/src/model/partner_end_customer_status.rs b/src/model/partner_end_customer_status.rs new file mode 100644 index 00000000..67540d4d --- /dev/null +++ b/src/model/partner_end_customer_status.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +/**The status of the given end customer. + +`UNDER_REVIEW`: The end customer has been created and enabled in Sandbox and Limited Production. The end customer must be manually reviewed by the Plaid team before it can be enabled in full production, at which point its status will automatically transition to `PENDING_ENABLEMENT` or `DENIED`. + +`PENDING_ENABLEMENT`: The end customer is ready to be fully enabled in the Production environment. Call the `/partner/customer/enable` endpoint to enable the end customer in full Production. + +`ACTIVE`: The end customer has been fully enabled in all environments. + +`DENIED`: The end customer has been created and enabled in Sandbox and Limited Production, but it did not pass review by the Plaid team and therefore cannot be enabled for full Production access. Talk to your Account Manager for more information.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PartnerEndCustomerStatus { + #[serde(rename = "UNDER_REVIEW")] + UnderReview, + #[serde(rename = "PENDING_ENABLEMENT")] + PendingEnablement, + #[serde(rename = "ACTIVE")] + Active, + #[serde(rename = "DENIED")] + Denied, +} diff --git a/src/model/partner_end_customer_technical_contact.rs b/src/model/partner_end_customer_technical_contact.rs index f1da2939..d7028f3f 100644 --- a/src/model/partner_end_customer_technical_contact.rs +++ b/src/model/partner_end_customer_technical_contact.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PartnerEndCustomerTechnicalContact { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/partner_end_customer_with_secrets.rs b/src/model/partner_end_customer_with_secrets.rs index 4ad5db4a..cc98857d 100644 --- a/src/model/partner_end_customer_with_secrets.rs +++ b/src/model/partner_end_customer_with_secrets.rs @@ -1,9 +1,2 @@ use serde::{Serialize, Deserialize}; -///The details for the newly created end customer, including secrets for non-Production environments. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct PartnerEndCustomerWithSecrets {} -impl std::fmt::Display for PartnerEndCustomerWithSecrets { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type PartnerEndCustomerWithSecrets = serde_json::Value; diff --git a/src/model/party.rs b/src/model/party.rs index 30ae125d..ca4ab1a3 100644 --- a/src/model/party.rs +++ b/src/model/party.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{PartyIndividual, Roles, TaxpayerIdentifiers}; ///A collection of information about a single party to a transaction. Included direct participants like the borrower and seller as well as indirect participants such as the flood certificate provider. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Party { ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. #[serde(rename = "INDIVIDUAL")] @@ -17,4 +17,4 @@ impl std::fmt::Display for Party { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/party_individual.rs b/src/model/party_individual.rs index c9044b4f..edc12347 100644 --- a/src/model/party_individual.rs +++ b/src/model/party_individual.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for PartyIndividual { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/party_role_type.rs b/src/model/party_role_type.rs new file mode 100644 index 00000000..b165e8b7 --- /dev/null +++ b/src/model/party_role_type.rs @@ -0,0 +1,6 @@ +use serde::{Serialize, Deserialize}; +///A value from a MISMO defined list that identifies the role that the party plays in the transaction. Parties may be either a person or legal entity. A party may play multiple roles in a transaction.A value from a MISMO defined list that identifies the role that the party plays in the transaction. Parties may be either a person or legal entity. A party may play multiple roles in a transaction. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PartyRoleType { + Borrower, +} diff --git a/src/model/pay.rs b/src/model/pay.rs index 7082fbfc..7bbe2519 100644 --- a/src/model/pay.rs +++ b/src/model/pay.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for Pay { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/pay_frequency_value.rs b/src/model/pay_frequency_value.rs index a7a0b962..5905908e 100644 --- a/src/model/pay_frequency_value.rs +++ b/src/model/pay_frequency_value.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct PayFrequencyValue(pub serde_json::Value); \ No newline at end of file +pub struct PayFrequencyValue(pub serde_json::Value); diff --git a/src/model/pay_period_details.rs b/src/model/pay_period_details.rs index 5983f53b..ab289ce4 100644 --- a/src/model/pay_period_details.rs +++ b/src/model/pay_period_details.rs @@ -31,4 +31,4 @@ impl std::fmt::Display for PayPeriodDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/pay_period_details_pay_frequency.rs b/src/model/pay_period_details_pay_frequency.rs index a3ff0fcc..fc0af41d 100644 --- a/src/model/pay_period_details_pay_frequency.rs +++ b/src/model/pay_period_details_pay_frequency.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct PayPeriodDetailsPayFrequency(pub serde_json::Value); \ No newline at end of file +pub struct PayPeriodDetailsPayFrequency(pub serde_json::Value); diff --git a/src/model/pay_stub_deductions_breakdown.rs b/src/model/pay_stub_deductions_breakdown.rs index 22f0aedf..11b01cb5 100644 --- a/src/model/pay_stub_deductions_breakdown.rs +++ b/src/model/pay_stub_deductions_breakdown.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for PayStubDeductionsBreakdown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/pay_stub_deductions_total.rs b/src/model/pay_stub_deductions_total.rs index ef9eb929..4e485002 100644 --- a/src/model/pay_stub_deductions_total.rs +++ b/src/model/pay_stub_deductions_total.rs @@ -21,4 +21,4 @@ impl std::fmt::Display for PayStubDeductionsTotal { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/pay_stub_distribution_breakdown.rs b/src/model/pay_stub_distribution_breakdown.rs index 192a05a4..be4427e0 100644 --- a/src/model/pay_stub_distribution_breakdown.rs +++ b/src/model/pay_stub_distribution_breakdown.rs @@ -31,4 +31,4 @@ impl std::fmt::Display for PayStubDistributionBreakdown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/pay_stub_earnings_breakdown.rs b/src/model/pay_stub_earnings_breakdown.rs index b1ead132..30c90828 100644 --- a/src/model/pay_stub_earnings_breakdown.rs +++ b/src/model/pay_stub_earnings_breakdown.rs @@ -33,4 +33,4 @@ impl std::fmt::Display for PayStubEarningsBreakdown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/pay_stub_earnings_total.rs b/src/model/pay_stub_earnings_total.rs index 71f9265d..17a2eb56 100644 --- a/src/model/pay_stub_earnings_total.rs +++ b/src/model/pay_stub_earnings_total.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for PayStubEarningsTotal { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/pay_stub_pay_period_details.rs b/src/model/pay_stub_pay_period_details.rs index 394c622c..b75699a0 100644 --- a/src/model/pay_stub_pay_period_details.rs +++ b/src/model/pay_stub_pay_period_details.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::PayStubDistributionBreakdown; +use super::{CreditPayStubPayBasisType, PayStubDistributionBreakdown}; ///Details about the pay period. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PayStubPayPeriodDetails { #[serde(default, skip_serializing_if = "Vec::is_empty")] pub distribution_breakdown: Vec, @@ -19,7 +19,7 @@ pub struct PayStubPayPeriodDetails { pub pay_amount: Option, ///The explicit pay basis on the paystub (if present). #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_basis: Option, + pub pay_basis: Option, ///The date on which the pay stub was issued, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ("yyyy-mm-dd"). #[serde(default, skip_serializing_if = "Option::is_none")] pub pay_date: Option, @@ -39,4 +39,4 @@ impl std::fmt::Display for PayStubPayPeriodDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/pay_stub_taxpayer_id.rs b/src/model/pay_stub_taxpayer_id.rs index 720240a8..288edc6a 100644 --- a/src/model/pay_stub_taxpayer_id.rs +++ b/src/model/pay_stub_taxpayer_id.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PayStubTaxpayerId { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_amount.rs b/src/model/payment_amount.rs index ec510043..88f303de 100644 --- a/src/model/payment_amount.rs +++ b/src/model/payment_amount.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::PaymentAmountCurrency; ///The amount and currency of a payment -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentAmount { ///The ISO-4217 currency code of the payment. For standing orders and payment consents, `"GBP"` must be used. For Poland, Denmark, Sweden and Norway, only the local currency is currently supported. - pub currency: String, + pub currency: PaymentAmountCurrency, ///The amount of the payment. Must contain at most two digits of precision e.g. `1.23`. Minimum accepted value is `1`. pub value: f64, } @@ -11,4 +12,4 @@ impl std::fmt::Display for PaymentAmount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_amount_currency.rs b/src/model/payment_amount_currency.rs new file mode 100644 index 00000000..1eab4ae0 --- /dev/null +++ b/src/model/payment_amount_currency.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +///The ISO-4217 currency code of the payment. For standing orders and payment consents, `"GBP"` must be used. For Poland, Denmark, Sweden and Norway, only the local currency is currently supported. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentAmountCurrency { + #[serde(rename = "GBP")] + Gbp, + #[serde(rename = "EUR")] + Eur, + #[serde(rename = "PLN")] + Pln, + #[serde(rename = "SEK")] + Sek, + #[serde(rename = "DKK")] + Dkk, + #[serde(rename = "NOK")] + Nok, +} diff --git a/src/model/payment_amount_nullable.rs b/src/model/payment_amount_nullable.rs index 1b786a83..746f7a62 100644 --- a/src/model/payment_amount_nullable.rs +++ b/src/model/payment_amount_nullable.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::PaymentAmountCurrency; ///The amount and currency of a payment -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentAmountNullable { ///The ISO-4217 currency code of the payment. For standing orders and payment consents, `"GBP"` must be used. For Poland, Denmark, Sweden and Norway, only the local currency is currently supported. - pub currency: String, + pub currency: PaymentAmountCurrency, ///The amount of the payment. Must contain at most two digits of precision e.g. `1.23`. pub value: f64, } @@ -11,4 +12,4 @@ impl std::fmt::Display for PaymentAmountNullable { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_amount_refunded.rs b/src/model/payment_amount_refunded.rs index d73f783f..bc1a0fbd 100644 --- a/src/model/payment_amount_refunded.rs +++ b/src/model/payment_amount_refunded.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; use super::PaymentAmountNullable; -pub type PaymentAmountRefunded = PaymentAmountNullable; \ No newline at end of file +pub type PaymentAmountRefunded = PaymentAmountNullable; diff --git a/src/model/payment_amount_to_refund.rs b/src/model/payment_amount_to_refund.rs index 95b198ed..acc3c488 100644 --- a/src/model/payment_amount_to_refund.rs +++ b/src/model/payment_amount_to_refund.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; use super::PaymentAmountNullable; -pub type PaymentAmountToRefund = PaymentAmountNullable; \ No newline at end of file +pub type PaymentAmountToRefund = PaymentAmountNullable; diff --git a/src/model/payment_channel.rs b/src/model/payment_channel.rs new file mode 100644 index 00000000..e24ecdc1 --- /dev/null +++ b/src/model/payment_channel.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +/**The channel used to make a payment. +`online:` transactions that took place online. + +`in store:` transactions that were made at a physical location. + +`other:` transactions that relate to banks, e.g. fees or deposits.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentChannel { + #[serde(rename = "online")] + Online, + #[serde(rename = "in store")] + InStore, + #[serde(rename = "other")] + Other, +} diff --git a/src/model/payment_consent_max_payment_amount.rs b/src/model/payment_consent_max_payment_amount.rs index 8f090beb..21b237eb 100644 --- a/src/model/payment_consent_max_payment_amount.rs +++ b/src/model/payment_consent_max_payment_amount.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; use super::PaymentAmount; -pub type PaymentConsentMaxPaymentAmount = PaymentAmount; \ No newline at end of file +pub type PaymentConsentMaxPaymentAmount = PaymentAmount; diff --git a/src/model/payment_consent_periodic_alignment.rs b/src/model/payment_consent_periodic_alignment.rs new file mode 100644 index 00000000..8c34b855 --- /dev/null +++ b/src/model/payment_consent_periodic_alignment.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +/**Where the payment consent period should start. + +If the institution is Monzo, only `CONSENT` alignments are supported. + +`CALENDAR`: line up with a calendar. + +`CONSENT`: on the date of consent creation.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentConsentPeriodicAlignment { + #[serde(rename = "CALENDAR")] + Calendar, + #[serde(rename = "CONSENT")] + Consent, +} diff --git a/src/model/payment_consent_periodic_amount.rs b/src/model/payment_consent_periodic_amount.rs index 0d347779..791c94f4 100644 --- a/src/model/payment_consent_periodic_amount.rs +++ b/src/model/payment_consent_periodic_amount.rs @@ -1,21 +1,26 @@ use serde::{Serialize, Deserialize}; -use super::PaymentConsentPeriodicAmountAmount; +use super::{ + PaymentConsentPeriodicAlignment, PaymentConsentPeriodicAmountAmount, + PaymentConsentPeriodicInterval, +}; ///Defines consent payments limitations per period. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentConsentPeriodicAmount { /**Where the payment consent period should start. +If the institution is Monzo, only `CONSENT` alignments are supported. + `CALENDAR`: line up with a calendar. `CONSENT`: on the date of consent creation.*/ - pub alignment: String, + pub alignment: PaymentConsentPeriodicAlignment, ///Maximum cumulative amount for all payments in the specified interval. pub amount: PaymentConsentPeriodicAmountAmount, ///Payment consent periodic interval. - pub interval: String, + pub interval: PaymentConsentPeriodicInterval, } impl std::fmt::Display for PaymentConsentPeriodicAmount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_consent_periodic_amount_amount.rs b/src/model/payment_consent_periodic_amount_amount.rs index 519bf3e4..25948adb 100644 --- a/src/model/payment_consent_periodic_amount_amount.rs +++ b/src/model/payment_consent_periodic_amount_amount.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; use super::PaymentAmount; -pub type PaymentConsentPeriodicAmountAmount = PaymentAmount; \ No newline at end of file +pub type PaymentConsentPeriodicAmountAmount = PaymentAmount; diff --git a/src/model/payment_consent_periodic_interval.rs b/src/model/payment_consent_periodic_interval.rs new file mode 100644 index 00000000..2d7349bb --- /dev/null +++ b/src/model/payment_consent_periodic_interval.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///Payment consent periodic interval. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentConsentPeriodicInterval { + #[serde(rename = "DAY")] + Day, + #[serde(rename = "WEEK")] + Week, + #[serde(rename = "MONTH")] + Month, + #[serde(rename = "YEAR")] + Year, +} diff --git a/src/model/payment_consent_valid_date_time.rs b/src/model/payment_consent_valid_date_time.rs index 3fc650c6..49ec341a 100644 --- a/src/model/payment_consent_valid_date_time.rs +++ b/src/model/payment_consent_valid_date_time.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PaymentConsentValidDateTime { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_address.rs b/src/model/payment_initiation_address.rs index 70956194..a3f099c0 100644 --- a/src/model/payment_initiation_address.rs +++ b/src/model/payment_initiation_address.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for PaymentInitiationAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_consent_constraints.rs b/src/model/payment_initiation_consent_constraints.rs index 5ef69e03..81b98686 100644 --- a/src/model/payment_initiation_consent_constraints.rs +++ b/src/model/payment_initiation_consent_constraints.rs @@ -4,7 +4,7 @@ use super::{ PaymentConsentValidDateTime, }; ///Limitations that will be applied to payments initiated using the payment consent. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentInitiationConsentConstraints { ///Maximum amount of a single payment initiated using the payment consent. pub max_payment_amount: PaymentConsentMaxPaymentAmount, @@ -19,4 +19,4 @@ impl std::fmt::Display for PaymentInitiationConsentConstraints { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_consent_create_response.rs b/src/model/payment_initiation_consent_create_response.rs index 8d182fa2..0c8a5467 100644 --- a/src/model/payment_initiation_consent_create_response.rs +++ b/src/model/payment_initiation_consent_create_response.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::PaymentInitiationConsentStatus; ///PaymentInitiationConsentCreateResponse defines the response schema for `/payment_initiation/consent/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentInitiationConsentCreateResponse { ///A unique ID identifying the payment consent. pub consent_id: String, @@ -17,10 +18,10 @@ pub struct PaymentInitiationConsentCreateResponse { `REVOKED`: Consent has been revoked and can no longer be used. `EXPIRED`: Consent is no longer valid.*/ - pub status: String, + pub status: PaymentInitiationConsentStatus, } impl std::fmt::Display for PaymentInitiationConsentCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_consent_get_response.rs b/src/model/payment_initiation_consent_get_response.rs index 40d8a014..9ee4bf7b 100644 --- a/src/model/payment_initiation_consent_get_response.rs +++ b/src/model/payment_initiation_consent_get_response.rs @@ -1,9 +1,2 @@ use serde::{Serialize, Deserialize}; -///PaymentInitiationConsentGetResponse defines the response schema for `/payment_initation/consent/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct PaymentInitiationConsentGetResponse {} -impl std::fmt::Display for PaymentInitiationConsentGetResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type PaymentInitiationConsentGetResponse = serde_json::Value; diff --git a/src/model/payment_initiation_consent_payer_details.rs b/src/model/payment_initiation_consent_payer_details.rs new file mode 100644 index 00000000..a342ef08 --- /dev/null +++ b/src/model/payment_initiation_consent_payer_details.rs @@ -0,0 +1,28 @@ +use serde::{Serialize, Deserialize}; +use super::{PaymentInitiationAddress, PaymentInitiationConsentPayerNumbers}; +/**An object representing the payment consent payer details. +Payer `name` and account `numbers` are required to lock the account to which the consent can be created.*/ +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaymentInitiationConsentPayerDetails { + ///The optional address of the payment recipient's bank account. Required by most institutions outside of the UK. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + ///The payer's birthdate, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub date_of_birth: Option, + ///The payer's emails + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emails: Option>, + ///The name of the payer as it appears in their bank account + pub name: String, + ///The counterparty's bank account numbers. Exactly one of IBAN or BACS data is required. + pub numbers: PaymentInitiationConsentPayerNumbers, + ///The payer's phone numbers in E.164 format: +{countrycode}{number} + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_numbers: Option>, +} +impl std::fmt::Display for PaymentInitiationConsentPayerDetails { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/payment_initiation_consent_payer_numbers.rs b/src/model/payment_initiation_consent_payer_numbers.rs new file mode 100644 index 00000000..3e7d1788 --- /dev/null +++ b/src/model/payment_initiation_consent_payer_numbers.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +use super::RecipientBacs; +///The counterparty's bank account numbers. Exactly one of IBAN or BACS data is required. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaymentInitiationConsentPayerNumbers { + ///An optional object used to restrict the accounts used for payments. If provided, the end user will be able to send payments only from the specified bank account. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bacs: Option, + ///International Bank Account Number (IBAN). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iban: Option, +} +impl std::fmt::Display for PaymentInitiationConsentPayerNumbers { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/payment_initiation_consent_payment_execute_response.rs b/src/model/payment_initiation_consent_payment_execute_response.rs index 59ffb6ea..4b652f39 100644 --- a/src/model/payment_initiation_consent_payment_execute_response.rs +++ b/src/model/payment_initiation_consent_payment_execute_response.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::PaymentInitiationPaymentStatus; ///PaymentInitiationConsentPaymentExecuteResponse defines the response schema for `/payment_initiation/consent/payment/execute` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentInitiationConsentPaymentExecuteResponse { ///A unique ID identifying the payment pub payment_id: String, @@ -38,10 +39,10 @@ These statuses will be removed in a future release. `PAYMENT_STATUS_PROCESSING`: The payment is currently being processed. The payment will automatically exit this state when processing is complete. `PAYMENT_STATUS_COMPLETED`: Indicates that the standing order has been successfully established. This state is only used for standing orders.*/ - pub status: String, + pub status: PaymentInitiationPaymentStatus, } impl std::fmt::Display for PaymentInitiationConsentPaymentExecuteResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_consent_processing_mode.rs b/src/model/payment_initiation_consent_processing_mode.rs new file mode 100644 index 00000000..41fbb6a7 --- /dev/null +++ b/src/model/payment_initiation_consent_processing_mode.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**Decides the mode under which the payment processing should be performed, using `IMMEDIATE` as default. + +`IMMEDIATE`: Will immediately execute the payment, waiting for a response from the ASPSP before returning the result of the payment initiation. This is ideal for user-present flows. + + `ASYNC`: Will accept a payment execution request and schedule it for processing, immediately returning the new `payment_id`. Listen for webhooks or use the [`/payment_initiation/payment/get`](https://plaid.com/docs/api/products/payment-initiation/#payment_initiationpaymentget) endpoint to obtain updates on the payment status. This is ideal for non user-present flows.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentInitiationConsentProcessingMode { + #[serde(rename = "ASYNC")] + Async, + #[serde(rename = "IMMEDIATE")] + Immediate, +} diff --git a/src/model/payment_initiation_consent_revoke_response.rs b/src/model/payment_initiation_consent_revoke_response.rs index e5b718a6..1603d373 100644 --- a/src/model/payment_initiation_consent_revoke_response.rs +++ b/src/model/payment_initiation_consent_revoke_response.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for PaymentInitiationConsentRevokeResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_consent_scope.rs b/src/model/payment_initiation_consent_scope.rs new file mode 100644 index 00000000..d78bbbee --- /dev/null +++ b/src/model/payment_initiation_consent_scope.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +/**This field is deprecated in favor of the consent `type` field. Consents are required to have a single type. + +Payment consent scope. Defines possible directions for payments made with the given consent. + +`ME_TO_ME`: Allows moving money between accounts owned by the same user. + +`EXTERNAL`: Allows initiating payments from the user's account to third parties.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentInitiationConsentScope { + #[serde(rename = "ME_TO_ME")] + MeToMe, + #[serde(rename = "EXTERNAL")] + External, +} diff --git a/src/model/payment_initiation_consent_status.rs b/src/model/payment_initiation_consent_status.rs new file mode 100644 index 00000000..5f270e9c --- /dev/null +++ b/src/model/payment_initiation_consent_status.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +/**The status of the payment consent. + +`UNAUTHORISED`: Consent created, but requires user authorisation. + +`REJECTED`: Consent authorisation was rejected by the user and/or the bank. + +`AUTHORISED`: Consent is active and ready to be used. + +`REVOKED`: Consent has been revoked and can no longer be used. + +`EXPIRED`: Consent is no longer valid.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentInitiationConsentStatus { + #[serde(rename = "UNAUTHORISED")] + Unauthorised, + #[serde(rename = "AUTHORISED")] + Authorised, + #[serde(rename = "REVOKED")] + Revoked, + #[serde(rename = "REJECTED")] + Rejected, + #[serde(rename = "EXPIRED")] + Expired, +} diff --git a/src/model/payment_initiation_consent_type.rs b/src/model/payment_initiation_consent_type.rs new file mode 100644 index 00000000..e687d304 --- /dev/null +++ b/src/model/payment_initiation_consent_type.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**Payment consent type. Defines possible use case for payments made with the given consent. + +`SWEEPING`: Allows moving money between accounts owned by the same user. + +`COMMERCIAL`: Allows initiating payments from the user's account to third parties.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentInitiationConsentType { + #[serde(rename = "SWEEPING")] + Sweeping, + #[serde(rename = "COMMERCIAL")] + Commercial, +} diff --git a/src/model/payment_initiation_maximum_payment_amount.rs b/src/model/payment_initiation_maximum_payment_amount.rs index 00474b0f..aebf2e7c 100644 --- a/src/model/payment_initiation_maximum_payment_amount.rs +++ b/src/model/payment_initiation_maximum_payment_amount.rs @@ -1,11 +1,2 @@ use serde::{Serialize, Deserialize}; -/**A mapping of currency to maximum payment amount (denominated in the smallest unit of currency) supported by the institution. - -Example: `{"GBP": "10000"}`*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct PaymentInitiationMaximumPaymentAmount {} -impl std::fmt::Display for PaymentInitiationMaximumPaymentAmount { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type PaymentInitiationMaximumPaymentAmount = String; diff --git a/src/model/payment_initiation_metadata.rs b/src/model/payment_initiation_metadata.rs index f827aa1b..b7b22ea6 100644 --- a/src/model/payment_initiation_metadata.rs +++ b/src/model/payment_initiation_metadata.rs @@ -14,6 +14,8 @@ Example: `{"GBP": "10000"}`*/ pub standing_order_metadata: Option, ///Indicates whether the institution supports payments from a different country. pub supports_international_payments: bool, + ///Indicates whether the institution supports payment consents. + pub supports_payment_consents: bool, ///Indicates whether the institution supports returning refund details when initiating a payment. pub supports_refund_details: bool, ///Indicates whether the institution supports SEPA Instant payments. @@ -23,4 +25,4 @@ impl std::fmt::Display for PaymentInitiationMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_payment.rs b/src/model/payment_initiation_payment.rs index f07f1d0a..607965d5 100644 --- a/src/model/payment_initiation_payment.rs +++ b/src/model/payment_initiation_payment.rs @@ -1,10 +1,10 @@ use serde::{Serialize, Deserialize}; use super::{ ExternalPaymentRefundDetails, ExternalPaymentScheduleBase, PaymentAmount, - PaymentAmountRefunded, PaymentScheme, RecipientBacs, + PaymentAmountRefunded, PaymentInitiationPaymentStatus, PaymentScheme, RecipientBacs, }; ///PaymentInitiationPayment defines a payment initiation payment -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentInitiationPayment { ///The value of the reference sent to the bank after adjustment to pass bank validation rules. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -94,7 +94,7 @@ These statuses will be removed in a future release. `PAYMENT_STATUS_PROCESSING`: The payment is currently being processed. The payment will automatically exit this state when processing is complete. `PAYMENT_STATUS_COMPLETED`: Indicates that the standing order has been successfully established. This state is only used for standing orders.*/ - pub status: String, + pub status: PaymentInitiationPaymentStatus, ///The transaction ID that this payment is associated with, if any. This is present only when a payment was initiated using virtual accounts. #[serde(default, skip_serializing_if = "Option::is_none")] pub transaction_id: Option, @@ -106,4 +106,4 @@ impl std::fmt::Display for PaymentInitiationPayment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_payment_create_response.rs b/src/model/payment_initiation_payment_create_response.rs index df871f59..5e287d7a 100644 --- a/src/model/payment_initiation_payment_create_response.rs +++ b/src/model/payment_initiation_payment_create_response.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::PaymentInitiationPaymentCreateStatus; ///PaymentInitiationPaymentCreateResponse defines the response schema for `/payment_initiation/payment/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentInitiationPaymentCreateResponse { ///A unique ID identifying the payment pub payment_id: String, @@ -9,10 +10,10 @@ pub struct PaymentInitiationPaymentCreateResponse { /**For a payment returned by this endpoint, there is only one possible value: `PAYMENT_STATUS_INPUT_NEEDED`: The initial phase of the payment*/ - pub status: String, + pub status: PaymentInitiationPaymentCreateStatus, } impl std::fmt::Display for PaymentInitiationPaymentCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_payment_create_status.rs b/src/model/payment_initiation_payment_create_status.rs new file mode 100644 index 00000000..8191c8d7 --- /dev/null +++ b/src/model/payment_initiation_payment_create_status.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +/**For a payment returned by this endpoint, there is only one possible value: + +`PAYMENT_STATUS_INPUT_NEEDED`: The initial phase of the payment*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentInitiationPaymentCreateStatus { + #[serde(rename = "PAYMENT_STATUS_INPUT_NEEDED")] + PaymentStatusInputNeeded, +} diff --git a/src/model/payment_initiation_payment_get_response.rs b/src/model/payment_initiation_payment_get_response.rs index 37faa046..7f22e2fb 100644 --- a/src/model/payment_initiation_payment_get_response.rs +++ b/src/model/payment_initiation_payment_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::PaymentInitiationPayment; ///PaymentInitiationPaymentGetResponse defines the response schema for `/payment_initation/payment/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentInitiationPaymentGetResponse { ///PaymentInitiationPayment defines a payment initiation payment #[serde(flatten)] @@ -25,4 +25,4 @@ impl std::ops::DerefMut for PaymentInitiationPaymentGetResponse { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.payment_initiation_payment } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_payment_list_response.rs b/src/model/payment_initiation_payment_list_response.rs index 5823dde2..2baab3a3 100644 --- a/src/model/payment_initiation_payment_list_response.rs +++ b/src/model/payment_initiation_payment_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for PaymentInitiationPaymentListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_payment_reverse_response.rs b/src/model/payment_initiation_payment_reverse_response.rs index 64b8f0f1..8bc56ba5 100644 --- a/src/model/payment_initiation_payment_reverse_response.rs +++ b/src/model/payment_initiation_payment_reverse_response.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::WalletTransactionStatus; ///PaymentInitiationPaymentReverseResponse defines the response schema for `/payment_initation/payment/reverse` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentInitiationPaymentReverseResponse { ///A unique ID identifying the refund pub refund_id: String, @@ -19,10 +20,10 @@ pub struct PaymentInitiationPaymentReverseResponse { `FAILED`: The transaction failed to process successfully. This is a terminal status. `BLOCKED`: The transaction has been blocked for violating compliance rules. This is a terminal status.*/ - pub status: String, + pub status: WalletTransactionStatus, } impl std::fmt::Display for PaymentInitiationPaymentReverseResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_payment_status.rs b/src/model/payment_initiation_payment_status.rs new file mode 100644 index 00000000..0039d61b --- /dev/null +++ b/src/model/payment_initiation_payment_status.rs @@ -0,0 +1,64 @@ +use serde::{Serialize, Deserialize}; +/**The status of the payment. + +`PAYMENT_STATUS_INPUT_NEEDED`: This is the initial state of all payments. It indicates that the payment is waiting on user input to continue processing. A payment may re-enter this state later on if further input is needed. + +`PAYMENT_STATUS_INITIATED`: The payment has been successfully authorised and accepted by the financial institution. For successful payments, this is a potential terminal status. Further status transitions can be to REJECTED and, when supported by the institution, to EXECUTED. + +`PAYMENT_STATUS_INSUFFICIENT_FUNDS`: The payment has failed due to insufficient funds. + +`PAYMENT_STATUS_FAILED`: The payment has failed to be initiated. This error may be caused by transient system outages and is retryable once the root cause is resolved. + +`PAYMENT_STATUS_BLOCKED`: The payment has been blocked by Plaid. This can occur, for example, due to Plaid flagging the payment as potentially risky. This is a retryable error. + +`PAYMENT_STATUS_AUTHORISING`: The payment is currently being processed. The payment will automatically exit this state when the financial institution has authorised the transaction. + +`PAYMENT_STATUS_CANCELLED`: The payment was cancelled (typically by the end user) during authorisation. + +`PAYMENT_STATUS_EXECUTED`: The funds have successfully left the payer account and payment is considered complete. Not all institutions support this status: support is more common in the UK, and less common in the EU. For institutions where this status is not supported, the terminal status for a successful payment will be `PAYMENT_STATUS_INITIATED`. + +`PAYMENT_STATUS_SETTLED`: The payment has settled and funds are available for use. A payment will typically settle within seconds to several days, depending on which payment rail is used. This status is only available to customers using [Plaid Virtual Accounts](https://plaid.com/docs/virtual-accounts/). + +`PAYMENT_STATUS_ESTABLISHED`: Indicates that the standing order has been successfully established. This state is only used for standing orders. + +`PAYMENT_STATUS_REJECTED`: The payment was rejected by the financial institution. + +Deprecated: +These statuses will be removed in a future release. + +`PAYMENT_STATUS_UNKNOWN`: The payment status is unknown. + +`PAYMENT_STATUS_PROCESSING`: The payment is currently being processed. The payment will automatically exit this state when processing is complete. + +`PAYMENT_STATUS_COMPLETED`: Indicates that the standing order has been successfully established. This state is only used for standing orders.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentInitiationPaymentStatus { + #[serde(rename = "PAYMENT_STATUS_INPUT_NEEDED")] + PaymentStatusInputNeeded, + #[serde(rename = "PAYMENT_STATUS_PROCESSING")] + PaymentStatusProcessing, + #[serde(rename = "PAYMENT_STATUS_INITIATED")] + PaymentStatusInitiated, + #[serde(rename = "PAYMENT_STATUS_COMPLETED")] + PaymentStatusCompleted, + #[serde(rename = "PAYMENT_STATUS_INSUFFICIENT_FUNDS")] + PaymentStatusInsufficientFunds, + #[serde(rename = "PAYMENT_STATUS_FAILED")] + PaymentStatusFailed, + #[serde(rename = "PAYMENT_STATUS_BLOCKED")] + PaymentStatusBlocked, + #[serde(rename = "PAYMENT_STATUS_UNKNOWN")] + PaymentStatusUnknown, + #[serde(rename = "PAYMENT_STATUS_EXECUTED")] + PaymentStatusExecuted, + #[serde(rename = "PAYMENT_STATUS_SETTLED")] + PaymentStatusSettled, + #[serde(rename = "PAYMENT_STATUS_AUTHORISING")] + PaymentStatusAuthorising, + #[serde(rename = "PAYMENT_STATUS_CANCELLED")] + PaymentStatusCancelled, + #[serde(rename = "PAYMENT_STATUS_ESTABLISHED")] + PaymentStatusEstablished, + #[serde(rename = "PAYMENT_STATUS_REJECTED")] + PaymentStatusRejected, +} diff --git a/src/model/payment_initiation_payment_token_create_response.rs b/src/model/payment_initiation_payment_token_create_response.rs index e817e11b..a511f567 100644 --- a/src/model/payment_initiation_payment_token_create_response.rs +++ b/src/model/payment_initiation_payment_token_create_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PaymentInitiationPaymentTokenCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_recipient.rs b/src/model/payment_initiation_recipient.rs index ca26c292..f7613ebf 100644 --- a/src/model/payment_initiation_recipient.rs +++ b/src/model/payment_initiation_recipient.rs @@ -21,4 +21,4 @@ impl std::fmt::Display for PaymentInitiationRecipient { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_recipient_create_response.rs b/src/model/payment_initiation_recipient_create_response.rs index 500bfa70..bc10a6e9 100644 --- a/src/model/payment_initiation_recipient_create_response.rs +++ b/src/model/payment_initiation_recipient_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for PaymentInitiationRecipientCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_recipient_get_response.rs b/src/model/payment_initiation_recipient_get_response.rs index 0f1b9a6d..1cd52cca 100644 --- a/src/model/payment_initiation_recipient_get_response.rs +++ b/src/model/payment_initiation_recipient_get_response.rs @@ -25,4 +25,4 @@ impl std::ops::DerefMut for PaymentInitiationRecipientGetResponse { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.payment_initiation_recipient } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_recipient_list_response.rs b/src/model/payment_initiation_recipient_list_response.rs index 7125798d..019f04e9 100644 --- a/src/model/payment_initiation_recipient_list_response.rs +++ b/src/model/payment_initiation_recipient_list_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PaymentInitiationRecipientListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_initiation_standing_order_metadata.rs b/src/model/payment_initiation_standing_order_metadata.rs index 68cc6d57..aa6d424a 100644 --- a/src/model/payment_initiation_standing_order_metadata.rs +++ b/src/model/payment_initiation_standing_order_metadata.rs @@ -1,4 +1,5 @@ use serde::{Serialize, Deserialize}; +use super::PaymentScheduleInterval; ///Metadata specifically related to valid Payment Initiation standing order configurations for the institution. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PaymentInitiationStandingOrderMetadata { @@ -8,10 +9,10 @@ pub struct PaymentInitiationStandingOrderMetadata { pub supports_standing_order_negative_execution_days: bool, ///A list of the valid standing order intervals supported by the institution. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub valid_standing_order_intervals: Vec, + pub valid_standing_order_intervals: Vec, } impl std::fmt::Display for PaymentInitiationStandingOrderMetadata { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_meta.rs b/src/model/payment_meta.rs index ea08e5d5..110912c4 100644 --- a/src/model/payment_meta.rs +++ b/src/model/payment_meta.rs @@ -33,4 +33,4 @@ impl std::fmt::Display for PaymentMeta { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_profile_create_response.rs b/src/model/payment_profile_create_response.rs index 24b42a14..35bbd556 100644 --- a/src/model/payment_profile_create_response.rs +++ b/src/model/payment_profile_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for PaymentProfileCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_profile_get_response.rs b/src/model/payment_profile_get_response.rs index 6b2b44a5..d99d3b18 100644 --- a/src/model/payment_profile_get_response.rs +++ b/src/model/payment_profile_get_response.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::PaymentProfileStatus; ///PaymentProfileGetResponse defines the response schema for `/payment_profile/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentProfileGetResponse { ///Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the time the given Payment Profile was created at pub created_at: chrono::DateTime, @@ -16,7 +17,7 @@ pub struct PaymentProfileGetResponse { `PENDING`: This Payment Profile is not ready to be used. You’ll need to call `/link/token/create` and provide the `payment_profile_token` in the `transfer.payment_profile_token` field to initiate the account linking experience. `REMOVED`: This Payment Profile has been removed.*/ - pub status: String, + pub status: PaymentProfileStatus, ///Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the last time the given Payment Profile was updated at pub updated_at: chrono::DateTime, } @@ -24,4 +25,4 @@ impl std::fmt::Display for PaymentProfileGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_profile_remove_response.rs b/src/model/payment_profile_remove_response.rs index 0bbbfaec..4c517f5b 100644 --- a/src/model/payment_profile_remove_response.rs +++ b/src/model/payment_profile_remove_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for PaymentProfileRemoveResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payment_profile_status.rs b/src/model/payment_profile_status.rs new file mode 100644 index 00000000..0f5af79c --- /dev/null +++ b/src/model/payment_profile_status.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**The status of the given Payment Profile. + +`READY`: This Payment Profile is ready to be used to create transfers using `/transfer/authorization/create` and `/transfer/create`. + +`PENDING`: This Payment Profile is not ready to be used. You’ll need to call `/link/token/create` and provide the `payment_profile_token` in the `transfer.payment_profile_token` field to initiate the account linking experience. + +`REMOVED`: This Payment Profile has been removed.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentProfileStatus { + #[serde(rename = "PENDING")] + Pending, + #[serde(rename = "READY")] + Ready, + #[serde(rename = "REMOVED")] + Removed, +} diff --git a/src/model/payment_schedule_interval.rs b/src/model/payment_schedule_interval.rs new file mode 100644 index 00000000..a08ee80d --- /dev/null +++ b/src/model/payment_schedule_interval.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The frequency interval of the payment. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PaymentScheduleInterval { + #[serde(rename = "WEEKLY")] + Weekly, + #[serde(rename = "MONTHLY")] + Monthly, +} diff --git a/src/model/payment_scheme.rs b/src/model/payment_scheme.rs index 9e287cdf..2d2bf94b 100644 --- a/src/model/payment_scheme.rs +++ b/src/model/payment_scheme.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct PaymentScheme(pub serde_json::Value); \ No newline at end of file +pub struct PaymentScheme(pub serde_json::Value); diff --git a/src/model/payment_status_update_webhook.rs b/src/model/payment_status_update_webhook.rs index 4f4562aa..86ebbdad 100644 --- a/src/model/payment_status_update_webhook.rs +++ b/src/model/payment_status_update_webhook.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PaymentInitiationPaymentStatus, PlaidError, WebhookEnvironmentValues}; ///Fired when the status of a payment has changed. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentStatusUpdateWebhook { ///The value of the reference sent to the bank after adjustment to pass bank validation rules. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -10,8 +10,8 @@ pub struct PaymentStatusUpdateWebhook { #[serde(default, skip_serializing_if = "Option::is_none")] pub adjusted_start_date: Option, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, /**The status of the payment. @@ -46,7 +46,7 @@ These statuses will be removed in a future release. `PAYMENT_STATUS_PROCESSING`: The payment is currently being processed. The payment will automatically exit this state when processing is complete. `PAYMENT_STATUS_COMPLETED`: Indicates that the standing order has been successfully established. This state is only used for standing orders.*/ - pub new_payment_status: String, + pub new_payment_status: PaymentInitiationPaymentStatus, /**The status of the payment. `PAYMENT_STATUS_INPUT_NEEDED`: This is the initial state of all payments. It indicates that the payment is waiting on user input to continue processing. A payment may re-enter this state later on if further input is needed. @@ -79,7 +79,7 @@ These statuses will be removed in a future release. `PAYMENT_STATUS_PROCESSING`: The payment is currently being processed. The payment will automatically exit this state when processing is complete. `PAYMENT_STATUS_COMPLETED`: Indicates that the standing order has been successfully established. This state is only used for standing orders.*/ - pub old_payment_status: String, + pub old_payment_status: PaymentInitiationPaymentStatus, ///The original value of the reference when creating the payment. #[serde(default, skip_serializing_if = "Option::is_none")] pub original_reference: Option, @@ -102,4 +102,4 @@ impl std::fmt::Display for PaymentStatusUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payroll_income_account_data.rs b/src/model/payroll_income_account_data.rs index 65f5f542..ef10be3c 100644 --- a/src/model/payroll_income_account_data.rs +++ b/src/model/payroll_income_account_data.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for PayrollIncomeAccountData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payroll_income_object.rs b/src/model/payroll_income_object.rs index aa3d7c2c..df60c471 100644 --- a/src/model/payroll_income_object.rs +++ b/src/model/payroll_income_object.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for PayrollIncomeObject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payroll_income_rate_of_pay.rs b/src/model/payroll_income_rate_of_pay.rs index 5ba4e75f..36c1aa79 100644 --- a/src/model/payroll_income_rate_of_pay.rs +++ b/src/model/payroll_income_rate_of_pay.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PayrollIncomeRateOfPay { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payroll_item.rs b/src/model/payroll_item.rs index 28627b55..5d2f921a 100644 --- a/src/model/payroll_item.rs +++ b/src/model/payroll_item.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for PayrollItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payroll_item_status.rs b/src/model/payroll_item_status.rs index 33065164..20183185 100644 --- a/src/model/payroll_item_status.rs +++ b/src/model/payroll_item_status.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for PayrollItemStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/payroll_risk_signals_item.rs b/src/model/payroll_risk_signals_item.rs index 565b8362..227779cd 100644 --- a/src/model/payroll_risk_signals_item.rs +++ b/src/model/payroll_risk_signals_item.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PayrollRiskSignalsItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub.rs b/src/model/paystub.rs index 31e1e8f6..71899ad7 100644 --- a/src/model/paystub.rs +++ b/src/model/paystub.rs @@ -36,4 +36,4 @@ impl std::fmt::Display for Paystub { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_address.rs b/src/model/paystub_address.rs index 110b0d15..213dbed4 100644 --- a/src/model/paystub_address.rs +++ b/src/model/paystub_address.rs @@ -33,4 +33,4 @@ impl std::fmt::Display for PaystubAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_details.rs b/src/model/paystub_details.rs index 9ca36c4b..291bf024 100644 --- a/src/model/paystub_details.rs +++ b/src/model/paystub_details.rs @@ -23,4 +23,4 @@ impl std::fmt::Display for PaystubDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_employer.rs b/src/model/paystub_employer.rs index 95bb5a01..63fc36c1 100644 --- a/src/model/paystub_employer.rs +++ b/src/model/paystub_employer.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for PaystubEmployer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_override.rs b/src/model/paystub_override.rs index f3760b8a..8d9814f6 100644 --- a/src/model/paystub_override.rs +++ b/src/model/paystub_override.rs @@ -1,11 +1,18 @@ use serde::{Serialize, Deserialize}; use super::{ - IncomeBreakdown, PaystubOverrideEmployee, PaystubOverrideEmployer, + IncomeBreakdown, PaystubOverrideDeductions, PaystubOverrideEarnings, + PaystubOverrideEmployee, PaystubOverrideEmployer, PaystubOverrideNetPay, PaystubOverridePayPeriodDetails, }; ///An object representing data from a paystub. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PaystubOverride { + ///An object with the deduction information found on a paystub. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub deductions: Option, + ///An object representing both a breakdown of earnings on a paystub and the total earnings. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub earnings: Option, ///The employee on the paystub. #[serde(default, skip_serializing_if = "Option::is_none")] pub employee: Option, @@ -14,6 +21,9 @@ pub struct PaystubOverride { pub employer: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub income_breakdown: Option>, + ///An object representing information about the net pay amount on the paystub. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub net_pay: Option, ///Details about the pay period. #[serde(default, skip_serializing_if = "Option::is_none")] pub pay_period_details: Option, @@ -22,4 +32,4 @@ impl std::fmt::Display for PaystubOverride { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_override_deductions.rs b/src/model/paystub_override_deductions.rs new file mode 100644 index 00000000..c83590e0 --- /dev/null +++ b/src/model/paystub_override_deductions.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::{PaystubOverrideDeductionsBreakdown, PaystubOverrideDeductionsTotal}; +///An object with the deduction information found on a paystub. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaystubOverrideDeductions { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub breakdown: Option>, + ///An object representing the total deductions for the pay period + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total: Option, +} +impl std::fmt::Display for PaystubOverrideDeductions { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/paystub_override_deductions_breakdown.rs b/src/model/paystub_override_deductions_breakdown.rs new file mode 100644 index 00000000..bff00cdb --- /dev/null +++ b/src/model/paystub_override_deductions_breakdown.rs @@ -0,0 +1,22 @@ +use serde::{Serialize, Deserialize}; +///An object representing the deduction line items for the pay period +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaystubOverrideDeductionsBreakdown { + ///The ISO-4217 currency code of the line item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency: Option, + ///Raw amount of the deduction + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current_amount: Option, + ///Description of the deduction line item + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + ///The year-to-date amount of the deduction + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ytd_amount: Option, +} +impl std::fmt::Display for PaystubOverrideDeductionsBreakdown { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/paystub_override_deductions_total.rs b/src/model/paystub_override_deductions_total.rs new file mode 100644 index 00000000..22049f97 --- /dev/null +++ b/src/model/paystub_override_deductions_total.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///An object representing the total deductions for the pay period +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaystubOverrideDeductionsTotal { + ///The ISO-4217 currency code of the line item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency: Option, + ///Raw amount of the deduction + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current_amount: Option, + ///The year-to-date total amount of the deductions + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ytd_amount: Option, +} +impl std::fmt::Display for PaystubOverrideDeductionsTotal { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/paystub_override_distribution_breakdown.rs b/src/model/paystub_override_distribution_breakdown.rs index e3003fe9..6c119cad 100644 --- a/src/model/paystub_override_distribution_breakdown.rs +++ b/src/model/paystub_override_distribution_breakdown.rs @@ -26,4 +26,4 @@ impl std::fmt::Display for PaystubOverrideDistributionBreakdown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_override_earnings.rs b/src/model/paystub_override_earnings.rs new file mode 100644 index 00000000..073a647c --- /dev/null +++ b/src/model/paystub_override_earnings.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::{PaystubOverrideEarningsBreakdown, PaystubOverrideEarningsTotal}; +///An object representing both a breakdown of earnings on a paystub and the total earnings. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaystubOverrideEarnings { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub breakdown: Option>, + ///An object representing both the current pay period and year to date amount for an earning category. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total: Option, +} +impl std::fmt::Display for PaystubOverrideEarnings { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/paystub_override_earnings_breakdown.rs b/src/model/paystub_override_earnings_breakdown.rs new file mode 100644 index 00000000..6c0c927c --- /dev/null +++ b/src/model/paystub_override_earnings_breakdown.rs @@ -0,0 +1,32 @@ +use serde::{Serialize, Deserialize}; +use super::EarningsBreakdownCanonicalDescription; +///An object representing the earnings line items for the pay period. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaystubOverrideEarningsBreakdown { + ///Commonly used term to describe the earning line item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub canonical_description: Option, + ///The ISO-4217 currency code of the line item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency: Option, + ///Raw amount of the earning line item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub current_amount: Option, + ///Description of the earning line item. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + ///Number of hours applicable for this earning. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hours: Option, + ///Hourly rate applicable for this earning. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rate: Option, + ///The year-to-date amount of the deduction. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ytd_amount: Option, +} +impl std::fmt::Display for PaystubOverrideEarningsBreakdown { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/paystub_override_earnings_total.rs b/src/model/paystub_override_earnings_total.rs new file mode 100644 index 00000000..715ea19c --- /dev/null +++ b/src/model/paystub_override_earnings_total.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///An object representing both the current pay period and year to date amount for an earning category. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaystubOverrideEarningsTotal { + ///The ISO-4217 currency code of the line item + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency: Option, + ///Total number of hours worked for this pay period + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hours: Option, + ///The year-to-date amount for the total earnings + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ytd_amount: Option, +} +impl std::fmt::Display for PaystubOverrideEarningsTotal { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/paystub_override_employee.rs b/src/model/paystub_override_employee.rs index 52a62e5c..101a8858 100644 --- a/src/model/paystub_override_employee.rs +++ b/src/model/paystub_override_employee.rs @@ -1,17 +1,23 @@ use serde::{Serialize, Deserialize}; -use super::PaystubOverrideEmployeeAddress; +use super::{PaystubOverrideEmployeeAddress, PaystubOverrideTaxpayerId}; ///The employee on the paystub. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PaystubOverrideEmployee { ///The address of the employee. #[serde(default, skip_serializing_if = "Option::is_none")] pub address: Option, + ///Marital status of the employee - either `single` or `married`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub marital_status: Option, ///The name of the employee. #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, + ///Taxpayer ID of the individual receiving the paystub. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub taxpayer_id: Option, } impl std::fmt::Display for PaystubOverrideEmployee { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_override_employee_address.rs b/src/model/paystub_override_employee_address.rs index f6c0f057..13c39e76 100644 --- a/src/model/paystub_override_employee_address.rs +++ b/src/model/paystub_override_employee_address.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for PaystubOverrideEmployeeAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_override_employer.rs b/src/model/paystub_override_employer.rs index fc34a6c4..aa4d68c3 100644 --- a/src/model/paystub_override_employer.rs +++ b/src/model/paystub_override_employer.rs @@ -1,7 +1,11 @@ use serde::{Serialize, Deserialize}; +use super::PaystubOverrideEmployerAddress; ///The employer on the paystub. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PaystubOverrideEmployer { + ///The address of the employer. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, ///The name of the employer. #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, @@ -10,4 +14,4 @@ impl std::fmt::Display for PaystubOverrideEmployer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_override_employer_address.rs b/src/model/paystub_override_employer_address.rs new file mode 100644 index 00000000..27d193ec --- /dev/null +++ b/src/model/paystub_override_employer_address.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +///The address of the employer. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaystubOverrideEmployerAddress { + ///The full city name. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub city: Option, + ///The country of the address. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + ///5 digit postal code. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + /**The region or state +Example: `"NC"`*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + /**The full street address +Example: `"564 Main Street, APT 15"`*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street: Option, +} +impl std::fmt::Display for PaystubOverrideEmployerAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/paystub_override_net_pay.rs b/src/model/paystub_override_net_pay.rs new file mode 100644 index 00000000..2fcac49f --- /dev/null +++ b/src/model/paystub_override_net_pay.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///An object representing information about the net pay amount on the paystub. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PaystubOverrideNetPay { + ///The ISO-4217 currency code of the net pay. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency: Option, + ///Description of the net pay + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + ///The year-to-date amount of the net pay + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ytd_amount: Option, +} +impl std::fmt::Display for PaystubOverrideNetPay { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/paystub_override_pay_period_details.rs b/src/model/paystub_override_pay_period_details.rs index cff20545..b39679e6 100644 --- a/src/model/paystub_override_pay_period_details.rs +++ b/src/model/paystub_override_pay_period_details.rs @@ -31,4 +31,4 @@ impl std::fmt::Display for PaystubOverridePayPeriodDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/identity_document.rs b/src/model/paystub_override_taxpayer_id.rs similarity index 52% rename from src/model/identity_document.rs rename to src/model/paystub_override_taxpayer_id.rs index 13a797f7..94ff876d 100644 --- a/src/model/identity_document.rs +++ b/src/model/paystub_override_taxpayer_id.rs @@ -1,16 +1,16 @@ use serde::{Serialize, Deserialize}; -use super::IdentityDocumentMetadata; -///Document object with metadata of the document uploaded +///Taxpayer ID of the individual receiving the paystub. #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct IdentityDocument { +pub struct PaystubOverrideTaxpayerId { + ///ID mask; i.e. last 4 digits of the taxpayer ID #[serde(default, skip_serializing_if = "Option::is_none")] - pub document_id: Option, - ///In closed beta. Object representing metadata pertaining to the document. + pub id_mask: Option, + ///Type of ID, e.g. 'SSN' #[serde(default, skip_serializing_if = "Option::is_none")] - pub metadata: Option, + pub id_type: Option, } -impl std::fmt::Display for IdentityDocument { +impl std::fmt::Display for PaystubOverrideTaxpayerId { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/paystub_pay_frequency.rs b/src/model/paystub_pay_frequency.rs index 0d1f5830..f8e7ea23 100644 --- a/src/model/paystub_pay_frequency.rs +++ b/src/model/paystub_pay_frequency.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct PaystubPayFrequency(pub serde_json::Value); \ No newline at end of file +pub struct PaystubPayFrequency(pub serde_json::Value); diff --git a/src/model/paystub_ytd_details.rs b/src/model/paystub_ytd_details.rs index 86ca2b08..08d971ba 100644 --- a/src/model/paystub_ytd_details.rs +++ b/src/model/paystub_ytd_details.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for PaystubYtdDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/pending_disconnect_webhook.rs b/src/model/pending_disconnect_webhook.rs new file mode 100644 index 00000000..2fa4af0d --- /dev/null +++ b/src/model/pending_disconnect_webhook.rs @@ -0,0 +1,23 @@ +use serde::{Serialize, Deserialize}; +use super::{PendingDisconnectWebhookReason, WebhookEnvironmentValues}; +///Fired when an Item is expected to be disconnected. The webhook will currently be fired 7 days before the existing Item is scheduled for disconnection. This can be resolved by having the user go through Link’s [update mode](http://plaid.com/docs/link/update-mode). Currently, this webhook is fired only for US or Canadian institutions; in the UK or EU, you should continue to listed for the [`PENDING_EXPIRATION`](https://plaid.com/docs/api/items/#pending_expiration) webhook instead. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct PendingDisconnectWebhook { + ///The Plaid environment the webhook was sent from + pub environment: WebhookEnvironmentValues, + ///The `item_id` of the Item associated with this webhook, warning, or error + pub item_id: String, + /**Reason why the item is about to be disconnected. +`INSTITUTION_MIGRATION`: The institution is moving to API or to a different integration. For example, this can occur when an institution moves from a non-OAuth integration to an OAuth integration. +`INSTITUTION_TOKEN_EXPIRATION`: The consent on an Item associated with a US or CA institution is about to expire.*/ + pub reason: PendingDisconnectWebhookReason, + ///`PENDING_DISCONNECT` + pub webhook_code: String, + ///`ITEM` + pub webhook_type: String, +} +impl std::fmt::Display for PendingDisconnectWebhook { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/pending_disconnect_webhook_reason.rs b/src/model/pending_disconnect_webhook_reason.rs new file mode 100644 index 00000000..2957607c --- /dev/null +++ b/src/model/pending_disconnect_webhook_reason.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +/**Reason why the item is about to be disconnected. +`INSTITUTION_MIGRATION`: The institution is moving to API or to a different integration. For example, this can occur when an institution moves from a non-OAuth integration to an OAuth integration. +`INSTITUTION_TOKEN_EXPIRATION`: The consent on an Item associated with a US or CA institution is about to expire.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PendingDisconnectWebhookReason { + #[serde(rename = "INSTITUTION_MIGRATION")] + InstitutionMigration, + #[serde(rename = "INSTITUTION_TOKEN_EXPIRATION")] + InstitutionTokenExpiration, +} diff --git a/src/model/pending_expiration_webhook.rs b/src/model/pending_expiration_webhook.rs index a6d7a551..4ca6cc0f 100644 --- a/src/model/pending_expiration_webhook.rs +++ b/src/model/pending_expiration_webhook.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; -///Fired when an Item’s access consent is expiring in 7 days. Some Items have explicit expiration times and we try to relay this when possible to reduce service disruption. This can be resolved by having the user go through Link’s update mode. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::WebhookEnvironmentValues; +///Fired when an Item’s access consent is expiring in 7 days. This can be resolved by having the user go through Link’s update mode. This webhook is fired only for Items associated with institutions in Europe (including the UK); for Items associated with institutions in the US or Canada, see [`PENDING_DISCONNECT`](https://plaid.com/docs/api/items/#pending_disconnect) instead. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PendingExpirationWebhook { ///The date and time at which the Item's access consent will expire, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format pub consent_expiration_time: chrono::DateTime, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The `item_id` of the Item associated with this webhook, warning, or error pub item_id: String, ///`PENDING_EXPIRATION` @@ -17,4 +18,4 @@ impl std::fmt::Display for PendingExpirationWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/personal_finance_category.rs b/src/model/personal_finance_category.rs index 715a09e3..9cb35676 100644 --- a/src/model/personal_finance_category.rs +++ b/src/model/personal_finance_category.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for PersonalFinanceCategory { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/phone_number.rs b/src/model/phone_number.rs index 5dcbdf0c..43993bff 100644 --- a/src/model/phone_number.rs +++ b/src/model/phone_number.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for PhoneNumber { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/phone_number_match_score.rs b/src/model/phone_number_match_score.rs index 6e231710..679f8d82 100644 --- a/src/model/phone_number_match_score.rs +++ b/src/model/phone_number_match_score.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for PhoneNumberMatchScore { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/phone_type.rs b/src/model/phone_type.rs new file mode 100644 index 00000000..248eec7a --- /dev/null +++ b/src/model/phone_type.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///An enum indicating whether a phone number is a phone line or a fax line. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PhoneType { + #[serde(rename = "phone")] + Phone, + #[serde(rename = "fax")] + Fax, +} diff --git a/src/model/physical_document_category.rs b/src/model/physical_document_category.rs new file mode 100644 index 00000000..678fa731 --- /dev/null +++ b/src/model/physical_document_category.rs @@ -0,0 +1,31 @@ +use serde::{Serialize, Deserialize}; +/**The type of identity document detected in the images provided. Will always be one of the following values: + + `drivers_license` - A driver's license issued by the associated country, establishing identity without any guarantee as to citizenship, and granting driving privileges + + `id_card` - A general national identification card, distinct from driver's licenses as it only establishes identity + + `passport` - A travel passport issued by the associated country for one of its citizens + + `residence_permit_card` - An identity document issued by the associated country permitting a foreign citizen to temporarily reside there + + `resident_card` - An identity document issued by the associated country permitting a foreign citizen to permanently reside there + + `visa` - An identity document issued by the associated country permitting a foreign citizen entry for a short duration and for a specific purpose, typically no longer than 6 months + +Note: This value may be different from the ID type that the user selects within Link. For example, if they select "Driver's License" but then submit a picture of a passport, this field will say `passport`*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PhysicalDocumentCategory { + #[serde(rename = "drivers_license")] + DriversLicense, + #[serde(rename = "id_card")] + IdCard, + #[serde(rename = "passport")] + Passport, + #[serde(rename = "residence_permit_card")] + ResidencePermitCard, + #[serde(rename = "resident_card")] + ResidentCard, + #[serde(rename = "visa")] + Visa, +} diff --git a/src/model/physical_document_extracted_data.rs b/src/model/physical_document_extracted_data.rs index fbe85f02..5a508541 100644 --- a/src/model/physical_document_extracted_data.rs +++ b/src/model/physical_document_extracted_data.rs @@ -1,7 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::IdentityVerificationDocumentAddressResponse; +use super::{ + IdentityVerificationDocumentAddressResponse, + IdentityVerificationDocumentNameResponse, PhysicalDocumentCategory, +}; ///Data extracted from a user-submitted document. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PhysicalDocumentExtractedData { /**The address extracted from the document. The address must at least contain the following fields to be a valid address: `street`, `city`, `country`. If any are missing or unable to be extracted, the address will be null. @@ -29,7 +32,7 @@ Note: Optical Character Recognition (OCR) technology may sometimes extract incor `visa` - An identity document issued by the associated country permitting a foreign citizen entry for a short duration and for a specific purpose, typically no longer than 6 months Note: This value may be different from the ID type that the user selects within Link. For example, if they select "Driver's License" but then submit a picture of a passport, this field will say `passport`*/ - pub category: String, + pub category: PhysicalDocumentCategory, ///A date extracted from the document in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub date_of_birth: Option, @@ -44,9 +47,12 @@ Note: This value may be different from the ID type that the user selects within ///An ISO 3166-2 subdivision code. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc. #[serde(default, skip_serializing_if = "Option::is_none")] pub issuing_region: Option, + ///The individual's name extracted from the document. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, } impl std::fmt::Display for PhysicalDocumentExtractedData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/physical_document_extracted_data_analysis.rs b/src/model/physical_document_extracted_data_analysis.rs index 3524c95b..b03843ea 100644 --- a/src/model/physical_document_extracted_data_analysis.rs +++ b/src/model/physical_document_extracted_data_analysis.rs @@ -1,22 +1,25 @@ use serde::{Serialize, Deserialize}; +use super::{ + DocumentDateOfBirthMatchCode, DocumentNameMatchCode, ExpirationDate, IssuingCountry, +}; ///Analysis of the data extracted from the submitted document. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PhysicalDocumentExtractedDataAnalysis { ///A match summary describing the cross comparison between the subject's date of birth, extracted from the document image, and the date of birth they separately provided to the identity verification attempt. - pub date_of_birth: String, + pub date_of_birth: DocumentDateOfBirthMatchCode, /**A description of whether the associated document was expired when the verification was performed. Note: In the case where an expiration date is not present on the document or failed to be extracted, this value will be `no_data`.*/ - pub expiration_date: String, + pub expiration_date: ExpirationDate, /**A binary match indicator specifying whether the country that issued the provided document matches the country that the user separately provided to Plaid. Note: You can configure whether a `no_match` on `issuing_country` fails the `documentary_verification` by editing your Plaid Template.*/ - pub issuing_country: String, + pub issuing_country: IssuingCountry, ///A match summary describing the cross comparison between the subject's name, extracted from the document image, and the name they separately provided to identity verification attempt. - pub name: String, + pub name: DocumentNameMatchCode, } impl std::fmt::Display for PhysicalDocumentExtractedDataAnalysis { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/physical_document_images.rs b/src/model/physical_document_images.rs index cb7c52bc..053d48bf 100644 --- a/src/model/physical_document_images.rs +++ b/src/model/physical_document_images.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for PhysicalDocumentImages { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/plaid_error.rs b/src/model/plaid_error.rs index db4f7765..0ef220c8 100644 --- a/src/model/plaid_error.rs +++ b/src/model/plaid_error.rs @@ -1,8 +1,9 @@ use serde::{Serialize, Deserialize}; -///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::PlaidErrorType; +///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct PlaidError { - /**In the Assets product, a request can pertain to more than one Item. If an error is returned for such a request, `causes` will return an array of errors containing a breakdown of these errors on the individual Item level, if any can be identified. + /**In this product, a request can pertain to more than one Item. If an error is returned for such a request, `causes` will return an array of errors containing a breakdown of these errors on the individual Item level, if any can be identified. `causes` will only be provided for the `error_type` `ASSET_REPORT_ERROR`. `causes` will also not be populated inside an error nested within a `warning` object.*/ #[serde(default, skip_serializing_if = "Option::is_none")] @@ -17,10 +18,20 @@ This may change over time and is not safe for programmatic use.*/ pub documentation_url: Option, ///The particular error code. Safe for programmatic use. pub error_code: String, + /**The specific reason for the error code. Currently, reasons are only supported OAuth-based item errors; `null` will be returned otherwise. Safe for programmatic use. + +Possible values: +`OAUTH_INVALID_TOKEN`: The user’s OAuth connection to this institution has been invalidated. + +`OAUTH_CONSENT_EXPIRED`: The user's access consent for this OAuth connection to this institution has expired. + +`OAUTH_REVOKED_TOKEN`: The user’s OAuth connection to this institution is invalid because the user revoked their connection.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_code_reason: Option, ///A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use. pub error_message: String, ///A broad categorization of the error. Safe for programmatic use. - pub error_type: String, + pub error_type: PlaidErrorType, ///A unique ID identifying the request, to be used for troubleshooting purposes. This field will be omitted in errors provided by webhooks. #[serde(default, skip_serializing_if = "Option::is_none")] pub request_id: Option, @@ -35,4 +46,4 @@ impl std::fmt::Display for PlaidError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/plaid_error_type.rs b/src/model/plaid_error_type.rs new file mode 100644 index 00000000..bb4a6d44 --- /dev/null +++ b/src/model/plaid_error_type.rs @@ -0,0 +1,43 @@ +use serde::{Serialize, Deserialize}; +///A broad categorization of the error. Safe for programmatic use. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PlaidErrorType { + #[serde(rename = "INVALID_REQUEST")] + InvalidRequest, + #[serde(rename = "INVALID_RESULT")] + InvalidResult, + #[serde(rename = "INVALID_INPUT")] + InvalidInput, + #[serde(rename = "INSTITUTION_ERROR")] + InstitutionError, + #[serde(rename = "RATE_LIMIT_EXCEEDED")] + RateLimitExceeded, + #[serde(rename = "API_ERROR")] + ApiError, + #[serde(rename = "ITEM_ERROR")] + ItemError, + #[serde(rename = "ASSET_REPORT_ERROR")] + AssetReportError, + #[serde(rename = "RECAPTCHA_ERROR")] + RecaptchaError, + #[serde(rename = "OAUTH_ERROR")] + OauthError, + #[serde(rename = "PAYMENT_ERROR")] + PaymentError, + #[serde(rename = "BANK_TRANSFER_ERROR")] + BankTransferError, + #[serde(rename = "INCOME_VERIFICATION_ERROR")] + IncomeVerificationError, + #[serde(rename = "MICRODEPOSITS_ERROR")] + MicrodepositsError, + #[serde(rename = "SANDBOX_ERROR")] + SandboxError, + #[serde(rename = "PARTNER_ERROR")] + PartnerError, + #[serde(rename = "TRANSACTIONS_ERROR")] + TransactionsError, + #[serde(rename = "TRANSACTION_ERROR")] + TransactionError, + #[serde(rename = "TRANSFER_ERROR")] + TransferError, +} diff --git a/src/model/platform_ids.rs b/src/model/platform_ids.rs index a3594c58..dd722b0c 100644 --- a/src/model/platform_ids.rs +++ b/src/model/platform_ids.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for PlatformIds { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/po_box_status.rs b/src/model/po_box_status.rs new file mode 100644 index 00000000..c448df5d --- /dev/null +++ b/src/model/po_box_status.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Field describing whether the associated address is a post office box. Will be `yes` when a P.O. box is detected, `no` when Plaid confirmed the address is not a P.O. box, and `no_data` when Plaid was not able to determine if the address is a P.O. box. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PoBoxStatus { + #[serde(rename = "yes")] + Yes, + #[serde(rename = "no")] + No, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/prism_cash_score.rs b/src/model/prism_cash_score.rs new file mode 100644 index 00000000..0b69951d --- /dev/null +++ b/src/model/prism_cash_score.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +use super::PrismCashScoreMetadata; +///The data from the CashScore® product returned by Prism Data. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PrismCashScore { + ///The error returned by Prism for this product. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_reason: Option, + ///An object containing metadata about the provided transactions. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, + ///The version of Prism Data's cash score model used. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub model_version: Option, + ///The reasons for an individual having risk according to the cash score. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason_codes: Option>, + ///The score returned by Prism Data. Ranges from 1-999, with higher score indicating lower risk. + pub score: i64, + ///The version of Prism Data's cash score model used. This field is deprecated in favor of `model_version`. + pub version: i64, +} +impl std::fmt::Display for PrismCashScore { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/prism_cash_score_metadata.rs b/src/model/prism_cash_score_metadata.rs new file mode 100644 index 00000000..117ca5a5 --- /dev/null +++ b/src/model/prism_cash_score_metadata.rs @@ -0,0 +1,42 @@ +use serde::{Serialize, Deserialize}; +///An object containing metadata about the provided transactions. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PrismCashScoreMetadata { + ///Number of credit transactions in the last 30 days. + #[serde(rename = "l1m_credit_value_cnt")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub l1_m_credit_value_cnt: Option, + ///Number of debit transactions in the last 30 days. + #[serde(rename = "l1m_debit_value_cnt")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub l1_m_debit_value_cnt: Option, + ///Number of days since the oldest transaction. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max_age: Option, + ///Number of days since the oldest credit transaction. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max_age_credit: Option, + ///Number of days since the oldest debit transaction. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max_age_debit: Option, + ///Number of days since the latest transaction. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub min_age: Option, + ///Number of days since the latest credit transaction. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub min_age_credit: Option, + ///Number of days since the latest debit transaction. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub min_age_debit: Option, + ///Number of credit transactions. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub num_trxn_credit: Option, + ///Number of debit transactions. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub num_trxn_debit: Option, +} +impl std::fmt::Display for PrismCashScoreMetadata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/prism_cash_score_version.rs b/src/model/prism_cash_score_version.rs new file mode 100644 index 00000000..a69844c3 --- /dev/null +++ b/src/model/prism_cash_score_version.rs @@ -0,0 +1,3 @@ +use serde::{Serialize, Deserialize}; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PrismCashScoreVersion(pub serde_json::Value); diff --git a/src/model/prism_first_detect.rs b/src/model/prism_first_detect.rs new file mode 100644 index 00000000..9de18d94 --- /dev/null +++ b/src/model/prism_first_detect.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +use super::PrismCashScoreMetadata; +///The data from the FirstDetect product returned by Prism Data. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PrismFirstDetect { + ///The error returned by Prism for this product. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_reason: Option, + ///An object containing metadata about the provided transactions. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, + ///The version of Prism Data's FirstDetect model used. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub model_version: Option, + ///The reasons for an individual having risk according to the FirstDetect score. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason_codes: Option>, + ///The score returned by Prism Data. Ranges from 1-999, with higher score indicating lower risk. + pub score: i64, + ///The version of Prism Data's FirstDetect model used. This field is deprecated in favor of `model_version`. + pub version: i64, +} +impl std::fmt::Display for PrismFirstDetect { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/prism_first_detect_version.rs b/src/model/prism_first_detect_version.rs new file mode 100644 index 00000000..8ecdd119 --- /dev/null +++ b/src/model/prism_first_detect_version.rs @@ -0,0 +1,3 @@ +use serde::{Serialize, Deserialize}; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PrismFirstDetectVersion(pub serde_json::Value); diff --git a/src/model/prism_insights.rs b/src/model/prism_insights.rs new file mode 100644 index 00000000..324ff70e --- /dev/null +++ b/src/model/prism_insights.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +use super::PrismInsightsResult; +///The data from the Insights product returned by Prism Data. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PrismInsights { + ///The error returned by Prism for this product. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error_reason: Option, + ///The Insights Result object is a map of cash flow attributes, where the key is a string, and the value is a float or string. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub result: Option, + ///The version of Prism Data's insights model used. + pub version: i64, +} +impl std::fmt::Display for PrismInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/prism_insights_result.rs b/src/model/prism_insights_result.rs new file mode 100644 index 00000000..fa848a12 --- /dev/null +++ b/src/model/prism_insights_result.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The Insights Result object is a map of cash flow attributes, where the key is a string, and the value is a float or string. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PrismInsightsResult {} +impl std::fmt::Display for PrismInsightsResult { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/prism_insights_version.rs b/src/model/prism_insights_version.rs new file mode 100644 index 00000000..c0979766 --- /dev/null +++ b/src/model/prism_insights_version.rs @@ -0,0 +1,3 @@ +use serde::{Serialize, Deserialize}; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PrismInsightsVersion(pub serde_json::Value); diff --git a/src/model/prism_product.rs b/src/model/prism_product.rs new file mode 100644 index 00000000..afec5cbd --- /dev/null +++ b/src/model/prism_product.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The Prism products that can be returned by the Plaid API +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum PrismProduct { + #[serde(rename = "insights")] + Insights, + #[serde(rename = "scores")] + Scores, +} diff --git a/src/model/prism_versions.rs b/src/model/prism_versions.rs new file mode 100644 index 00000000..52e70bd0 --- /dev/null +++ b/src/model/prism_versions.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +use super::{PrismCashScoreVersion, PrismFirstDetectVersion, PrismInsightsVersion}; +///The versions of Prism products to evaluate +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct PrismVersions { + ///The version of Prism CashScore. If not specified, will default to v3. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cashscore: Option, + ///The version of Prism FirstDetect. If not specified, will default to v3. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub firstdetect: Option, + ///The version of Prism Insights. If not specified, will default to v3. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub insights: Option, +} +impl std::fmt::Display for PrismVersions { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/processor_account_get_response.rs b/src/model/processor_account_get_response.rs index 400b7a82..2c3a472e 100644 --- a/src/model/processor_account_get_response.rs +++ b/src/model/processor_account_get_response.rs @@ -1,10 +1,12 @@ use serde::{Serialize, Deserialize}; use super::AccountBase; ///ProcessorAccountGetResponse defines the response schema for `/processor/account/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorAccountGetResponse { ///A single account at a financial institution. pub account: AccountBase, + ///The Plaid Institution ID associated with the Account. + pub institution_id: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, } @@ -12,4 +14,4 @@ impl std::fmt::Display for ProcessorAccountGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_auth_get_response.rs b/src/model/processor_auth_get_response.rs index 5739c9bd..ae451e91 100644 --- a/src/model/processor_auth_get_response.rs +++ b/src/model/processor_auth_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountBase, ProcessorNumber}; ///ProcessorAuthGetResponse defines the response schema for `/processor/auth/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorAuthGetResponse { ///A single account at a financial institution. pub account: AccountBase, @@ -14,4 +14,4 @@ impl std::fmt::Display for ProcessorAuthGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_balance_get_request_options.rs b/src/model/processor_balance_get_request_options.rs index 08f2d65e..1f77f999 100644 --- a/src/model/processor_balance_get_request_options.rs +++ b/src/model/processor_balance_get_request_options.rs @@ -1,12 +1,12 @@ use serde::{Serialize, Deserialize}; -///An optional object to filter `/processor/balance/get` results. +///Optional parameters to `/processor/balance/get`. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ProcessorBalanceGetRequestOptions { /**Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the oldest acceptable balance when making a request to `/accounts/balance/get`. -If the balance that is pulled for `ins_128026` (Capital One) is older than the given timestamp, an `INVALID_REQUEST` error with the code of `LAST_UPDATED_DATETIME_OUT_OF_RANGE` will be returned with the most recent timestamp for the requested account contained in the response. +This field is only necessary when the institution is `ins_128026` (Capital One), *and* one or more account types being requested is a non-depository account (such as a credit card) as Capital One does not provide real-time balance for non-depository accounts. In this case, a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For all other institutions, as well as for depository accounts at Capital One (including all checking and savings accounts) this field is ignored and real-time balance information will be fetched. -This field is only used when the institution is `ins_128026` (Capital One), in which case a value must be provided or an `INVALID_REQUEST` error with the code of `INVALID_FIELD` will be returned. For all other institutions, this field is ignored.*/ +If this field is not ignored, and no acceptable balance is available, an `INVALID_RESULT` error with the code `LAST_UPDATED_DATETIME_OUT_OF_RANGE` will be returned.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub min_last_updated_datetime: Option>, } @@ -14,4 +14,4 @@ impl std::fmt::Display for ProcessorBalanceGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_balance_get_response.rs b/src/model/processor_balance_get_response.rs index 49ef65a8..087a0f67 100644 --- a/src/model/processor_balance_get_response.rs +++ b/src/model/processor_balance_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::AccountBase; ///ProcessorBalanceGetResponse defines the response schema for `/processor/balance/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorBalanceGetResponse { ///A single account at a financial institution. pub account: AccountBase, @@ -12,4 +12,4 @@ impl std::fmt::Display for ProcessorBalanceGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_bank_transfer_create_response.rs b/src/model/processor_bank_transfer_create_response.rs index e3bcb2d9..ecdbad8b 100644 --- a/src/model/processor_bank_transfer_create_response.rs +++ b/src/model/processor_bank_transfer_create_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::BankTransfer; ///Defines the response schema for `/processor/bank_transfer/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorBankTransferCreateResponse { ///Represents a bank transfer within the Bank Transfers API. pub bank_transfer: BankTransfer, @@ -12,4 +12,4 @@ impl std::fmt::Display for ProcessorBankTransferCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_default_update_webhook.rs b/src/model/processor_default_update_webhook.rs index 6bf6b584..b9f9b7d8 100644 --- a/src/model/processor_default_update_webhook.rs +++ b/src/model/processor_default_update_webhook.rs @@ -1,17 +1,17 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; /**This webhook is only sent to [Plaid processor partners](https://plaid.com/docs/auth/partnerships/). Fired when new transaction data is available for an Item. Plaid will typically check for new transaction data several times a day. This webhook is intended for use with `/processor/transactions/get`; if you are using the newer `/processor/transactions/sync` endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the `SYNC_UPDATES_AVAILABLE` webhook instead.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorDefaultUpdateWebhook { ///The ID of the account. pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The number of new transactions detected since the last time this webhook was fired. @@ -25,4 +25,4 @@ impl std::fmt::Display for ProcessorDefaultUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_historical_update_webhook.rs b/src/model/processor_historical_update_webhook.rs index d354a0a4..d003b7fd 100644 --- a/src/model/processor_historical_update_webhook.rs +++ b/src/model/processor_historical_update_webhook.rs @@ -1,20 +1,20 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; /**This webhook is only sent to [Plaid processor partners](https://plaid.com/docs/auth/partnerships/). -Fired when an Item's historical transaction pull is completed and Plaid has prepared as much historical transaction data as possible for the Item. Once this webhook has been fired, transaction data beyond the most recent 30 days can be fetched for the Item. If [Account Select v2](https://plaid.com/docs/link/customization/#account-select) is enabled, this webhook will also be fired if account selections for the Item are updated, with `new_transactions` set to the number of net new transactions pulled after the account selection update. +Fired when an Item's historical transaction pull is completed and Plaid has prepared as much historical transaction data as possible for the Item. Once this webhook has been fired, transaction data beyond the most recent 30 days can be fetched for the Item. This webhook will also be fired if account selections for the Item are updated, with `new_transactions` set to the number of net new transactions pulled after the account selection update. This webhook is intended for use with `/processor/transactions/get`; if you are using the newer `/processor/transactions/sync` endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the `SYNC_UPDATES_AVAILABLE` webhook instead.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorHistoricalUpdateWebhook { ///The ID of the account. pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, - ///The number of new, unfetched transactions available + ///The number of new transactions available pub new_transactions: f64, ///`HISTORICAL_UPDATE` pub webhook_code: String, @@ -25,4 +25,4 @@ impl std::fmt::Display for ProcessorHistoricalUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_identity_get_response.rs b/src/model/processor_identity_get_response.rs index 26a9afcc..02aa0483 100644 --- a/src/model/processor_identity_get_response.rs +++ b/src/model/processor_identity_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::AccountIdentity; ///ProcessorIdentityGetResponse defines the response schema for `/processor/identity/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorIdentityGetResponse { ///Identity information about an account pub account: AccountIdentity, @@ -12,4 +12,4 @@ impl std::fmt::Display for ProcessorIdentityGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_identity_match_response.rs b/src/model/processor_identity_match_response.rs index 71b11bc3..1cf42161 100644 --- a/src/model/processor_identity_match_response.rs +++ b/src/model/processor_identity_match_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::AccountIdentityMatchScore; ///ProcessorIdentityMatchResponse defines the response schema for `/processor/identity/match` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorIdentityMatchResponse { ///Identity match scores for an account pub account: AccountIdentityMatchScore, @@ -12,4 +12,4 @@ impl std::fmt::Display for ProcessorIdentityMatchResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_initial_update_webhook.rs b/src/model/processor_initial_update_webhook.rs index 896f5519..1c53d824 100644 --- a/src/model/processor_initial_update_webhook.rs +++ b/src/model/processor_initial_update_webhook.rs @@ -1,19 +1,20 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; /**This webhook is only sent to [Plaid processor partners](https://plaid.com/docs/auth/partnerships/). -Fired when an Item's initial transaction pull is completed. Once this webhook has been fired, transaction data for the most recent 30 days can be fetched for the Item. If [Account Select v2](https://plaid.com/docs/link/customization/#account-select) is enabled, this webhook will also be fired if account selections for the Item are updated, with `new_transactions` set to the number of net new transactions pulled after the account selection update. +Fired when an Item's initial transaction pull is completed. Once this webhook has been fired, transaction data for the most recent 30 days can be fetched for the Item. This webhook will also be fired if account selections for the Item are updated, with `new_transactions` set to the number of net new transactions pulled after the account selection update. This webhook is intended for use with `/processor/transactions/get`; if you are using the newer `/processor/transactions/sync` endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the `SYNC_UPDATES_AVAILABLE` webhook instead.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorInitialUpdateWebhook { ///The ID of the account. pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The error code associated with the webhook. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, - ///The number of new, unfetched transactions available. + ///The number of new transactions available. pub new_transactions: f64, ///`INITIAL_UPDATE` pub webhook_code: String, @@ -24,4 +25,4 @@ impl std::fmt::Display for ProcessorInitialUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_liabilities_get_response.rs b/src/model/processor_liabilities_get_response.rs index 23cb93c3..3082ebf0 100644 --- a/src/model/processor_liabilities_get_response.rs +++ b/src/model/processor_liabilities_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountBase, LiabilitiesObject}; ///ProcessorLiabilitiesGetResponse defines the response schema for `/processor/liabilities/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorLiabilitiesGetResponse { ///A single account at a financial institution. pub account: AccountBase, @@ -14,4 +14,4 @@ impl std::fmt::Display for ProcessorLiabilitiesGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_number.rs b/src/model/processor_number.rs index 0fae571b..f76b5ff7 100644 --- a/src/model/processor_number.rs +++ b/src/model/processor_number.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for ProcessorNumber { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_recurring_transactions_update_webhook.rs b/src/model/processor_recurring_transactions_update_webhook.rs index e39fa1c9..90774bf6 100644 --- a/src/model/processor_recurring_transactions_update_webhook.rs +++ b/src/model/processor_recurring_transactions_update_webhook.rs @@ -1,15 +1,16 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; /**This webhook is only sent to [Plaid processor partners](https://plaid.com/docs/auth/partnerships/). Fired when recurring transactions data is updated. This includes when a new recurring stream is detected or when a new transaction is added to an existing recurring stream. The `RECURRING_TRANSACTIONS_UPDATE` webhook will also fire when one or more attributes of the recurring stream changes, which is usually a result of the addition, update, or removal of transactions to the stream. After receipt of this webhook, the updated data can be fetched from `/processor/transactions/recurring/get`.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorRecurringTransactionsUpdateWebhook { ///The ID of the account. pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///`RECURRING_TRANSACTIONS_UPDATE` pub webhook_code: String, ///`TRANSACTIONS` @@ -19,4 +20,4 @@ impl std::fmt::Display for ProcessorRecurringTransactionsUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_signal_decision_report_response.rs b/src/model/processor_signal_decision_report_response.rs index 8c4dfd69..4ec469eb 100644 --- a/src/model/processor_signal_decision_report_response.rs +++ b/src/model/processor_signal_decision_report_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for ProcessorSignalDecisionReportResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_signal_evaluate_response.rs b/src/model/processor_signal_evaluate_response.rs index a9feed47..5262aaac 100644 --- a/src/model/processor_signal_evaluate_response.rs +++ b/src/model/processor_signal_evaluate_response.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -use super::{SignalEvaluateCoreAttributes, SignalScores, SignalWarning}; +use super::{Ruleset, SignalEvaluateCoreAttributes, SignalScores, SignalWarning}; ///ProcessorSignalEvaluateResponse defines the response schema for `/processor/signal/evaluate` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ProcessorSignalEvaluateResponse { @@ -16,8 +16,12 @@ For the full list and detailed documentation of core attributes available, or to pub core_attributes: Option, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, + ///Details about the transaction result after evaluated by the requested Ruleset. If a `ruleset_key` is not provided, this field will be omitted. This feature is currently in closed beta; to request access, contact your account manager. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ruleset: Option, ///Risk scoring details broken down by risk category. - pub scores: SignalScores, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scores: Option, ///If bank information was not available to be used in the Signal model, this array contains warnings describing why bank data is missing. If you want to receive an API error instead of Signal scores in the case of missing bank data, file a support ticket or contact your Plaid account manager. #[serde(default, skip_serializing_if = "Option::is_none")] pub warnings: Option>, @@ -26,4 +30,4 @@ impl std::fmt::Display for ProcessorSignalEvaluateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_signal_prepare_response.rs b/src/model/processor_signal_prepare_response.rs index 31b91881..66af659c 100644 --- a/src/model/processor_signal_prepare_response.rs +++ b/src/model/processor_signal_prepare_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for ProcessorSignalPrepareResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_signal_return_report_response.rs b/src/model/processor_signal_return_report_response.rs index fba68a89..4a9a77e5 100644 --- a/src/model/processor_signal_return_report_response.rs +++ b/src/model/processor_signal_return_report_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for ProcessorSignalReturnReportResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_stripe_bank_account_token_create_response.rs b/src/model/processor_stripe_bank_account_token_create_response.rs index f81ca0aa..7dc801c5 100644 --- a/src/model/processor_stripe_bank_account_token_create_response.rs +++ b/src/model/processor_stripe_bank_account_token_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for ProcessorStripeBankAccountTokenCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_sync_updates_available_webhook.rs b/src/model/processor_sync_updates_available_webhook.rs index abee62d9..f7c7a1cf 100644 --- a/src/model/processor_sync_updates_available_webhook.rs +++ b/src/model/processor_sync_updates_available_webhook.rs @@ -1,4 +1,5 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; /**This webhook is only sent to [Plaid processor partners](https://plaid.com/docs/auth/partnerships/). Fired when an Item's transactions change. This can be due to any event resulting in new changes, such as an initial 30-day transactions fetch upon the initialization of an Item with transactions, the backfill of historical transactions that occurs shortly after, or when changes are populated from a regularly-scheduled transactions update job. It is recommended to listen for the `SYNC_UPDATES_AVAILABLE` webhook when using the `/processor/transactions/sync` endpoint. Note that when using `/processor/transactions/sync` the older webhooks `INITIAL_UPDATE`, `HISTORICAL_UPDATE`, `DEFAULT_UPDATE`, and `TRANSACTIONS_REMOVED`, which are intended for use with `/processor/transactions/get`, will also continue to be sent in order to maintain backwards compatibility. It is not necessary to listen for and respond to those webhooks when using `/processor/transactions/sync`. @@ -8,12 +9,12 @@ After receipt of this webhook, the new changes can be fetched for the Item from Note that to receive this webhook for an Item, `/processor/transactions/sync` must have been called at least once on that Item. This means that, unlike the `INITIAL_UPDATE` and `HISTORICAL_UPDATE` webhooks, it will not fire immediately upon Item creation. If `/transactions/sync` is called on an Item that was *not* initialized with Transactions, the webhook will fire twice: once the first 30 days of transactions data has been fetched, and a second time when all available historical transactions data has been fetched. This webhook will typically not fire in the Sandbox environment, due to the lack of dynamic transactions data. To test this webhook in Sandbox, call `/sandbox/item/fire_webhook`.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorSyncUpdatesAvailableWebhook { ///The ID of the account. pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///Indicates if historical pull information is available. pub historical_update_complete: bool, ///Indicates if initial pull information is available. @@ -27,4 +28,4 @@ impl std::fmt::Display for ProcessorSyncUpdatesAvailableWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_token_create_response.rs b/src/model/processor_token_create_response.rs index 76ef45bd..8c7ee387 100644 --- a/src/model/processor_token_create_response.rs +++ b/src/model/processor_token_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for ProcessorTokenCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_token_permissions_get_response.rs b/src/model/processor_token_permissions_get_response.rs index 380d8ebe..287d43d8 100644 --- a/src/model/processor_token_permissions_get_response.rs +++ b/src/model/processor_token_permissions_get_response.rs @@ -1,10 +1,11 @@ use serde::{Serialize, Deserialize}; +use super::Products; ///ProcessorTokenPermissionsGetResponse defines the response schema for `/processor/token/permissions/get` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ProcessorTokenPermissionsGetResponse { ///A list of products the processor token should have access to. An empty list means that the processor has access to all available products, including future products. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub products: Vec, + pub products: Vec, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, } @@ -12,4 +13,4 @@ impl std::fmt::Display for ProcessorTokenPermissionsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_token_permissions_set_response.rs b/src/model/processor_token_permissions_set_response.rs index 433455dd..8c9e81b7 100644 --- a/src/model/processor_token_permissions_set_response.rs +++ b/src/model/processor_token_permissions_set_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for ProcessorTokenPermissionsSetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_token_webhook_update_response.rs b/src/model/processor_token_webhook_update_response.rs index 2d20a723..924ff3ab 100644 --- a/src/model/processor_token_webhook_update_response.rs +++ b/src/model/processor_token_webhook_update_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for ProcessorTokenWebhookUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_transactions_get_request_options.rs b/src/model/processor_transactions_get_request_options.rs index 24532bc2..7d25a867 100644 --- a/src/model/processor_transactions_get_request_options.rs +++ b/src/model/processor_transactions_get_request_options.rs @@ -8,7 +8,7 @@ pub struct ProcessorTransactionsGetRequestOptions { ///Counterparties and extra merchant fields are now returned by default. #[serde(default, skip_serializing_if = "Option::is_none")] pub include_logo_and_counterparty_beta: Option, - ///Include the raw unparsed transaction description from the financial institution. This field is disabled by default. If you need this information in addition to the parsed data provided, contact your Plaid Account Manager, or submit a [Support request](https://dashboard.plaid.com/support/new/product-and-development/product-troubleshooting/product-functionality). + ///Include the raw unparsed transaction description from the financial institution. #[serde(default, skip_serializing_if = "Option::is_none")] pub include_original_description: Option, ///Personal finance categories are now returned by default. @@ -25,4 +25,4 @@ impl std::fmt::Display for ProcessorTransactionsGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_transactions_get_response.rs b/src/model/processor_transactions_get_response.rs index 1182c40f..c0aa1384 100644 --- a/src/model/processor_transactions_get_response.rs +++ b/src/model/processor_transactions_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountBase, Transaction}; ///ProcessorTransactionsGetResponse defines the response schema for `/processor/transactions/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorTransactionsGetResponse { ///A single account at a financial institution. pub account: AccountBase, @@ -17,4 +17,4 @@ impl std::fmt::Display for ProcessorTransactionsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_transactions_recurring_get_response.rs b/src/model/processor_transactions_recurring_get_response.rs index ff688d8f..c93047fd 100644 --- a/src/model/processor_transactions_recurring_get_response.rs +++ b/src/model/processor_transactions_recurring_get_response.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for ProcessorTransactionsRecurringGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_transactions_refresh_response.rs b/src/model/processor_transactions_refresh_response.rs index 61afc8df..0787f189 100644 --- a/src/model/processor_transactions_refresh_response.rs +++ b/src/model/processor_transactions_refresh_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for ProcessorTransactionsRefreshResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_transactions_removed_webhook.rs b/src/model/processor_transactions_removed_webhook.rs index b9447441..314457d5 100644 --- a/src/model/processor_transactions_removed_webhook.rs +++ b/src/model/processor_transactions_removed_webhook.rs @@ -1,17 +1,17 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; /**This webhook is only sent to [Plaid processor partners](https://plaid.com/docs/auth/partnerships/). Fired when transaction(s) for an Item are deleted. The deleted transaction IDs are included in the webhook payload. Plaid will typically check for deleted transaction data several times a day. This webhook is intended for use with `/processor/transactions/get`; if you are using the newer `/processor/transactions/sync` endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the `SYNC_UPDATES_AVAILABLE` webhook instead.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorTransactionsRemovedWebhook { ///The ID of the account. pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///An array of `transaction_ids` corresponding to the removed transactions @@ -26,4 +26,4 @@ impl std::fmt::Display for ProcessorTransactionsRemovedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/processor_transactions_sync_response.rs b/src/model/processor_transactions_sync_response.rs index 821ace9d..0a0127f0 100644 --- a/src/model/processor_transactions_sync_response.rs +++ b/src/model/processor_transactions_sync_response.rs @@ -1,8 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::{RemovedTransaction, Transaction}; +use super::{AccountBase, RemovedTransaction, Transaction, TransactionsUpdateStatus}; ///ProcessorTransactionsSyncResponse defines the response schema for `/processor/transactions/sync` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorTransactionsSyncResponse { + ///A single account at a financial institution. + pub account: AccountBase, ///Transactions that have been added to the Item since `cursor` ordered by ascending last modified time. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub added: Vec, @@ -18,9 +20,16 @@ pub struct ProcessorTransactionsSyncResponse { pub removed: Vec, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, + /**A description of the update status for transaction pulls of an Item. + +`TRANSACTIONS_UPDATE_STATUS_UNKNOWN`: Unable to fetch transactions update status for Item. +`NOT_READY`: The Item is pending transaction pull. +`INITIAL_UPDATE_COMPLETE`: Initial pull for the Item is complete, historical pull is pending. +`HISTORICAL_UPDATE_COMPLETE`: Both initial and historical pull for Item are complete.*/ + pub transactions_update_status: TransactionsUpdateStatus, } impl std::fmt::Display for ProcessorTransactionsSyncResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/product_access.rs b/src/model/product_access.rs index 35aa293c..119de197 100644 --- a/src/model/product_access.rs +++ b/src/model/product_access.rs @@ -34,4 +34,4 @@ impl std::fmt::Display for ProductAccess { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/product_permissions_required_auth_webhook.rs b/src/model/product_permissions_required_auth_webhook.rs index 9cea394f..9e631e7f 100644 --- a/src/model/product_permissions_required_auth_webhook.rs +++ b/src/model/product_permissions_required_auth_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when an `ACCESS_NOT_GRANTED` error is hit for Auth. The error can be resolved by putting the user through update mode with `auth` in the `products` array, as well as through the limited beta for update mode Authentication product validations. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProductPermissionsRequiredAuthWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The `item_id` of the Item associated with this webhook, warning, or error pub item_id: String, ///`PRODUCT_PERMISSIONS_REQUIRED` @@ -15,4 +16,4 @@ impl std::fmt::Display for ProductPermissionsRequiredAuthWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/product_permissions_required_identity_webhook.rs b/src/model/product_permissions_required_identity_webhook.rs index d91f4836..bcc599e4 100644 --- a/src/model/product_permissions_required_identity_webhook.rs +++ b/src/model/product_permissions_required_identity_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when an `ACCESS_NOT_GRANTED` error is hit for Identity. The error can be resolved by putting the user through update mode with `identity` in the `products` array, as well as through the limited beta for update mode Identity product validations. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProductPermissionsRequiredIdentityWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The `item_id` of the Item associated with this webhook, warning, or error pub item_id: String, ///`PRODUCT_PERMISSIONS_REQUIRED` @@ -15,4 +16,4 @@ impl std::fmt::Display for ProductPermissionsRequiredIdentityWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/product_status.rs b/src/model/product_status.rs index c80df1cf..06b2638b 100644 --- a/src/model/product_status.rs +++ b/src/model/product_status.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for ProductStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/product_status_breakdown.rs b/src/model/product_status_breakdown.rs index 82428164..a08caf09 100644 --- a/src/model/product_status_breakdown.rs +++ b/src/model/product_status_breakdown.rs @@ -6,7 +6,7 @@ pub struct ProductStatusBreakdown { pub error_institution: f64, ///The percentage of logins that are failing due to an internal Plaid issue, expressed as a decimal. pub error_plaid: f64, - ///The `refresh_interval` may be `DELAYED` or `STOPPED` even when the success rate is high. This value is only returned for Transactions status breakdowns. + ///How frequently data for subscription products like Investments, Transactions, and Liabilities, is being refreshed, relative to the institution's normal scheduling. The `refresh_interval` may be `DELAYED` or `STOPPED` even when the success rate is high. #[serde(default, skip_serializing_if = "Option::is_none")] pub refresh_interval: Option, ///The percentage of login attempts that are successful, expressed as a decimal. @@ -16,4 +16,4 @@ impl std::fmt::Display for ProductStatusBreakdown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/products.rs b/src/model/products.rs new file mode 100644 index 00000000..90f2d453 --- /dev/null +++ b/src/model/products.rs @@ -0,0 +1,69 @@ +use serde::{Serialize, Deserialize}; +///A list of products that an institution can support. All Items must be initialized with at least one product. The Balance product is always available and does not need to be specified during initialization. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum Products { + #[serde(rename = "assets")] + Assets, + #[serde(rename = "auth")] + Auth, + #[serde(rename = "balance")] + Balance, + #[serde(rename = "balance_plus")] + BalancePlus, + #[serde(rename = "beacon")] + Beacon, + #[serde(rename = "identity")] + Identity, + #[serde(rename = "identity_match")] + IdentityMatch, + #[serde(rename = "investments")] + Investments, + #[serde(rename = "investments_auth")] + InvestmentsAuth, + #[serde(rename = "liabilities")] + Liabilities, + #[serde(rename = "payment_initiation")] + PaymentInitiation, + #[serde(rename = "identity_verification")] + IdentityVerification, + #[serde(rename = "transactions")] + Transactions, + #[serde(rename = "credit_details")] + CreditDetails, + #[serde(rename = "income")] + Income, + #[serde(rename = "income_verification")] + IncomeVerification, + #[serde(rename = "standing_orders")] + StandingOrders, + #[serde(rename = "transfer")] + Transfer, + #[serde(rename = "employment")] + Employment, + #[serde(rename = "recurring_transactions")] + RecurringTransactions, + #[serde(rename = "signal")] + Signal, + #[serde(rename = "statements")] + Statements, + #[serde(rename = "processor_payments")] + ProcessorPayments, + #[serde(rename = "processor_identity")] + ProcessorIdentity, + #[serde(rename = "profile")] + Profile, + #[serde(rename = "cra_base_report")] + CraBaseReport, + #[serde(rename = "cra_income_insights")] + CraIncomeInsights, + #[serde(rename = "cra_partner_insights")] + CraPartnerInsights, + #[serde(rename = "cra_network_insights")] + CraNetworkInsights, + #[serde(rename = "cra_cashflow_insights")] + CraCashflowInsights, + #[serde(rename = "layer")] + Layer, + #[serde(rename = "pay_by_bank")] + PayByBank, +} diff --git a/src/model/profile_get_response.rs b/src/model/profile_get_response.rs new file mode 100644 index 00000000..2f9f0518 --- /dev/null +++ b/src/model/profile_get_response.rs @@ -0,0 +1,18 @@ +use serde::{Serialize, Deserialize}; +use super::{ProfileIdentity, ProfileItem}; +///ProfileGetResponse defines the response schema for `/profile/get` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ProfileGetResponse { + ///ProfileIdentity defines the identity data permissioned by the end user during the authorization flow. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub items: Vec, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for ProfileGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/profile_identity.rs b/src/model/profile_identity.rs new file mode 100644 index 00000000..3844685f --- /dev/null +++ b/src/model/profile_identity.rs @@ -0,0 +1,33 @@ +use serde::{Serialize, Deserialize}; +use super::{ProfileIdentityAddress, ProfileIdentityName}; +///ProfileIdentity defines the identity data permissioned by the end user during the authorization flow. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ProfileIdentity { + ///ProfileIdentityAddress defines the user's address. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + ///The user's date of birth. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub date_of_birth: Option, + ///The user's email address. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email: Option, + ///ProfileIdentityName defines the user's first name and last name. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + ///The user's phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: Option, + ///The user's social security number. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ssn: Option, + ///The last 4 digits of the user's social security number. + #[serde(rename = "ssn_last_4")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ssn_last4: Option, +} +impl std::fmt::Display for ProfileIdentity { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/profile_identity_address.rs b/src/model/profile_identity_address.rs new file mode 100644 index 00000000..29964585 --- /dev/null +++ b/src/model/profile_identity_address.rs @@ -0,0 +1,30 @@ +use serde::{Serialize, Deserialize}; +///ProfileIdentityAddress defines the user's address. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ProfileIdentityAddress { + ///The full city name + #[serde(default, skip_serializing_if = "Option::is_none")] + pub city: Option, + ///The ISO 3166-1 alpha-2 country code + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + ///The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + /**The region or state. +Example: `"NC"`*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + /**The full street address +Example: `"564 Main Street, APT 15"`*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street: Option, + ///The second line street address + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street2: Option, +} +impl std::fmt::Display for ProfileIdentityAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/profile_identity_name.rs b/src/model/profile_identity_name.rs new file mode 100644 index 00000000..70174eac --- /dev/null +++ b/src/model/profile_identity_name.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///ProfileIdentityName defines the user's first name and last name. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ProfileIdentityName { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_name: Option, +} +impl std::fmt::Display for ProfileIdentityName { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/profile_item.rs b/src/model/profile_item.rs new file mode 100644 index 00000000..06806b16 --- /dev/null +++ b/src/model/profile_item.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///ProfileItem defines an Item created during a profile authorization session. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ProfileItem { + ///The access token associated with the Item data is being requested for. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub access_token: Option, + ///The Plaid Item ID. The `item_id` is always unique; linking the same account at the same institution twice will result in two Items with different `item_id` values. Like all Plaid identifiers, the `item_id` is case-sensitive. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item_id: Option, +} +impl std::fmt::Display for ProfileItem { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/profile_network_status_get_network_status.rs b/src/model/profile_network_status_get_network_status.rs new file mode 100644 index 00000000..5efc66a9 --- /dev/null +++ b/src/model/profile_network_status_get_network_status.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///Enum representing the overall network status of the user +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ProfileNetworkStatusGetNetworkStatus { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "RETURNING_USER")] + ReturningUser, +} diff --git a/src/model/profile_network_status_get_response.rs b/src/model/profile_network_status_get_response.rs new file mode 100644 index 00000000..dd06e3cc --- /dev/null +++ b/src/model/profile_network_status_get_response.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::ProfileNetworkStatusGetNetworkStatus; +///ProfileNetworkStatusGetResponse defines the response schema for `/profile/network_status/get` +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ProfileNetworkStatusGetResponse { + ///Enum representing the overall network status of the user + pub network_status: ProfileNetworkStatusGetNetworkStatus, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for ProfileNetworkStatusGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/profile_network_status_get_user.rs b/src/model/profile_network_status_get_user.rs new file mode 100644 index 00000000..7f43266a --- /dev/null +++ b/src/model/profile_network_status_get_user.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///An object specifying information about the end user for the network status check +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct ProfileNetworkStatusGetUser { + ///The user's phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format + pub phone_number: String, +} +impl std::fmt::Display for ProfileNetworkStatusGetUser { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/program_name_sensitivity.rs b/src/model/program_name_sensitivity.rs new file mode 100644 index 00000000..bb2d6dc3 --- /dev/null +++ b/src/model/program_name_sensitivity.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +/**The valid name matching sensitivity configurations for a screening program. Note that while certain matching techniques may be more prevalent on less strict settings, all matching algorithms are enabled for every sensitivity. + +`coarse` - See more potential matches. This sensitivity will see more broad phonetic matches across alphabets that make missing a potential hit very unlikely. This setting is noisier and will require more manual review. + +`balanced` - A good default for most companies. This sensitivity is balanced to show high quality hits with reduced noise. + +`strict` - Aggressive false positive reduction. This sensitivity will require names to be more similar than `coarse` and `balanced` settings, relying less on phonetics, while still accounting for character transpositions, missing tokens, and other common permutations. + +`exact` - Matches must be nearly exact. This sensitivity will only show hits with exact or nearly exact name matches with only basic correction such as extraneous symbols and capitalization. This setting is generally not recommended unless you have a very specific use case.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ProgramNameSensitivity { + #[serde(rename = "coarse")] + Coarse, + #[serde(rename = "balanced")] + Balanced, + #[serde(rename = "strict")] + Strict, + #[serde(rename = "exact")] + Exact, +} diff --git a/src/model/proxy_type.rs b/src/model/proxy_type.rs new file mode 100644 index 00000000..2a542be4 --- /dev/null +++ b/src/model/proxy_type.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +/**An enum indicating whether a network proxy is present and if so what type it is. + +`none_detected` indicates the user is not on a detectable proxy network. + +`tor` indicates the user was using a Tor browser, which sends encrypted traffic on a decentralized network and is somewhat similar to a VPN (Virtual Private Network). + +`vpn` indicates the user is on a VPN (Virtual Private Network) + +`web_proxy` indicates the user is on a web proxy server, which may allow them to conceal information such as their IP address or other identifying information. + +`public_proxy` indicates the user is on a public web proxy server, which is similar to a web proxy but can be shared by multiple users. This may allow multiple users to appear as if they have the same IP address for instance.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ProxyType { + #[serde(rename = "none_detected")] + NoneDetected, + #[serde(rename = "tor")] + Tor, + #[serde(rename = "vpn")] + Vpn, + #[serde(rename = "web_proxy")] + WebProxy, + #[serde(rename = "public_proxy")] + PublicProxy, +} diff --git a/src/model/pslf_status.rs b/src/model/pslf_status.rs index 771e1ea7..3183fb7b 100644 --- a/src/model/pslf_status.rs +++ b/src/model/pslf_status.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///Information about the student's eligibility in the Public Service Loan Forgiveness program. This is only returned if the institution is FedLoan (`ins_116527`). +///Information about the student's eligibility in the Public Service Loan Forgiveness program. This is only returned if the institution is FedLoan (`ins_116527`). Since FedLoan no longer services student loans, this field is no longer returned. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PslfStatus { ///The estimated date borrower will have completed 120 qualifying monthly payments. Returned in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). @@ -16,4 +16,4 @@ impl std::fmt::Display for PslfStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/recipient_bacs.rs b/src/model/recipient_bacs.rs index 4b37b76e..61928f35 100644 --- a/src/model/recipient_bacs.rs +++ b/src/model/recipient_bacs.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for RecipientBacs { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/recipient_bacs_nullable.rs b/src/model/recipient_bacs_nullable.rs index b6f42301..7814762c 100644 --- a/src/model/recipient_bacs_nullable.rs +++ b/src/model/recipient_bacs_nullable.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; use super::RecipientBacs; -pub type RecipientBacsNullable = Option; \ No newline at end of file +pub type RecipientBacsNullable = Option; diff --git a/src/model/recurrence.rs b/src/model/recurrence.rs index 3bf2a3e5..2e5f6beb 100644 --- a/src/model/recurrence.rs +++ b/src/model/recurrence.rs @@ -34,4 +34,4 @@ impl std::fmt::Display for Recurrence { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/recurring_cancelled_webhook.rs b/src/model/recurring_cancelled_webhook.rs index d13c411a..aba9772a 100644 --- a/src/model/recurring_cancelled_webhook.rs +++ b/src/model/recurring_cancelled_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when a recurring transfer is cancelled by Plaid. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RecurringCancelledWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///Plaid’s unique identifier for a recurring transfer. pub recurring_transfer_id: String, ///`RECURRING_CANCELLED` @@ -15,4 +16,4 @@ impl std::fmt::Display for RecurringCancelledWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/recurring_frequency.rs b/src/model/recurring_frequency.rs index 03912858..98420184 100644 --- a/src/model/recurring_frequency.rs +++ b/src/model/recurring_frequency.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct RecurringFrequency(pub serde_json::Value); \ No newline at end of file +pub struct RecurringFrequency(pub serde_json::Value); diff --git a/src/model/recurring_insights_stream.rs b/src/model/recurring_insights_stream.rs index 651744fe..5161b730 100644 --- a/src/model/recurring_insights_stream.rs +++ b/src/model/recurring_insights_stream.rs @@ -1,7 +1,9 @@ use serde::{Serialize, Deserialize}; -use super::TransactionStreamAmount; +use super::{ + RecurringTransactionFrequency, TransactionStreamAmount, TransactionStreamStatus, +}; ///Insights object for recurring transactions streams. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RecurringInsightsStream { ///Object with data pertaining to an amount on the transaction stream. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -25,7 +27,7 @@ pub struct RecurringInsightsStream { `UNKNOWN`: Assigned to a transaction stream that does not fit any of the pre-defined frequencies.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub frequency: Option, + pub frequency: Option, ///Indicates whether the transaction stream is still live. pub is_active: bool, ///The merchant or primary counterparty associated with the transaction stream. @@ -55,7 +57,7 @@ pub struct RecurringInsightsStream { `UNKNOWN`: A stream is assigned an `UNKNOWN` status when none of the other statuses are applicable.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, + pub status: Option, ///A unique id for the stream. pub stream_id: String, ///The number of transactions in this stream. @@ -69,4 +71,4 @@ impl std::fmt::Display for RecurringInsightsStream { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/recurring_new_transfer_webhook.rs b/src/model/recurring_new_transfer_webhook.rs index 5fbd35d2..283028b2 100644 --- a/src/model/recurring_new_transfer_webhook.rs +++ b/src/model/recurring_new_transfer_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when a new transfer of a recurring transfer is originated. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RecurringNewTransferWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///Plaid’s unique identifier for a recurring transfer. pub recurring_transfer_id: String, ///Plaid’s unique identifier for a transfer. @@ -17,4 +18,4 @@ impl std::fmt::Display for RecurringNewTransferWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/recurring_transaction_frequency.rs b/src/model/recurring_transaction_frequency.rs new file mode 100644 index 00000000..43c6306c --- /dev/null +++ b/src/model/recurring_transaction_frequency.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +/**Describes the frequency of the transaction stream. + +`WEEKLY`: Assigned to a transaction stream that occurs approximately every week. + +`BIWEEKLY`: Assigned to a transaction stream that occurs approximately every 2 weeks. + +`SEMI_MONTHLY`: Assigned to a transaction stream that occurs approximately twice per month. This frequency is typically seen for inflow transaction streams. + +`MONTHLY`: Assigned to a transaction stream that occurs approximately every month. + +`ANNUALLY`: Assigned to a transaction stream that occurs approximately every year. + +`UNKNOWN`: Assigned to a transaction stream that does not fit any of the pre-defined frequencies.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RecurringTransactionFrequency { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "WEEKLY")] + Weekly, + #[serde(rename = "BIWEEKLY")] + Biweekly, + #[serde(rename = "SEMI_MONTHLY")] + SemiMonthly, + #[serde(rename = "MONTHLY")] + Monthly, + #[serde(rename = "ANNUALLY")] + Annually, +} diff --git a/src/model/recurring_transactions.rs b/src/model/recurring_transactions.rs index b9ca38f0..24c817e6 100644 --- a/src/model/recurring_transactions.rs +++ b/src/model/recurring_transactions.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for RecurringTransactions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/recurring_transactions_update_webhook.rs b/src/model/recurring_transactions_update_webhook.rs index 70b74d7e..f5caa61c 100644 --- a/src/model/recurring_transactions_update_webhook.rs +++ b/src/model/recurring_transactions_update_webhook.rs @@ -1,14 +1,15 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; /**Fired when recurring transactions data is updated. This includes when a new recurring stream is detected or when a new transaction is added to an existing recurring stream. The `RECURRING_TRANSACTIONS_UPDATE` webhook will also fire when one or more attributes of the recurring stream changes, which is usually a result of the addition, update, or removal of transactions to the stream. After receipt of this webhook, the updated data can be fetched from `/transactions/recurring/get`.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RecurringTransactionsUpdateWebhook { ///A list of `account_ids` for accounts that have new or updated recurring transactions data. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub account_ids: Vec, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The `item_id` of the Item associated with this webhook, warning, or error pub item_id: String, ///`RECURRING_TRANSACTIONS_UPDATE` @@ -20,4 +21,4 @@ impl std::fmt::Display for RecurringTransactionsUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/recurring_transfer.rs b/src/model/recurring_transfer.rs index e029947c..71afcdae 100644 --- a/src/model/recurring_transfer.rs +++ b/src/model/recurring_transfer.rs @@ -1,11 +1,17 @@ use serde::{Serialize, Deserialize}; -use super::{TransferRecurringSchedule, TransferUserInResponse}; +use super::{ + AchClass, TransferRecurringNetwork, TransferRecurringSchedule, + TransferRecurringStatus, TransferType, TransferUserInResponse, +}; ///Represents a recurring transfer within the Transfers API. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RecurringTransfer { ///The Plaid `account_id` corresponding to the end-user account that will be debited or credited. pub account_id: String, - /**Specifies the use case of the transfer. Required for transfers on an ACH network. + /**Specifies the use case of the transfer. Required for transfers on an ACH network. For more details, see [ACH SEC codes](https://plaid.com/docs/transfer/creating-transfers/#ach-sec-codes). + +Codes supported for credits: `ccd`, `ppd` +Codes supported for debits: `ccd`, `tel`, `web` `"ccd"` - Corporate Credit or Debit - fund transfer between two corporate bank accounts @@ -15,7 +21,7 @@ pub struct RecurringTransfer { `"web"` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub ach_class: Option, + pub ach_class: Option, ///The amount of the transfer (decimal string with two digits of precision e.g. "10.00"). When calling `/transfer/authorization/create`, specify the maximum amount to authorize. When calling `/transfer/create`, specify the exact amount of the transfer, up to a maximum of the amount authorized. If this field is left blank when calling `/transfer/create`, the maximum amount authorized in the `authorization_id` will be sent. pub amount: String, ///The datetime when this transfer was created. This will be of the form `2006-01-02T15:04:05Z` @@ -26,14 +32,8 @@ pub struct RecurringTransfer { pub funding_account_id: String, ///The currency of the transfer amount, e.g. "USD" pub iso_currency_code: String, - /**The network or rails used for the transfer. - -For transfers submitted as `ach`, the next-day cutoff is 5:30 PM Eastern Time. - -For transfers submitted as `same-day-ach`, the same-day cutoff is 3:30 PM Eastern Time. If the transfer is submitted after this cutoff but before the next-day cutoff, it will be sent over next-day rails and will not incur same-day charges; this will apply to both legs of the transfer if applicable. - -For transfers submitted as `rtp`, Plaid will automatically route between Real Time Payment rail by TCH or FedNow rails as necessary. If a transfer is submitted as `rtp` and the counterparty account is not eligible for RTP, the `/transfer/authorization/create` request will fail with an `INVALID_FIELD` error code. To pre-check to determine whether a counterparty account can support RTP, call `/transfer/capabilities/get` before calling `/transfer/authorization/create`.*/ - pub network: String, + ///Networks eligible for recurring transfers. + pub network: TransferRecurringNetwork, /**A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). The next transfer origination date after bank holiday adjustment.*/ @@ -50,7 +50,7 @@ The next transfer origination date after bank holiday adjustment.*/ `active`: The recurring transfer is currently active. `cancelled`: The recurring transfer was cancelled by the client or Plaid. `expired`: The recurring transfer has completed all originations according to its recurring schedule.*/ - pub status: String, + pub status: TransferRecurringStatus, ///Plaid’s unique identifier for a test clock. #[serde(default, skip_serializing_if = "Option::is_none")] pub test_clock_id: Option, @@ -58,7 +58,7 @@ The next transfer origination date after bank holiday adjustment.*/ pub transfer_ids: Vec, ///The type of transfer. This will be either `debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account. #[serde(rename = "type")] - pub type_: String, + pub type_: TransferType, ///The legal name and other information for the account holder. pub user: TransferUserInResponse, } @@ -66,4 +66,4 @@ impl std::fmt::Display for RecurringTransfer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/recurring_transfer_nullable.rs b/src/model/recurring_transfer_nullable.rs index 8c2d426a..3538abff 100644 --- a/src/model/recurring_transfer_nullable.rs +++ b/src/model/recurring_transfer_nullable.rs @@ -1,9 +1,2 @@ use serde::{Serialize, Deserialize}; -///Represents a recurring transfer within the Transfers API. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct RecurringTransferNullable {} -impl std::fmt::Display for RecurringTransferNullable { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type RecurringTransferNullable = serde_json::Value; diff --git a/src/model/recurring_transfer_skipped_webhook.rs b/src/model/recurring_transfer_skipped_webhook.rs index f0dfa664..4cdfa4d0 100644 --- a/src/model/recurring_transfer_skipped_webhook.rs +++ b/src/model/recurring_transfer_skipped_webhook.rs @@ -1,25 +1,30 @@ use serde::{Serialize, Deserialize}; -use super::TransferAuthorizationDecisionRationaleCode; +use super::{ + TransferAuthorizationDecision, TransferAuthorizationDecisionRationaleCode, + WebhookEnvironmentValues, +}; ///Fired when Plaid is unable to originate a new ACH transaction of the recurring transfer on the planned date. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RecurringTransferSkippedWebhook { /**A decision regarding the proposed transfer. -`approved` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended (i.e., use Link in update to re-authenticate your user when `decision_rationale.code` is `ITEM_LOGIN_REQUIRED`). Refer to the `code` field in the `decision_rationale` object for details. +`approved` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended. Refer to the `code` field in the `decision_rationale` object for details. -`declined` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details.*/ - pub authorization_decision: String, +`declined` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details. + +`user_action_required` – An action is required before Plaid can assess the transfer risk and make a decision. The most common scenario is to update authentication for an Item. To complete the required action, initialize Link by setting `transfer.authorization_id` in the request of `/link/token/create`. After Link flow is completed, you may re-attempt the authorization request.*/ + pub authorization_decision: TransferAuthorizationDecision, /**A code representing the rationale for approving or declining the proposed transfer. If the `rationale_code` is `null`, the transfer passed the authorization check. Any non-`null` value for an `approved` transfer indicates that the the authorization check could not be run and that you should perform your own risk assessment on the transfer. The code will indicate why the check could not be run. Possible values for an `approved` transfer are: -`MANUALLY_VERIFIED_ITEM` – Item created via same-day micro deposits, limited information available. +`MANUALLY_VERIFIED_ITEM` – Item created via a manual entry flow (i.e. Same Day Micro-deposit, Instant Micro-deposit, Database Insights, or Database Match), limited information available. -`ITEM_LOGIN_REQUIRED` – Unable to collect the account information due to Item staleness. Can be resolved by using Link in [update mode](https://www.plaid.com/docs/link/update-mode). +`ITEM_LOGIN_REQUIRED` – Unable to collect the account information due to Item staleness. Can be resolved by using Link and setting [`transfer.authorization_id`](https://plaid.com/docs/api/link/#link-token-create-request-transfer-authorization-id) in the request to `/link/token/create`. -`MIGRATED_ACCOUNT_ITEM` - Item created via `/transfer/account_migration` endpoint, limited information available. +`MIGRATED_ACCOUNT_ITEM` - Item created via `/transfer/migrate_account` endpoint, limited information available. `ERROR` – Unable to collect the account information due to an unspecified error. @@ -29,13 +34,13 @@ The following codes indicate that the authorization decision was `declined`: `RISK` - Transaction is high-risk. -`TRANSFER_LIMIT_REACHED` - One or several transfer limits are reached, e.g. monthly transfer limit.*/ +`TRANSFER_LIMIT_REACHED` - One or several transfer limits are reached, e.g. monthly transfer limit. Check the accompanying `description` field to understand which limit has been reached.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub authorization_decision_rationale_code: Option< TransferAuthorizationDecisionRationaleCode, >, ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///Plaid’s unique identifier for a recurring transfer. pub recurring_transfer_id: String, ///The planned date on which Plaid is unable to originate a new ACH transaction of the recurring transfer. This will be of the form YYYY-MM-DD. @@ -49,4 +54,4 @@ impl std::fmt::Display for RecurringTransferSkippedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/removed_transaction.rs b/src/model/removed_transaction.rs index 3d7009fe..e6f86ab6 100644 --- a/src/model/removed_transaction.rs +++ b/src/model/removed_transaction.rs @@ -2,12 +2,13 @@ use serde::{Serialize, Deserialize}; ///A representation of a removed transaction #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct RemovedTransaction { + ///The ID of the account of the removed transaction. + pub account_id: String, ///The ID of the removed transaction. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub transaction_id: Option, + pub transaction_id: String, } impl std::fmt::Display for RemovedTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/report_type.rs b/src/model/report_type.rs new file mode 100644 index 00000000..a23f9f22 --- /dev/null +++ b/src/model/report_type.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///The report type. It can be `asset`. Income report types are not yet supported. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ReportType { + #[serde(rename = "asset")] + Asset, +} diff --git a/src/model/reporting_information.rs b/src/model/reporting_information.rs index 9c65ffa9..02d47674 100644 --- a/src/model/reporting_information.rs +++ b/src/model/reporting_information.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for ReportingInformation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_check_behavior.rs b/src/model/risk_check_behavior.rs index 569b935b..59364d32 100644 --- a/src/model/risk_check_behavior.rs +++ b/src/model/risk_check_behavior.rs @@ -1,6 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::{ + RiskCheckBehaviorBotDetectedLabel, RiskCheckBehaviorFraudRingDetectedLabel, + RiskCheckBehaviorUserInteractionsLabel, +}; ///Result summary object specifying values for `behavior` attributes of risk check, when available. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RiskCheckBehavior { /**Field describing the outcome of a bot detection behavior risk check. @@ -9,7 +13,7 @@ pub struct RiskCheckBehavior { `no` indicates that automated activity was not detected. `no_data` indicates there was not enough information available to give an accurate signal.*/ - pub bot_detected: String, + pub bot_detected: RiskCheckBehaviorBotDetectedLabel, /**Field describing the outcome of a fraud ring behavior risk check. `yes` indicates that fraud ring activity was detected. @@ -17,7 +21,7 @@ pub struct RiskCheckBehavior { `no` indicates that fraud ring activity was not detected. `no_data` indicates there was not enough information available to give an accurate signal.*/ - pub fraud_ring_detected: String, + pub fraud_ring_detected: RiskCheckBehaviorFraudRingDetectedLabel, /**Field describing the overall user interaction signals of a behavior risk check. This value represents how familiar the user is with the personal data they provide, based on a number of signals that are collected during their session. `genuine` indicates the user has high familiarity with the data they are providing, and that fraud is unlikely. @@ -27,10 +31,10 @@ pub struct RiskCheckBehavior { `risky` indicates the user has low familiarity with the data they are providing, and that fraud is likely. `no_data` indicates there is not sufficient information to give an accurate signal.*/ - pub user_interactions: String, + pub user_interactions: RiskCheckBehaviorUserInteractionsLabel, } impl std::fmt::Display for RiskCheckBehavior { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_check_behavior_bot_detected_label.rs b/src/model/risk_check_behavior_bot_detected_label.rs new file mode 100644 index 00000000..9e56d478 --- /dev/null +++ b/src/model/risk_check_behavior_bot_detected_label.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**Field describing the outcome of a bot detection behavior risk check. + +`yes` indicates that automated activity was detected. + +`no` indicates that automated activity was not detected. + +`no_data` indicates there was not enough information available to give an accurate signal.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskCheckBehaviorBotDetectedLabel { + #[serde(rename = "yes")] + Yes, + #[serde(rename = "no")] + No, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/risk_check_behavior_fraud_ring_detected_label.rs b/src/model/risk_check_behavior_fraud_ring_detected_label.rs new file mode 100644 index 00000000..700b8f60 --- /dev/null +++ b/src/model/risk_check_behavior_fraud_ring_detected_label.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**Field describing the outcome of a fraud ring behavior risk check. + +`yes` indicates that fraud ring activity was detected. + +`no` indicates that fraud ring activity was not detected. + +`no_data` indicates there was not enough information available to give an accurate signal.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskCheckBehaviorFraudRingDetectedLabel { + #[serde(rename = "yes")] + Yes, + #[serde(rename = "no")] + No, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/risk_check_behavior_user_interactions_label.rs b/src/model/risk_check_behavior_user_interactions_label.rs new file mode 100644 index 00000000..494c67e3 --- /dev/null +++ b/src/model/risk_check_behavior_user_interactions_label.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +/**Field describing the overall user interaction signals of a behavior risk check. This value represents how familiar the user is with the personal data they provide, based on a number of signals that are collected during their session. + +`genuine` indicates the user has high familiarity with the data they are providing, and that fraud is unlikely. + +`neutral` indicates some signals are present in between `risky` and `genuine`, but there are not enough clear signals to determine an outcome. + +`risky` indicates the user has low familiarity with the data they are providing, and that fraud is likely. + +`no_data` indicates there is not sufficient information to give an accurate signal.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskCheckBehaviorUserInteractionsLabel { + #[serde(rename = "genuine")] + Genuine, + #[serde(rename = "neutral")] + Neutral, + #[serde(rename = "risky")] + Risky, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/risk_check_details.rs b/src/model/risk_check_details.rs index c1752ef7..bfc3b709 100644 --- a/src/model/risk_check_details.rs +++ b/src/model/risk_check_details.rs @@ -1,10 +1,10 @@ use serde::{Serialize, Deserialize}; use super::{ - RiskCheckBehavior, RiskCheckDevice, RiskCheckEmail, RiskCheckIdentityAbuseSignals, - RiskCheckPhone, + IdentityVerificationStepStatus, RiskCheckBehavior, RiskCheckDevice, RiskCheckEmail, + RiskCheckIdentityAbuseSignals, RiskCheckPhone, }; ///Additional information for the `risk_check` step. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RiskCheckDetails { ///Result summary object specifying values for `behavior` attributes of risk check, when available. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -15,17 +15,17 @@ pub struct RiskCheckDetails { ///Result summary object specifying values for `email` attributes of risk check. #[serde(default, skip_serializing_if = "Option::is_none")] pub email: Option, - ///Result summary object capturing abuse signals related to `identity abuse`, e.g. stolen and synthetic identity fraud. + ///Result summary object capturing abuse signals related to `identity abuse`, e.g. stolen and synthetic identity fraud. These attributes are only available for US identities and some signals may not be available depending on what information was collected. #[serde(default, skip_serializing_if = "Option::is_none")] pub identity_abuse_signals: Option, ///Result summary object specifying values for `phone` attributes of risk check. #[serde(default, skip_serializing_if = "Option::is_none")] pub phone: Option, ///The status of a step in the Identity Verification process. - pub status: String, + pub status: IdentityVerificationStepStatus, } impl std::fmt::Display for RiskCheckDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_check_device.rs b/src/model/risk_check_device.rs index 4d624696..7405284a 100644 --- a/src/model/risk_check_device.rs +++ b/src/model/risk_check_device.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::ProxyType; ///Result summary object specifying values for `device` attributes of risk check. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RiskCheckDevice { /**An enum indicating whether a network proxy is present and if so what type it is. @@ -14,7 +15,7 @@ pub struct RiskCheckDevice { `public_proxy` indicates the user is on a public web proxy server, which is similar to a web proxy but can be shared by multiple users. This may allow multiple users to appear as if they have the same IP address for instance.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub ip_proxy_type: Option, + pub ip_proxy_type: Option, ///Count of spam lists the IP address is associated with if known. #[serde(default, skip_serializing_if = "Option::is_none")] pub ip_spam_list_count: Option, @@ -26,4 +27,4 @@ impl std::fmt::Display for RiskCheckDevice { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_check_email.rs b/src/model/risk_check_email.rs index f3c929bc..02145055 100644 --- a/src/model/risk_check_email.rs +++ b/src/model/risk_check_email.rs @@ -1,16 +1,21 @@ use serde::{Serialize, Deserialize}; +use super::{ + RiskCheckEmailDomainIsCustom, RiskCheckEmailDomainIsDisposable, + RiskCheckEmailDomainIsFreeProvider, RiskCheckEmailIsDeliverableStatus, + RiskCheckEmailTopLevelDomainIsSuspicious, RiskCheckLinkedService, +}; ///Result summary object specifying values for `email` attributes of risk check. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RiskCheckEmail { ///Count of all known breaches of this email address if known. #[serde(default, skip_serializing_if = "Option::is_none")] pub breach_count: Option, ///Indicates whether the email address domain is custom if known, i.e. a company domain and not free or disposable. - pub domain_is_custom: String, + pub domain_is_custom: RiskCheckEmailDomainIsCustom, ///Indicates whether the email domain is listed as disposable if known. Disposable domains are often used to create email addresses that are part of a fake set of user details. - pub domain_is_disposable: String, + pub domain_is_disposable: RiskCheckEmailDomainIsDisposable, ///Indicates whether the email address domain is a free provider such as Gmail or Hotmail if known. - pub domain_is_free_provider: String, + pub domain_is_free_provider: RiskCheckEmailDomainIsFreeProvider, ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub domain_registered_at: Option, @@ -18,18 +23,18 @@ pub struct RiskCheckEmail { #[serde(default, skip_serializing_if = "Option::is_none")] pub first_breached_at: Option, ///SMTP-MX check to confirm the email address exists if known. - pub is_deliverable: String, + pub is_deliverable: RiskCheckEmailIsDeliverableStatus, ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub last_breached_at: Option, ///A list of online services where this email address has been detected to have accounts or other activity. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub linked_services: Vec, + pub linked_services: Vec, ///Indicates whether the email address top level domain, which is the last part of the domain, is fraudulent or risky if known. In most cases, a suspicious top level domain is also associated with a disposable or high-risk domain. - pub top_level_domain_is_suspicious: String, + pub top_level_domain_is_suspicious: RiskCheckEmailTopLevelDomainIsSuspicious, } impl std::fmt::Display for RiskCheckEmail { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_check_email_domain_is_custom.rs b/src/model/risk_check_email_domain_is_custom.rs new file mode 100644 index 00000000..a7fdf325 --- /dev/null +++ b/src/model/risk_check_email_domain_is_custom.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Indicates whether the email address domain is custom if known, i.e. a company domain and not free or disposable. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskCheckEmailDomainIsCustom { + #[serde(rename = "yes")] + Yes, + #[serde(rename = "no")] + No, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/risk_check_email_domain_is_disposable.rs b/src/model/risk_check_email_domain_is_disposable.rs new file mode 100644 index 00000000..21779ad6 --- /dev/null +++ b/src/model/risk_check_email_domain_is_disposable.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Indicates whether the email domain is listed as disposable if known. Disposable domains are often used to create email addresses that are part of a fake set of user details. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskCheckEmailDomainIsDisposable { + #[serde(rename = "yes")] + Yes, + #[serde(rename = "no")] + No, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/risk_check_email_domain_is_free_provider.rs b/src/model/risk_check_email_domain_is_free_provider.rs new file mode 100644 index 00000000..fc239895 --- /dev/null +++ b/src/model/risk_check_email_domain_is_free_provider.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Indicates whether the email address domain is a free provider such as Gmail or Hotmail if known. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskCheckEmailDomainIsFreeProvider { + #[serde(rename = "yes")] + Yes, + #[serde(rename = "no")] + No, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/risk_check_email_is_deliverable_status.rs b/src/model/risk_check_email_is_deliverable_status.rs new file mode 100644 index 00000000..8f349ba3 --- /dev/null +++ b/src/model/risk_check_email_is_deliverable_status.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///SMTP-MX check to confirm the email address exists if known. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskCheckEmailIsDeliverableStatus { + #[serde(rename = "yes")] + Yes, + #[serde(rename = "no")] + No, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/risk_check_email_top_level_domain_is_suspicious.rs b/src/model/risk_check_email_top_level_domain_is_suspicious.rs new file mode 100644 index 00000000..aa3d5a9a --- /dev/null +++ b/src/model/risk_check_email_top_level_domain_is_suspicious.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Indicates whether the email address top level domain, which is the last part of the domain, is fraudulent or risky if known. In most cases, a suspicious top level domain is also associated with a disposable or high-risk domain. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskCheckEmailTopLevelDomainIsSuspicious { + #[serde(rename = "yes")] + Yes, + #[serde(rename = "no")] + No, + #[serde(rename = "no_data")] + NoData, +} diff --git a/src/model/risk_check_identity_abuse_signals.rs b/src/model/risk_check_identity_abuse_signals.rs index 5b36f397..aaceebe8 100644 --- a/src/model/risk_check_identity_abuse_signals.rs +++ b/src/model/risk_check_identity_abuse_signals.rs @@ -1,6 +1,6 @@ use serde::{Serialize, Deserialize}; use super::{RiskCheckStolenIdentity, RiskCheckSyntheticIdentity}; -///Result summary object capturing abuse signals related to `identity abuse`, e.g. stolen and synthetic identity fraud. +///Result summary object capturing abuse signals related to `identity abuse`, e.g. stolen and synthetic identity fraud. These attributes are only available for US identities and some signals may not be available depending on what information was collected. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct RiskCheckIdentityAbuseSignals { /**Field containing the data used in determining the outcome of the stolen identity risk check. @@ -22,4 +22,4 @@ impl std::fmt::Display for RiskCheckIdentityAbuseSignals { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_check_linked_service.rs b/src/model/risk_check_linked_service.rs new file mode 100644 index 00000000..bd50a5db --- /dev/null +++ b/src/model/risk_check_linked_service.rs @@ -0,0 +1,185 @@ +use serde::{Serialize, Deserialize}; +///An enum indicating the type of a linked service. Note that `adult_sites` refers' to explicit video content, and includes a number of related services. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskCheckLinkedService { + #[serde(rename = "aboutme")] + Aboutme, + #[serde(rename = "adobe")] + Adobe, + #[serde(rename = "adult_sites")] + AdultSites, + #[serde(rename = "airbnb")] + Airbnb, + #[serde(rename = "altbalaji")] + Altbalaji, + #[serde(rename = "amazon")] + Amazon, + #[serde(rename = "apple")] + Apple, + #[serde(rename = "archiveorg")] + Archiveorg, + #[serde(rename = "atlassian")] + Atlassian, + #[serde(rename = "bitmoji")] + Bitmoji, + #[serde(rename = "bodybuilding")] + Bodybuilding, + #[serde(rename = "booking")] + Booking, + #[serde(rename = "bukalapak")] + Bukalapak, + #[serde(rename = "codecademy")] + Codecademy, + #[serde(rename = "deliveroo")] + Deliveroo, + #[serde(rename = "diigo")] + Diigo, + #[serde(rename = "discord")] + Discord, + #[serde(rename = "disneyplus")] + Disneyplus, + #[serde(rename = "duolingo")] + Duolingo, + #[serde(rename = "ebay")] + Ebay, + #[serde(rename = "envato")] + Envato, + #[serde(rename = "eventbrite")] + Eventbrite, + #[serde(rename = "evernote")] + Evernote, + #[serde(rename = "facebook")] + Facebook, + #[serde(rename = "firefox")] + Firefox, + #[serde(rename = "flickr")] + Flickr, + #[serde(rename = "flipkart")] + Flipkart, + #[serde(rename = "foursquare")] + Foursquare, + #[serde(rename = "freelancer")] + Freelancer, + #[serde(rename = "gaana")] + Gaana, + #[serde(rename = "giphy")] + Giphy, + #[serde(rename = "github")] + Github, + #[serde(rename = "google")] + Google, + #[serde(rename = "gravatar")] + Gravatar, + #[serde(rename = "hubspot")] + Hubspot, + #[serde(rename = "imgur")] + Imgur, + #[serde(rename = "instagram")] + Instagram, + #[serde(rename = "jdid")] + Jdid, + #[serde(rename = "kakao")] + Kakao, + #[serde(rename = "kommo")] + Kommo, + #[serde(rename = "komoot")] + Komoot, + #[serde(rename = "lastfm")] + Lastfm, + #[serde(rename = "lazada")] + Lazada, + #[serde(rename = "line")] + Line, + #[serde(rename = "linkedin")] + Linkedin, + #[serde(rename = "mailru")] + Mailru, + #[serde(rename = "microsoft")] + Microsoft, + #[serde(rename = "myspace")] + Myspace, + #[serde(rename = "netflix")] + Netflix, + #[serde(rename = "nike")] + Nike, + #[serde(rename = "ok")] + Ok, + #[serde(rename = "patreon")] + Patreon, + #[serde(rename = "pinterest")] + Pinterest, + #[serde(rename = "plurk")] + Plurk, + #[serde(rename = "quora")] + Quora, + #[serde(rename = "qzone")] + Qzone, + #[serde(rename = "rambler")] + Rambler, + #[serde(rename = "rappi")] + Rappi, + #[serde(rename = "replit")] + Replit, + #[serde(rename = "samsung")] + Samsung, + #[serde(rename = "seoclerks")] + Seoclerks, + #[serde(rename = "shopclues")] + Shopclues, + #[serde(rename = "skype")] + Skype, + #[serde(rename = "snapchat")] + Snapchat, + #[serde(rename = "snapdeal")] + Snapdeal, + #[serde(rename = "soundcloud")] + Soundcloud, + #[serde(rename = "spotify")] + Spotify, + #[serde(rename = "starz")] + Starz, + #[serde(rename = "strava")] + Strava, + #[serde(rename = "taringa")] + Taringa, + #[serde(rename = "telegram")] + Telegram, + #[serde(rename = "tiki")] + Tiki, + #[serde(rename = "tokopedia")] + Tokopedia, + #[serde(rename = "treehouse")] + Treehouse, + #[serde(rename = "tumblr")] + Tumblr, + #[serde(rename = "twitter")] + Twitter, + #[serde(rename = "venmo")] + Venmo, + #[serde(rename = "viber")] + Viber, + #[serde(rename = "vimeo")] + Vimeo, + #[serde(rename = "vivino")] + Vivino, + #[serde(rename = "vkontakte")] + Vkontakte, + #[serde(rename = "wattpad")] + Wattpad, + #[serde(rename = "weibo")] + Weibo, + #[serde(rename = "whatsapp")] + Whatsapp, + #[serde(rename = "wordpress")] + Wordpress, + #[serde(rename = "xing")] + Xing, + #[serde(rename = "yahoo")] + Yahoo, + #[serde(rename = "yandex")] + Yandex, + #[serde(rename = "zalo")] + Zalo, + #[serde(rename = "zoho")] + Zoho, +} diff --git a/src/model/risk_check_phone.rs b/src/model/risk_check_phone.rs index 55714fca..5b52762e 100644 --- a/src/model/risk_check_phone.rs +++ b/src/model/risk_check_phone.rs @@ -1,13 +1,14 @@ use serde::{Serialize, Deserialize}; +use super::RiskCheckLinkedService; ///Result summary object specifying values for `phone` attributes of risk check. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct RiskCheckPhone { ///A list of online services where this phone number has been detected to have accounts or other activity. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub linked_services: Vec, + pub linked_services: Vec, } impl std::fmt::Display for RiskCheckPhone { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_check_stolen_identity.rs b/src/model/risk_check_stolen_identity.rs index 905c01df..976a255a 100644 --- a/src/model/risk_check_stolen_identity.rs +++ b/src/model/risk_check_stolen_identity.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for RiskCheckStolenIdentity { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_check_synthetic_identity.rs b/src/model/risk_check_synthetic_identity.rs index 08f423ad..2bc2c971 100644 --- a/src/model/risk_check_synthetic_identity.rs +++ b/src/model/risk_check_synthetic_identity.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for RiskCheckSyntheticIdentity { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_profile.rs b/src/model/risk_profile.rs index 5a98ca82..eaf7cd20 100644 --- a/src/model/risk_profile.rs +++ b/src/model/risk_profile.rs @@ -1,11 +1,11 @@ use serde::{Serialize, Deserialize}; -///Details about the transaction result after evaluated by the requested risk profile. If a `risk_profile_key` is not provided, this field will be omitted. This feature is currently in closed beta; to request access, contact your account manager. +///RiskProfile is deprecated, use `ruleset` instead. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct RiskProfile { - ///The name of the risk profile used for this transaction. + ///The key of the risk profile used for this transaction. #[serde(default, skip_serializing_if = "Option::is_none")] pub key: Option, - ///The name of the evaluated outcome for this transaction. + ///The evaluated outcome for this transaction. You can configure a list of outcomes, such as "accept", "review", and "decline" using the Signal dashboard located within the Plaid Dashboard. #[serde(default, skip_serializing_if = "Option::is_none")] pub outcome: Option, } @@ -13,4 +13,4 @@ impl std::fmt::Display for RiskProfile { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_reason.rs b/src/model/risk_reason.rs new file mode 100644 index 00000000..1a7963ce --- /dev/null +++ b/src/model/risk_reason.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///This object includes a code and description to describe medium risk transactions and above on /accounts/balance/get. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct RiskReason { + /**A code that represents the type of risk associated with the proposed transaction. + +The codes are from PL01 to PL08 and from BK01 to BK07. For a full listing of risk reason codes, see [Risk codes](https://plaid.com/docs/balance/balance-plus/#risk-codes).*/ + pub code: String, + ///A human-readable description explaining the risk code associated with the proposed transaction and some recommended actions. This field is subject to change; any programmatic logic should be based on the `code` field instead. + pub description: String, +} +impl std::fmt::Display for RiskReason { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/risk_signal_document_reference.rs b/src/model/risk_signal_document_reference.rs index d2c84058..062daf70 100644 --- a/src/model/risk_signal_document_reference.rs +++ b/src/model/risk_signal_document_reference.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::{RiskSignalDocumentStatus, RiskSignalDocumentType, RiskSignalFileType}; ///Object containing metadata for the document -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RiskSignalDocumentReference { ///An identifier of the document referenced by the document metadata. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -8,12 +9,18 @@ pub struct RiskSignalDocumentReference { ///The name of the document #[serde(default, skip_serializing_if = "Option::is_none")] pub document_name: Option, + ///Type of a document for risk signal analysis + #[serde(default, skip_serializing_if = "Option::is_none")] + pub document_type: Option, + ///The file type for risk signal analysis + #[serde(default, skip_serializing_if = "Option::is_none")] + pub file_type: Option, ///Status of a document for risk signal analysis #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, + pub status: Option, } impl std::fmt::Display for RiskSignalDocumentReference { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/risk_signal_document_status.rs b/src/model/risk_signal_document_status.rs new file mode 100644 index 00000000..44554b60 --- /dev/null +++ b/src/model/risk_signal_document_status.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///Status of a document for risk signal analysis +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskSignalDocumentStatus { + #[serde(rename = "PROCESSING")] + Processing, + #[serde(rename = "PROCESSING_COMPLETE")] + ProcessingComplete, + #[serde(rename = "PROCESSING_ERROR")] + ProcessingError, + #[serde(rename = "PASSWORD_PROTECTED")] + PasswordProtected, + #[serde(rename = "VIRUS_DETECTED")] + VirusDetected, +} diff --git a/src/model/risk_signal_document_type.rs b/src/model/risk_signal_document_type.rs new file mode 100644 index 00000000..93cae668 --- /dev/null +++ b/src/model/risk_signal_document_type.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +///Type of a document for risk signal analysis +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskSignalDocumentType { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "BANK_STATEMENT")] + BankStatement, + #[serde(rename = "BENEFITS_STATEMENT")] + BenefitsStatement, + #[serde(rename = "BUSINESS_FILING")] + BusinessFiling, + #[serde(rename = "CHECK")] + Check, + #[serde(rename = "DRIVING_LICENSE")] + DrivingLicense, + #[serde(rename = "FINANCIAL_STATEMENT")] + FinancialStatement, + #[serde(rename = "INVOICE")] + Invoice, + #[serde(rename = "PAYSLIP")] + Payslip, + #[serde(rename = "SOCIAL_SECURITY_CARD")] + SocialSecurityCard, + #[serde(rename = "TAX_FORM")] + TaxForm, + #[serde(rename = "UTILITY_BILL")] + UtilityBill, +} diff --git a/src/model/risk_signal_file_type.rs b/src/model/risk_signal_file_type.rs new file mode 100644 index 00000000..cfa9032b --- /dev/null +++ b/src/model/risk_signal_file_type.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +///The file type for risk signal analysis +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum RiskSignalFileType { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "IMAGE_PDF")] + ImagePdf, + #[serde(rename = "SCAN_OCR")] + ScanOcr, + #[serde(rename = "TRUE_PDF")] + TruePdf, + #[serde(rename = "IMAGE")] + Image, + #[serde(rename = "MIXED_PAGE_PDF")] + MixedPagePdf, + #[serde(rename = "EMPTY_PDF")] + EmptyPdf, + #[serde(rename = "FLATTENED_PDF")] + FlattenedPdf, +} diff --git a/src/model/role.rs b/src/model/role.rs index bb87ce3a..f1bad1b6 100644 --- a/src/model/role.rs +++ b/src/model/role.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::RoleDetail; ///ADocumentation not found in the MISMO model viewer and not provided by Freddie Mac. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Role { ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. #[serde(rename = "ROLE_DETAIL")] @@ -11,4 +11,4 @@ impl std::fmt::Display for Role { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/role_detail.rs b/src/model/role_detail.rs index fb83ced8..8f4b8986 100644 --- a/src/model/role_detail.rs +++ b/src/model/role_detail.rs @@ -1,13 +1,14 @@ use serde::{Serialize, Deserialize}; +use super::PartyRoleType; ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct RoleDetail { ///A value from a MISMO defined list that identifies the role that the party plays in the transaction. Parties may be either a person or legal entity. A party may play multiple roles in a transaction.A value from a MISMO defined list that identifies the role that the party plays in the transaction. Parties may be either a person or legal entity. A party may play multiple roles in a transaction. #[serde(rename = "PartyRoleType")] - pub party_role_type: String, + pub party_role_type: PartyRoleType, } impl std::fmt::Display for RoleDetail { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/roles.rs b/src/model/roles.rs index f065341b..a44b0a9f 100644 --- a/src/model/roles.rs +++ b/src/model/roles.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::Role; ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Roles { ///ADocumentation not found in the MISMO model viewer and not provided by Freddie Mac. #[serde(rename = "ROLE")] @@ -11,4 +11,4 @@ impl std::fmt::Display for Roles { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/ruleset.rs b/src/model/ruleset.rs new file mode 100644 index 00000000..4cec76bb --- /dev/null +++ b/src/model/ruleset.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///Details about the transaction result after evaluated by the requested Ruleset. If a `ruleset_key` is not provided, this field will be omitted. This feature is currently in closed beta; to request access, contact your account manager. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct Ruleset { + ///The evaluated outcome for this transaction. You can configure a list of outcomes, such as "accept", "review", and "decline" using the Signal dashboard located within the Plaid Dashboard. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub outcome: Option, + ///The key of the Ruleset used for this transaction. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ruleset_key: Option, +} +impl std::fmt::Display for Ruleset { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/sandbox_bank_income_fire_webhook_response.rs b/src/model/sandbox_bank_income_fire_webhook_response.rs index 8f93a8cd..09b556f8 100644 --- a/src/model/sandbox_bank_income_fire_webhook_response.rs +++ b/src/model/sandbox_bank_income_fire_webhook_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxBankIncomeFireWebhookResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_bank_income_webhook_fire_request_webhook_code.rs b/src/model/sandbox_bank_income_webhook_fire_request_webhook_code.rs new file mode 100644 index 00000000..356870bd --- /dev/null +++ b/src/model/sandbox_bank_income_webhook_fire_request_webhook_code.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The webhook codes this endpoint can be used to test +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SandboxBankIncomeWebhookFireRequestWebhookCode { + #[serde(rename = "BANK_INCOME_REFRESH_UPDATE")] + BankIncomeRefreshUpdate, + #[serde(rename = "BANK_INCOME_REFRESH_COMPLETE")] + BankIncomeRefreshComplete, +} diff --git a/src/model/sandbox_bank_income_webhook_fire_request_webhook_fields.rs b/src/model/sandbox_bank_income_webhook_fire_request_webhook_fields.rs index ed83b74f..998a4baf 100644 --- a/src/model/sandbox_bank_income_webhook_fire_request_webhook_fields.rs +++ b/src/model/sandbox_bank_income_webhook_fire_request_webhook_fields.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::BankIncomeRefreshCompleteResult; ///Optional fields which will be populated in the simulated webhook -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct SandboxBankIncomeWebhookFireRequestWebhookFields { /**The result of the bank income refresh report generation @@ -8,7 +9,7 @@ pub struct SandboxBankIncomeWebhookFireRequestWebhookFields { `FAILURE`: The refreshed report failed to be generated*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub bank_income_refresh_complete_result: Option, + pub bank_income_refresh_complete_result: Option, ///The user id to be returned in INCOME webhooks pub user_id: String, } @@ -16,4 +17,4 @@ impl std::fmt::Display for SandboxBankIncomeWebhookFireRequestWebhookFields { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_bank_transfer_fire_webhook_response.rs b/src/model/sandbox_bank_transfer_fire_webhook_response.rs index fe04c5d7..5e10f843 100644 --- a/src/model/sandbox_bank_transfer_fire_webhook_response.rs +++ b/src/model/sandbox_bank_transfer_fire_webhook_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxBankTransferFireWebhookResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_bank_transfer_simulate_response.rs b/src/model/sandbox_bank_transfer_simulate_response.rs index e5df3103..c77fcd19 100644 --- a/src/model/sandbox_bank_transfer_simulate_response.rs +++ b/src/model/sandbox_bank_transfer_simulate_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxBankTransferSimulateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_income_fire_webhook_response.rs b/src/model/sandbox_income_fire_webhook_response.rs index b62a1099..5a9fa901 100644 --- a/src/model/sandbox_income_fire_webhook_response.rs +++ b/src/model/sandbox_income_fire_webhook_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxIncomeFireWebhookResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_income_webhook_fire_request_webhook_code.rs b/src/model/sandbox_income_webhook_fire_request_webhook_code.rs new file mode 100644 index 00000000..83b47346 --- /dev/null +++ b/src/model/sandbox_income_webhook_fire_request_webhook_code.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The webhook codes that can be fired by this test endpoint. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SandboxIncomeWebhookFireRequestWebhookCode { + #[serde(rename = "INCOME_VERIFICATION")] + IncomeVerification, + #[serde(rename = "INCOME_VERIFICATION_RISK_SIGNALS")] + IncomeVerificationRiskSignals, +} diff --git a/src/model/sandbox_item_fire_webhook_response.rs b/src/model/sandbox_item_fire_webhook_response.rs index 77f47b76..fdcb85e6 100644 --- a/src/model/sandbox_item_fire_webhook_response.rs +++ b/src/model/sandbox_item_fire_webhook_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for SandboxItemFireWebhookResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_item_reset_login_response.rs b/src/model/sandbox_item_reset_login_response.rs index 9c1b64e7..6d163df5 100644 --- a/src/model/sandbox_item_reset_login_response.rs +++ b/src/model/sandbox_item_reset_login_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for SandboxItemResetLoginResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_item_set_verification_status_response.rs b/src/model/sandbox_item_set_verification_status_response.rs index bf4138ac..ab137104 100644 --- a/src/model/sandbox_item_set_verification_status_response.rs +++ b/src/model/sandbox_item_set_verification_status_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxItemSetVerificationStatusResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_oauth_select_accounts_response.rs b/src/model/sandbox_oauth_select_accounts_response.rs index d214c768..ece864ca 100644 --- a/src/model/sandbox_oauth_select_accounts_response.rs +++ b/src/model/sandbox_oauth_select_accounts_response.rs @@ -1,9 +1,2 @@ use serde::{Serialize, Deserialize}; -///Defines the response schema for `/sandbox/oauth/select_accounts` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct SandboxOauthSelectAccountsResponse {} -impl std::fmt::Display for SandboxOauthSelectAccountsResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type SandboxOauthSelectAccountsResponse = serde_json::Value; diff --git a/src/model/sandbox_payment_profile_reset_login_response.rs b/src/model/sandbox_payment_profile_reset_login_response.rs index fcc36ed7..1acd748d 100644 --- a/src/model/sandbox_payment_profile_reset_login_response.rs +++ b/src/model/sandbox_payment_profile_reset_login_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for SandboxPaymentProfileResetLoginResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_processor_token_create_request_options.rs b/src/model/sandbox_processor_token_create_request_options.rs index 21414a11..8d64d611 100644 --- a/src/model/sandbox_processor_token_create_request_options.rs +++ b/src/model/sandbox_processor_token_create_request_options.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for SandboxProcessorTokenCreateRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_processor_token_create_response.rs b/src/model/sandbox_processor_token_create_response.rs index c3682a80..ce662567 100644 --- a/src/model/sandbox_processor_token_create_response.rs +++ b/src/model/sandbox_processor_token_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for SandboxProcessorTokenCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_public_token_create_request_income_verification_bank_income.rs b/src/model/sandbox_public_token_create_request_income_verification_bank_income.rs index b3e85944..02ddffc7 100644 --- a/src/model/sandbox_public_token_create_request_income_verification_bank_income.rs +++ b/src/model/sandbox_public_token_create_request_income_verification_bank_income.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for SandboxPublicTokenCreateRequestIncomeVerificationBank fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_public_token_create_request_options.rs b/src/model/sandbox_public_token_create_request_options.rs index d1a2b098..664f8381 100644 --- a/src/model/sandbox_public_token_create_request_options.rs +++ b/src/model/sandbox_public_token_create_request_options.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{ SandboxPublicTokenCreateRequestOptionsIncomeVerification, + SandboxPublicTokenCreateRequestOptionsStatements, SandboxPublicTokenCreateRequestOptionsTransactions, }; ///An optional set of options to be used when configuring the Item. If specified, must not be `null`. @@ -17,6 +18,9 @@ pub struct SandboxPublicTokenCreateRequestOptions { ///Test username to use for the creation of the Sandbox Item. Default value is `user_good`. #[serde(default, skip_serializing_if = "Option::is_none")] pub override_username: Option, + ///An optional set of parameters corresponding to statements options. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub statements: Option, ///An optional set of parameters corresponding to transactions options. #[serde(default, skip_serializing_if = "Option::is_none")] pub transactions: Option, @@ -28,4 +32,4 @@ impl std::fmt::Display for SandboxPublicTokenCreateRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_public_token_create_request_options_income_verification.rs b/src/model/sandbox_public_token_create_request_options_income_verification.rs index 19497a46..40461f84 100644 --- a/src/model/sandbox_public_token_create_request_options_income_verification.rs +++ b/src/model/sandbox_public_token_create_request_options_income_verification.rs @@ -1,5 +1,8 @@ use serde::{Serialize, Deserialize}; -use super::SandboxPublicTokenCreateRequestIncomeVerificationBankIncome; +use super::{ + IncomeVerificationSourceType, + SandboxPublicTokenCreateRequestIncomeVerificationBankIncome, +}; ///A set of parameters for income verification options. This field is required if `income_verification` is included in the `initial_products` array. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct SandboxPublicTokenCreateRequestOptionsIncomeVerification { @@ -8,10 +11,10 @@ pub struct SandboxPublicTokenCreateRequestOptionsIncomeVerification { pub bank_income: Option, ///The types of source income data that users will be permitted to share. Options include `bank` and `payroll`. Currently you can only specify one of these options. #[serde(default, skip_serializing_if = "Option::is_none")] - pub income_source_types: Option>, + pub income_source_types: Option>, } impl std::fmt::Display for SandboxPublicTokenCreateRequestOptionsIncomeVerification { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_public_token_create_request_options_statements.rs b/src/model/sandbox_public_token_create_request_options_statements.rs new file mode 100644 index 00000000..d9f3cde1 --- /dev/null +++ b/src/model/sandbox_public_token_create_request_options_statements.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///An optional set of parameters corresponding to statements options. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct SandboxPublicTokenCreateRequestOptionsStatements { + ///The most recent date for which to fetch statements history. Dates should be formatted as YYYY-MM-DD. + pub end_date: chrono::NaiveDate, + ///The earliest date for which to fetch statements history. Dates should be formatted as YYYY-MM-DD. + pub start_date: chrono::NaiveDate, +} +impl std::fmt::Display for SandboxPublicTokenCreateRequestOptionsStatements { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/sandbox_public_token_create_request_options_transactions.rs b/src/model/sandbox_public_token_create_request_options_transactions.rs index 5a5216ab..ff30b76b 100644 --- a/src/model/sandbox_public_token_create_request_options_transactions.rs +++ b/src/model/sandbox_public_token_create_request_options_transactions.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for SandboxPublicTokenCreateRequestOptionsTransactions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_public_token_create_response.rs b/src/model/sandbox_public_token_create_response.rs index 9ac45702..3cc0f825 100644 --- a/src/model/sandbox_public_token_create_response.rs +++ b/src/model/sandbox_public_token_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for SandboxPublicTokenCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_fire_webhook_response.rs b/src/model/sandbox_transfer_fire_webhook_response.rs index d6f9c6c6..4647f98b 100644 --- a/src/model/sandbox_transfer_fire_webhook_response.rs +++ b/src/model/sandbox_transfer_fire_webhook_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxTransferFireWebhookResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_ledger_deposit_simulate_response.rs b/src/model/sandbox_transfer_ledger_deposit_simulate_response.rs index dbcd139f..e8bc541d 100644 --- a/src/model/sandbox_transfer_ledger_deposit_simulate_response.rs +++ b/src/model/sandbox_transfer_ledger_deposit_simulate_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxTransferLedgerDepositSimulateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_ledger_simulate_available_response.rs b/src/model/sandbox_transfer_ledger_simulate_available_response.rs index 8dbfc8dd..47085ffc 100644 --- a/src/model/sandbox_transfer_ledger_simulate_available_response.rs +++ b/src/model/sandbox_transfer_ledger_simulate_available_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxTransferLedgerSimulateAvailableResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_ledger_withdraw_simulate_response.rs b/src/model/sandbox_transfer_ledger_withdraw_simulate_response.rs index d63250a7..0104633c 100644 --- a/src/model/sandbox_transfer_ledger_withdraw_simulate_response.rs +++ b/src/model/sandbox_transfer_ledger_withdraw_simulate_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxTransferLedgerWithdrawSimulateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_refund_simulate_response.rs b/src/model/sandbox_transfer_refund_simulate_response.rs index 596b1071..6c67bea5 100644 --- a/src/model/sandbox_transfer_refund_simulate_response.rs +++ b/src/model/sandbox_transfer_refund_simulate_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxTransferRefundSimulateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_repayment_simulate_response.rs b/src/model/sandbox_transfer_repayment_simulate_response.rs index 933fb5f8..e82be4b7 100644 --- a/src/model/sandbox_transfer_repayment_simulate_response.rs +++ b/src/model/sandbox_transfer_repayment_simulate_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxTransferRepaymentSimulateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_simulate_response.rs b/src/model/sandbox_transfer_simulate_response.rs index 6c2f6ab4..a3992ff9 100644 --- a/src/model/sandbox_transfer_simulate_response.rs +++ b/src/model/sandbox_transfer_simulate_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxTransferSimulateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_sweep_simulate_response.rs b/src/model/sandbox_transfer_sweep_simulate_response.rs index 2185a304..0f21c7d5 100644 --- a/src/model/sandbox_transfer_sweep_simulate_response.rs +++ b/src/model/sandbox_transfer_sweep_simulate_response.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for SandboxTransferSweepSimulateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_test_clock_advance_response.rs b/src/model/sandbox_transfer_test_clock_advance_response.rs index 429a88e8..aba34e0b 100644 --- a/src/model/sandbox_transfer_test_clock_advance_response.rs +++ b/src/model/sandbox_transfer_test_clock_advance_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SandboxTransferTestClockAdvanceResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_test_clock_create_response.rs b/src/model/sandbox_transfer_test_clock_create_response.rs index fb8ac5cc..4074b6c7 100644 --- a/src/model/sandbox_transfer_test_clock_create_response.rs +++ b/src/model/sandbox_transfer_test_clock_create_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for SandboxTransferTestClockCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_test_clock_get_response.rs b/src/model/sandbox_transfer_test_clock_get_response.rs index b4435c5d..cb89bea3 100644 --- a/src/model/sandbox_transfer_test_clock_get_response.rs +++ b/src/model/sandbox_transfer_test_clock_get_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for SandboxTransferTestClockGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_transfer_test_clock_list_response.rs b/src/model/sandbox_transfer_test_clock_list_response.rs index 6d7b9260..304374e0 100644 --- a/src/model/sandbox_transfer_test_clock_list_response.rs +++ b/src/model/sandbox_transfer_test_clock_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for SandboxTransferTestClockListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sandbox_user_reset_login_response.rs b/src/model/sandbox_user_reset_login_response.rs new file mode 100644 index 00000000..d80ea88d --- /dev/null +++ b/src/model/sandbox_user_reset_login_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///SandboxUserResetLoginResponse defines the response schema for `/sandbox/user/reset_login` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct SandboxUserResetLoginResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for SandboxUserResetLoginResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/scopes.rs b/src/model/scopes.rs index 538481bb..a90b9e16 100644 --- a/src/model/scopes.rs +++ b/src/model/scopes.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for Scopes { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/scopes_context.rs b/src/model/scopes_context.rs new file mode 100644 index 00000000..df6c3977 --- /dev/null +++ b/src/model/scopes_context.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///An indicator for when scopes are being updated. When scopes are updated via enrollment (i.e. OAuth), the partner must send `ENROLLMENT`. When scopes are updated in a post-enrollment view, the partner must send `PORTAL`. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ScopesContext { + #[serde(rename = "ENROLLMENT")] + Enrollment, + #[serde(rename = "PORTAL")] + Portal, +} diff --git a/src/model/screening_hit_analysis.rs b/src/model/screening_hit_analysis.rs index 5da60479..a2afcb2a 100644 --- a/src/model/screening_hit_analysis.rs +++ b/src/model/screening_hit_analysis.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::MatchSummaryCode; ///Analysis information describing why a screening hit matched the provided user information -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ScreeningHitAnalysis { /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -15,7 +16,7 @@ pub struct ScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub dates_of_birth: Option, + pub dates_of_birth: Option, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -29,7 +30,7 @@ pub struct ScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub documents: Option, + pub documents: Option, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -43,7 +44,7 @@ pub struct ScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub locations: Option, + pub locations: Option, /**An enum indicating the match type between data provided by user and data checked against an external data source. @@ -57,7 +58,7 @@ pub struct ScreeningHitAnalysis { `no_input` indicates that Plaid was unable to perform a check because no information was provided for this field by the end user.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub names: Option, + pub names: Option, ///The version of the screening's `search_terms` that were compared when the screening hit was added. screening hits are immutable once they have been reviewed. If changes are detected due to updates to the screening's `search_terms`, the associated program, or the list's source data prior to review, the screening hit will be updated to reflect those changes. pub search_terms_version: i64, } @@ -65,4 +66,4 @@ impl std::fmt::Display for ScreeningHitAnalysis { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/screening_hit_data.rs b/src/model/screening_hit_data.rs index 890e96b2..37f37d08 100644 --- a/src/model/screening_hit_data.rs +++ b/src/model/screening_hit_data.rs @@ -23,4 +23,4 @@ impl std::fmt::Display for ScreeningHitData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/screening_hit_date_of_birth_item.rs b/src/model/screening_hit_date_of_birth_item.rs index 140d0467..1b41a43d 100644 --- a/src/model/screening_hit_date_of_birth_item.rs +++ b/src/model/screening_hit_date_of_birth_item.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{DateRange, MatchSummary}; ///Analyzed date of birth for the associated hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ScreeningHitDateOfBirthItem { ///Summary object reflecting the match result of the associated data #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for ScreeningHitDateOfBirthItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/screening_hit_documents_items.rs b/src/model/screening_hit_documents_items.rs index 6ad78d25..9a86bc0c 100644 --- a/src/model/screening_hit_documents_items.rs +++ b/src/model/screening_hit_documents_items.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{MatchSummary, WatchlistScreeningDocument}; ///Analyzed document information for the associated hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ScreeningHitDocumentsItems { ///Summary object reflecting the match result of the associated data #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for ScreeningHitDocumentsItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/screening_hit_names_items.rs b/src/model/screening_hit_names_items.rs index ccb50f38..48792541 100644 --- a/src/model/screening_hit_names_items.rs +++ b/src/model/screening_hit_names_items.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{IndividualScreeningHitNames, MatchSummary}; ///Analyzed name information for the associated hit -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ScreeningHitNamesItems { ///Summary object reflecting the match result of the associated data #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +14,4 @@ impl std::fmt::Display for ScreeningHitNamesItems { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/screening_status_updated_webhook.rs b/src/model/screening_status_updated_webhook.rs index 4c0a4273..773753e7 100644 --- a/src/model/screening_status_updated_webhook.rs +++ b/src/model/screening_status_updated_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; ///Fired when an individual screening status has changed, which can occur manually via the dashboard or during ongoing monitoring. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ScreeningStatusUpdatedWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The ID of the associated screening. pub screening_id: String, ///`STATUS_UPDATED` @@ -15,4 +16,4 @@ impl std::fmt::Display for ScreeningStatusUpdatedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/security.rs b/src/model/security.rs index 0c92cc2f..533672bb 100644 --- a/src/model/security.rs +++ b/src/model/security.rs @@ -16,6 +16,11 @@ If the security is a cryptocurrency, this field will be updated multiple times a ///9-character CUSIP, an identifier assigned to North American securities. A verified CUSIP Global Services license is required to receive this data. This field will be null by default for new customers, and null for existing customers starting March 12, 2024. If you would like access to this field, please start the verification process [here](https://docs.google.com/forms/d/e/1FAIpQLSd9asHEYEfmf8fxJTHZTAfAzW4dugsnSu-HS2J51f1mxwd6Sw/viewform). #[serde(default, skip_serializing_if = "Option::is_none")] pub cusip: Option, + /**The industry classification of the security, such as Biotechnology, Airlines, etc. + +For a complete list of possible values, please refer to the ["Sectors and Industries" spreadsheet](https://docs.google.com/spreadsheets/d/1L7aXUdqLhxgM8qe7hK67qqKXiUdQqILpwZ0LpxvCVnc).*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub industry: Option, ///If `institution_security_id` is present, this field indicates the Plaid `institution_id` of the institution to whom the identifier belongs. #[serde(default, skip_serializing_if = "Option::is_none")] pub institution_id: Option, @@ -45,6 +50,11 @@ For the Sandbox environment, this data is currently only available if the item i ///In certain cases, Plaid will provide the ID of another security whose performance resembles this security, typically when the original security has low volume, or when a private security can be modeled with a publicly traded security. #[serde(default, skip_serializing_if = "Option::is_none")] pub proxy_security_id: Option, + /**The sector classification of the security, such as Finance, Health Technology, etc. + +For a complete list of possible values, please refer to the ["Sectors and Industries" spreadsheet](https://docs.google.com/spreadsheets/d/1L7aXUdqLhxgM8qe7hK67qqKXiUdQqILpwZ0LpxvCVnc).*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub sector: Option, ///A unique, Plaid-specific identifier for the security, used to associate securities with holdings. Like all Plaid identifiers, the `security_id` is case sensitive. The `security_id` may change if inherent details of the security change due to a corporate action, for example, in the event of a ticker symbol change or CUSIP change. pub security_id: String, ///7-character SEDOL, an identifier assigned to securities in the UK. @@ -53,7 +63,11 @@ For the Sandbox environment, this data is currently only available if the item i ///The security’s trading symbol for publicly traded securities, and otherwise a short identifier if available. #[serde(default, skip_serializing_if = "Option::is_none")] pub ticker_symbol: Option, - /**The security type of the holding. Valid security types are: + /**The security type of the holding. + +In rare instances, a null value is returned when institutional data is insufficient to determine the security type. + +Valid security types are: `cash`: Cash, currency, and money market funds @@ -88,4 +102,4 @@ impl std::fmt::Display for Security { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/security_override.rs b/src/model/security_override.rs index 869c66a3..bfee4e36 100644 --- a/src/model/security_override.rs +++ b/src/model/security_override.rs @@ -5,10 +5,10 @@ pub struct SecurityOverride { ///Either a valid `iso_currency_code` or `unofficial_currency_code` #[serde(default, skip_serializing_if = "Option::is_none")] pub currency: Option, - ///9-character CUSIP, an identifier assigned to North American securities. A verified CUSIP Global Services license is required to receive this data. This field will be null by default for new customers, and null for existing customers starting March 12, 2024. If you would like access to this field, please start the verification process [here](https://docs.google.com/forms/d/e/1FAIpQLSd9asHEYEfmf8fxJTHZTAfAzW4dugsnSu-HS2J51f1mxwd6Sw/viewform). + ///9-character CUSIP, an identifier assigned to North American securities. A verified CUSIP Global Services license is required to receive this data. This field will be null by default for new customers, and null for existing customers starting March 12, 2024. If you would like access to this field, please [request ISIN/CUSIP access here](https://docs.google.com/forms/d/e/1FAIpQLSd9asHEYEfmf8fxJTHZTAfAzW4dugsnSu-HS2J51f1mxwd6Sw/viewform). #[serde(default, skip_serializing_if = "Option::is_none")] pub cusip: Option, - ///12-character ISIN, a globally unique securities identifier. A verified CUSIP Global Services license is required to receive this data. This field will be null by default for new customers, and null for existing customers starting March 12, 2024. If you would like access to this field, please start the verification process [here](https://docs.google.com/forms/d/e/1FAIpQLSd9asHEYEfmf8fxJTHZTAfAzW4dugsnSu-HS2J51f1mxwd6Sw/viewform). + ///12-character ISIN, a globally unique securities identifier. A verified CUSIP Global Services license is required to receive this data. This field will be null by default for new customers, and null for existing customers starting March 12, 2024. If you would like access to this field, please [request ISIN/CUSIP access here](https://docs.google.com/forms/d/e/1FAIpQLSd9asHEYEfmf8fxJTHZTAfAzW4dugsnSu-HS2J51f1mxwd6Sw/viewform). #[serde(default, skip_serializing_if = "Option::is_none")] pub isin: Option, ///A descriptive name for the security, suitable for display. @@ -25,4 +25,4 @@ impl std::fmt::Display for SecurityOverride { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/selfie_analysis.rs b/src/model/selfie_analysis.rs index 7d563902..41cbe325 100644 --- a/src/model/selfie_analysis.rs +++ b/src/model/selfie_analysis.rs @@ -1,12 +1,21 @@ use serde::{Serialize, Deserialize}; +use super::{ + SelfieAnalysisDocumentComparison, SelfieAnalysisFacialAnalysis, + SelfieAnalysisLivenessCheck, +}; ///High level descriptions of how the associated selfie was processed. If a selfie fails verification, the details in the `analysis` object should help clarify why the selfie was rejected. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct SelfieAnalysis { ///Information about the comparison between the selfie and the document (if documentary verification also ran). - pub document_comparison: String, + pub document_comparison: SelfieAnalysisDocumentComparison, + ///Analysis of the facial features of the selfie when compared to the face in the uploaded document, if one is present. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub facial_analysis: Option, + ///Assessment of whether the selfie capture is of a real human being, as opposed to a picture of a human on a screen, a picture of a paper cut out, someone wearing a mask, or a deepfake. + pub liveness_check: SelfieAnalysisLivenessCheck, } impl std::fmt::Display for SelfieAnalysis { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/selfie_analysis_document_comparison.rs b/src/model/selfie_analysis_document_comparison.rs new file mode 100644 index 00000000..e165b977 --- /dev/null +++ b/src/model/selfie_analysis_document_comparison.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Information about the comparison between the selfie and the document (if documentary verification also ran). +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SelfieAnalysisDocumentComparison { + #[serde(rename = "match")] + Match, + #[serde(rename = "no_match")] + NoMatch, + #[serde(rename = "no_input")] + NoInput, +} diff --git a/src/model/selfie_analysis_facial_analysis.rs b/src/model/selfie_analysis_facial_analysis.rs new file mode 100644 index 00000000..aa16c2dc --- /dev/null +++ b/src/model/selfie_analysis_facial_analysis.rs @@ -0,0 +1,35 @@ +use serde::{Serialize, Deserialize}; +use super::SelfieAnalysisFacialAnalysisOutcome; +///Analysis of the facial features of the selfie when compared to the face in the uploaded document, if one is present. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SelfieAnalysisFacialAnalysis { + ///Outcome of the facial analysis for a specific facial feature. + pub forehead: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub jaw: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub left_brow: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub left_cheek: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub left_eye: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub middle_forehead: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub mouth: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub nose: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub philtrum: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub right_brow: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub right_cheek: SelfieAnalysisFacialAnalysisOutcome, + ///Outcome of the facial analysis for a specific facial feature. + pub right_eye: SelfieAnalysisFacialAnalysisOutcome, +} +impl std::fmt::Display for SelfieAnalysisFacialAnalysis { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/selfie_analysis_facial_analysis_outcome.rs b/src/model/selfie_analysis_facial_analysis_outcome.rs new file mode 100644 index 00000000..31ef4b5a --- /dev/null +++ b/src/model/selfie_analysis_facial_analysis_outcome.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///Outcome of the facial analysis for a specific facial feature. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SelfieAnalysisFacialAnalysisOutcome { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, +} diff --git a/src/model/selfie_analysis_liveness_check.rs b/src/model/selfie_analysis_liveness_check.rs new file mode 100644 index 00000000..6fd720b2 --- /dev/null +++ b/src/model/selfie_analysis_liveness_check.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///Assessment of whether the selfie capture is of a real human being, as opposed to a picture of a human on a screen, a picture of a paper cut out, someone wearing a mask, or a deepfake. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SelfieAnalysisLivenessCheck { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, +} diff --git a/src/model/selfie_capture.rs b/src/model/selfie_capture.rs index 14793721..c626ef01 100644 --- a/src/model/selfie_capture.rs +++ b/src/model/selfie_capture.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for SelfieCapture { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/selfie_check.rs b/src/model/selfie_check.rs index 33cadc98..d3ad1b2b 100644 --- a/src/model/selfie_check.rs +++ b/src/model/selfie_check.rs @@ -1,16 +1,16 @@ use serde::{Serialize, Deserialize}; -use super::SelfieCheckSelfie; +use super::{SelfieCheckSelfie, SelfieCheckStatus}; ///Additional information for the `selfie_check` step. This field will be `null` unless `steps.selfie_check` has reached a terminal state of either `success` or `failed`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct SelfieCheck { ///An array of selfies submitted to the `selfie_check` step. Each entry represents one user submission. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub selfies: Vec, ///The outcome status for the associated Identity Verification attempt's `selfie_check` step. This field will always have the same value as `steps.selfie_check`. - pub status: String, + pub status: SelfieCheckStatus, } impl std::fmt::Display for SelfieCheck { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/selfie_check_selfie.rs b/src/model/selfie_check_selfie.rs index 651fcf2a..f870a06d 100644 --- a/src/model/selfie_check_selfie.rs +++ b/src/model/selfie_check_selfie.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{SelfieAnalysis, SelfieCapture}; +use super::{SelfieAnalysis, SelfieCapture, SelfieStatus}; ///Captures and analysis from a user's selfie. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct SelfieCheckSelfie { ///High level descriptions of how the associated selfie was processed. If a selfie fails verification, the details in the `analysis` object should help clarify why the selfie was rejected. pub analysis: SelfieAnalysis, @@ -10,10 +10,10 @@ pub struct SelfieCheckSelfie { ///The image or video capture of a selfie. Only one of image or video URL will be populated per selfie. pub capture: SelfieCapture, ///An outcome status for this specific selfie. Distinct from the overall `selfie_check.status` that summarizes the verification outcome from one or more selfies. - pub status: String, + pub status: SelfieStatus, } impl std::fmt::Display for SelfieCheckSelfie { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/selfie_check_status.rs b/src/model/selfie_check_status.rs new file mode 100644 index 00000000..99e7449e --- /dev/null +++ b/src/model/selfie_check_status.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The outcome status for the associated Identity Verification attempt's `selfie_check` step. This field will always have the same value as `steps.selfie_check`. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SelfieCheckStatus { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, +} diff --git a/src/model/selfie_status.rs b/src/model/selfie_status.rs new file mode 100644 index 00000000..447827e7 --- /dev/null +++ b/src/model/selfie_status.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///An outcome status for this specific selfie. Distinct from the overall `selfie_check.status` that summarizes the verification outcome from one or more selfies. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SelfieStatus { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, +} diff --git a/src/model/service.rs b/src/model/service.rs index dea9a82c..92f7c950 100644 --- a/src/model/service.rs +++ b/src/model/service.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{Statuses, VerificationOfAsset}; ///A collection of details related to a fulfillment service or product in terms of request, process and result. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Service { ///A collection of STATUS containers. #[serde(rename = "STATUSES")] @@ -14,4 +14,4 @@ impl std::fmt::Display for Service { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/service_product_fulfillment.rs b/src/model/service_product_fulfillment.rs index 3dd2c74e..cada92a1 100644 --- a/src/model/service_product_fulfillment.rs +++ b/src/model/service_product_fulfillment.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::ServiceProductFulfillmentDetail; ///A collection of details related to a fulfillment service or product in terms of request, process and result. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ServiceProductFulfillment { ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. #[serde(rename = "SERVICE_PRODUCT_FULFILLMENT_DETAIL")] @@ -11,4 +11,4 @@ impl std::fmt::Display for ServiceProductFulfillment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/service_product_fulfillment_detail.rs b/src/model/service_product_fulfillment_detail.rs index 074bb944..909e3aa6 100644 --- a/src/model/service_product_fulfillment_detail.rs +++ b/src/model/service_product_fulfillment_detail.rs @@ -1,10 +1,11 @@ use serde::{Serialize, Deserialize}; +use super::ServiceProductFulfillmentIdentifier; ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ServiceProductFulfillmentDetail { ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. #[serde(rename = "ServiceProductFulfillmentIdentifier")] - pub service_product_fulfillment_identifier: String, + pub service_product_fulfillment_identifier: ServiceProductFulfillmentIdentifier, ///A string that uniquely identifies a type of order Verification of Asset. #[serde(rename = "VendorOrderIdentifier")] #[serde(default, skip_serializing_if = "Option::is_none")] @@ -14,4 +15,4 @@ impl std::fmt::Display for ServiceProductFulfillmentDetail { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/service_product_fulfillment_identifier.rs b/src/model/service_product_fulfillment_identifier.rs new file mode 100644 index 00000000..1b4ec344 --- /dev/null +++ b/src/model/service_product_fulfillment_identifier.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum ServiceProductFulfillmentIdentifier { + #[serde(rename = "VOA")] + Voa, + #[serde(rename = "VOE")] + Voe, +} diff --git a/src/model/servicer_address_data.rs b/src/model/servicer_address_data.rs index 15b6b8b5..6c150056 100644 --- a/src/model/servicer_address_data.rs +++ b/src/model/servicer_address_data.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for ServicerAddressData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/services.rs b/src/model/services.rs index ef614c88..bda9086b 100644 --- a/src/model/services.rs +++ b/src/model/services.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::Service; ///A collection of objects that describe requests and responses for services. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Services { ///A collection of details related to a fulfillment service or product in terms of request, process and result. #[serde(rename = "SERVICE")] @@ -11,4 +11,4 @@ impl std::fmt::Display for Services { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_address_data.rs b/src/model/signal_address_data.rs index 835cf34b..2ecf9390 100644 --- a/src/model/signal_address_data.rs +++ b/src/model/signal_address_data.rs @@ -24,4 +24,4 @@ impl std::fmt::Display for SignalAddressData { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_decision_outcome.rs b/src/model/signal_decision_outcome.rs new file mode 100644 index 00000000..6152138a --- /dev/null +++ b/src/model/signal_decision_outcome.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +/**The payment decision from the risk assessment. + +`APPROVE`: approve the transaction without requiring further actions from your customers. For example, use this field if you are placing a standard hold for all the approved transactions before making funds available to your customers. You should also use this field if you decide to accelerate the fund availability for your customers. + +`REVIEW`: the transaction requires manual review + +`REJECT`: reject the transaction + +`TAKE_OTHER_RISK_MEASURES`: for example, placing a longer hold on funds than those approved transactions or introducing customer frictions such as step-up verification/authentication + +`NOT_EVALUATED`: if only logging the Signal results without using them + +Possible values: `APPROVE`, `REVIEW`, `REJECT`, `TAKE_OTHER_RISK_MEASURES`, `NOT_EVALUATED`*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SignalDecisionOutcome { + #[serde(rename = "APPROVE")] + Approve, + #[serde(rename = "REVIEW")] + Review, + #[serde(rename = "REJECT")] + Reject, + #[serde(rename = "TAKE_OTHER_RISK_MEASURES")] + TakeOtherRiskMeasures, + #[serde(rename = "NOT_EVALUATED")] + NotEvaluated, +} diff --git a/src/model/signal_decision_report_response.rs b/src/model/signal_decision_report_response.rs index e330aa11..0bacf71a 100644 --- a/src/model/signal_decision_report_response.rs +++ b/src/model/signal_decision_report_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SignalDecisionReportResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_device.rs b/src/model/signal_device.rs index f0cbdad4..e4ac88fa 100644 --- a/src/model/signal_device.rs +++ b/src/model/signal_device.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -///Details about the end user's device +///Details about the end user's device. When calling `/signal/evaluate` or `/signal/processor/evaluate`, this field is optional, but strongly recommended to increase the accuracy of Signal results. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct SignalDevice { ///The IP address of the device that initiated the transaction @@ -13,4 +13,4 @@ impl std::fmt::Display for SignalDevice { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_evaluate_core_attributes.rs b/src/model/signal_evaluate_core_attributes.rs index 988661fa..03b54bd4 100644 --- a/src/model/signal_evaluate_core_attributes.rs +++ b/src/model/signal_evaluate_core_attributes.rs @@ -43,6 +43,9 @@ pub struct SignalEvaluateCoreAttributes { ///Current balance, as of the `balance_last_updated` time. The current balance is the total amount of funds in the account. #[serde(default, skip_serializing_if = "Option::is_none")] pub current_balance: Option, + ///The number of days since the bank account was opened, as reported by the financial institution + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_since_account_opening: Option, ///The number of days since the first time the Item was connected to an application via Plaid #[serde(default, skip_serializing_if = "Option::is_none")] pub days_since_first_plaid_connection: Option, @@ -66,6 +69,54 @@ pub struct SignalEvaluateCoreAttributes { #[serde(rename = "debit_transactions_count_90d")] #[serde(default, skip_serializing_if = "Option::is_none")] pub debit_transactions_count90_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 30 days (max 100) + #[serde(rename = "distinct_ip_addresses_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count30_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 3 days + #[serde(rename = "distinct_ip_addresses_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count3_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 7 days + #[serde(rename = "distinct_ip_addresses_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count7_d: Option, + ///The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 90 days (max 100) + #[serde(rename = "distinct_ip_addresses_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ip_addresses_count90_d: Option, + ///The number of distinct SSL/TLS connection sessions linked to the same bank account during Plaid authentication in the last 30 days + #[serde(rename = "distinct_ssl_tls_connection_sessions_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ssl_tls_connection_sessions_count30_d: Option, + ///The number of distinct SSL/TLS connection sessions linked to the same bank account during Plaid authentication in the last 3 days + #[serde(rename = "distinct_ssl_tls_connection_sessions_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ssl_tls_connection_sessions_count3_d: Option, + ///The number of distinct SSL/TLS connection sessions linked to the same bank account during Plaid authentication in the last 7 days + #[serde(rename = "distinct_ssl_tls_connection_sessions_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ssl_tls_connection_sessions_count7_d: Option, + ///The number of distinct SSL/TLS connection sessions linked to the same bank account during Plaid authentication in the last 90 days + #[serde(rename = "distinct_ssl_tls_connection_sessions_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_ssl_tls_connection_sessions_count90_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 30 days + #[serde(rename = "distinct_user_agents_count_30d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count30_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 3 days + #[serde(rename = "distinct_user_agents_count_3d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count3_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 7 days + #[serde(rename = "distinct_user_agents_count_7d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count7_d: Option, + ///The number of distinct user agents linked to the same bank account during Plaid authentication in the last 90 days + #[serde(rename = "distinct_user_agents_count_90d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distinct_user_agents_count90_d: Option, ///The number of times the account's email addresses on file have changed over the past 28 days #[serde(rename = "email_change_count_28d")] #[serde(default, skip_serializing_if = "Option::is_none")] @@ -274,4 +325,4 @@ impl std::fmt::Display for SignalEvaluateCoreAttributes { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_evaluate_response.rs b/src/model/signal_evaluate_response.rs index ec03df7b..005fce22 100644 --- a/src/model/signal_evaluate_response.rs +++ b/src/model/signal_evaluate_response.rs @@ -1,6 +1,8 @@ use serde::{Serialize, Deserialize}; -use super::{RiskProfile, SignalEvaluateCoreAttributes, SignalScores, SignalWarning}; -///SignalEvaluateResponse defines the response schema for `/signal/income/evaluate` +use super::{ + RiskProfile, Ruleset, SignalEvaluateCoreAttributes, SignalScores, SignalWarning, +}; +///SignalEvaluateResponse defines the response schema for `/signal/evaluate` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct SignalEvaluateResponse { /**The core attributes object contains additional data that can be used to assess the ACH return risk. Examples of data include: @@ -16,11 +18,15 @@ For the full list and detailed documentation of core attributes available, or to pub core_attributes: Option, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, - ///Details about the transaction result after evaluated by the requested risk profile. If a `risk_profile_key` is not provided, this field will be omitted. This feature is currently in closed beta; to request access, contact your account manager. + ///RiskProfile is deprecated, use `ruleset` instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub risk_profile: Option, + ///Details about the transaction result after evaluated by the requested Ruleset. If a `ruleset_key` is not provided, this field will be omitted. This feature is currently in closed beta; to request access, contact your account manager. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ruleset: Option, ///Risk scoring details broken down by risk category. - pub scores: SignalScores, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub scores: Option, ///If bank information was not available to be used in the Signal model, this array contains warnings describing why bank data is missing. If you want to receive an API error instead of Signal scores in the case of missing bank data, file a support ticket or contact your Plaid account manager. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub warnings: Vec, @@ -29,4 +35,4 @@ impl std::fmt::Display for SignalEvaluateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_payment_method.rs b/src/model/signal_payment_method.rs new file mode 100644 index 00000000..cf8b821d --- /dev/null +++ b/src/model/signal_payment_method.rs @@ -0,0 +1,31 @@ +use serde::{Serialize, Deserialize}; +/**The payment method to complete the transaction after the risk assessment. It may be different from the default payment method. + +`SAME_DAY_ACH`: Same Day ACH by NACHA. The debit transaction is processed and settled on the same day + +`NEXT_DAY_ACH`: Next Day ACH settlement for debit transactions, offered by some payment processors + +`STANDARD_ACH`: standard ACH by NACHA + +`REAL_TIME_PAYMENTS`: real-time payments such as RTP and FedNow + +`DEBIT_CARD`: if the default payment is over debit card networks + +`MULTIPLE_PAYMENT_METHODS`: if there is no default debit rail or there are multiple payment methods + +Possible values: `SAME_DAY_ACH`, `NEXT_DAY_ACH`, `STANDARD_ACH`, `REAL_TIME_PAYMENTS`, `DEBIT_CARD`, `MULTIPLE_PAYMENT_METHODS`*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SignalPaymentMethod { + #[serde(rename = "SAME_DAY_ACH")] + SameDayAch, + #[serde(rename = "NEXT_DAY_ACH")] + NextDayAch, + #[serde(rename = "STANDARD_ACH")] + StandardAch, + #[serde(rename = "REAL_TIME_PAYMENTS")] + RealTimePayments, + #[serde(rename = "DEBIT_CARD")] + DebitCard, + #[serde(rename = "MULTIPLE_PAYMENT_METHODS")] + MultiplePaymentMethods, +} diff --git a/src/model/signal_person_name.rs b/src/model/signal_person_name.rs index c0d761a9..11fdfcce 100644 --- a/src/model/signal_person_name.rs +++ b/src/model/signal_person_name.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for SignalPersonName { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_prepare_response.rs b/src/model/signal_prepare_response.rs index d4be63de..2fe3c4ba 100644 --- a/src/model/signal_prepare_response.rs +++ b/src/model/signal_prepare_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SignalPrepareResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_return_report_response.rs b/src/model/signal_return_report_response.rs index 15d86d5a..b1b21315 100644 --- a/src/model/signal_return_report_response.rs +++ b/src/model/signal_return_report_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for SignalReturnReportResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_scores.rs b/src/model/signal_scores.rs index b3a20cdb..8d226536 100644 --- a/src/model/signal_scores.rs +++ b/src/model/signal_scores.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for SignalScores { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_user.rs b/src/model/signal_user.rs index 3833ce04..4a8319b7 100644 --- a/src/model/signal_user.rs +++ b/src/model/signal_user.rs @@ -1,6 +1,6 @@ use serde::{Serialize, Deserialize}; use super::{SignalAddressData, SignalPersonName}; -///Details about the end user initiating the transaction (i.e., the account holder). +///Details about the end user initiating the transaction (i.e., the account holder). When calling `/signal/evaluate` or `/signal/processor/evaluate`, this field is optional, but strongly recommended to increase the accuracy of Signal results. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct SignalUser { ///Data about the components comprising an address. @@ -20,4 +20,4 @@ impl std::fmt::Display for SignalUser { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/signal_warning.rs b/src/model/signal_warning.rs index dbf44a15..9f8978d6 100644 --- a/src/model/signal_warning.rs +++ b/src/model/signal_warning.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for SignalWarning { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/simulated_transfer_sweep.rs b/src/model/simulated_transfer_sweep.rs index 3db17b2b..12c0b8ef 100644 --- a/src/model/simulated_transfer_sweep.rs +++ b/src/model/simulated_transfer_sweep.rs @@ -1,10 +1,2 @@ use serde::{Serialize, Deserialize}; -/**A sweep returned from the `/sandbox/transfer/sweep/simulate` endpoint. -Can be null if there are no transfers to include in a sweep.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct SimulatedTransferSweep {} -impl std::fmt::Display for SimulatedTransferSweep { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type SimulatedTransferSweep = serde_json::Value; diff --git a/src/model/single_document_risk_signal.rs b/src/model/single_document_risk_signal.rs index 04229eb5..329db824 100644 --- a/src/model/single_document_risk_signal.rs +++ b/src/model/single_document_risk_signal.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{DocumentRiskSignal, DocumentRiskSummary, RiskSignalDocumentReference}; ///Object containing all risk signals and relevant metadata for a single document -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct SingleDocumentRiskSignal { ///Object containing metadata for the document pub document_reference: RiskSignalDocumentReference, @@ -15,4 +15,4 @@ impl std::fmt::Display for SingleDocumentRiskSignal { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sms_verification.rs b/src/model/sms_verification.rs new file mode 100644 index 00000000..1bce5645 --- /dev/null +++ b/src/model/sms_verification.rs @@ -0,0 +1,31 @@ +use serde::{Serialize, Deserialize}; +use super::SmsVerificationStatus; +///Additional information for the individual SMS verification. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SmsVerification { + ///The attempt field begins with 1 and increments with each subsequent SMS verification. + pub attempt: i64, + ///The number of delivery attempts made within the verification to send the SMS code to the user. Each delivery attempt represents the user taking action from the front end UI to request creation and delivery of a new SMS verification code, or to resend an existing SMS verification code. There is a limit of 3 delivery attempts per verification. + pub delivery_attempt_count: i64, + ///An ISO8601 formatted timestamp. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub initially_sent_at: Option>, + ///An ISO8601 formatted timestamp. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_sent_at: Option>, + ///A phone number in E.164 format. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: Option, + ///An ISO8601 formatted timestamp. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub redacted_at: Option>, + ///The number of attempts made by the user within the verification to verify the SMS code by entering it into the front end UI. There is a limit of 3 solve attempts per verification. + pub solve_attempt_count: i64, + ///The outcome status for the individual SMS verification. + pub status: SmsVerificationStatus, +} +impl std::fmt::Display for SmsVerification { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/sms_verification_status.rs b/src/model/sms_verification_status.rs new file mode 100644 index 00000000..2d9f4347 --- /dev/null +++ b/src/model/sms_verification_status.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///The outcome status for the individual SMS verification. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SmsVerificationStatus { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "canceled")] + Canceled, +} diff --git a/src/model/source.rs b/src/model/source.rs new file mode 100644 index 00000000..e78bc718 --- /dev/null +++ b/src/model/source.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///A type indicating whether a dashboard user, an API-based user, or Plaid last touched this object. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum Source { + #[serde(rename = "dashboard")] + Dashboard, + #[serde(rename = "link")] + Link, + #[serde(rename = "api")] + Api, + #[serde(rename = "system")] + System, +} diff --git a/src/model/statements_account.rs b/src/model/statements_account.rs index fc8c5401..8a84e6aa 100644 --- a/src/model/statements_account.rs +++ b/src/model/statements_account.rs @@ -23,4 +23,4 @@ impl std::fmt::Display for StatementsAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/statements_list_response.rs b/src/model/statements_list_response.rs index 3e9c21fb..1b31b4bb 100644 --- a/src/model/statements_list_response.rs +++ b/src/model/statements_list_response.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for StatementsListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/statements_refresh_complete_result.rs b/src/model/statements_refresh_complete_result.rs new file mode 100644 index 00000000..c9128ea1 --- /dev/null +++ b/src/model/statements_refresh_complete_result.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**The result of the statement refresh extraction + +`SUCCESS`: The statements were successfully extracted and can be listed via `/statements/list/` and downloaded via `/statements/download/`. + +`FAILURE`: The statements failed to be extracted.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum StatementsRefreshCompleteResult { + #[serde(rename = "SUCCESS")] + Success, + #[serde(rename = "FAILURE")] + Failure, +} diff --git a/src/model/statements_refresh_complete_webhook.rs b/src/model/statements_refresh_complete_webhook.rs index 954d41ac..413bd03b 100644 --- a/src/model/statements_refresh_complete_webhook.rs +++ b/src/model/statements_refresh_complete_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::{StatementsRefreshCompleteResult, WebhookEnvironmentValues}; ///Fired when refreshed statements extraction is completed or failed to be completed. Triggered by calling `/statements/refresh`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct StatementsRefreshCompleteWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///The Plaid Item ID. The `item_id` is always unique; linking the same account at the same institution twice will result in two Items with different `item_id` values. Like all Plaid identifiers, the `item_id` is case-sensitive. pub item_id: String, /**The result of the statement refresh extraction @@ -11,7 +12,7 @@ pub struct StatementsRefreshCompleteWebhook { `SUCCESS`: The statements were successfully extracted and can be listed via `/statements/list/` and downloaded via `/statements/download/`. `FAILURE`: The statements failed to be extracted.*/ - pub result: String, + pub result: StatementsRefreshCompleteResult, ///`STATEMENTS_REFRESH_COMPLETE` pub webhook_code: String, ///`STATEMENTS` @@ -21,4 +22,4 @@ impl std::fmt::Display for StatementsRefreshCompleteWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/statements_refresh_response.rs b/src/model/statements_refresh_response.rs index 0f1b6cc4..bb8ded63 100644 --- a/src/model/statements_refresh_response.rs +++ b/src/model/statements_refresh_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for StatementsRefreshResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/statements_statement.rs b/src/model/statements_statement.rs index 711eb639..3564c344 100644 --- a/src/model/statements_statement.rs +++ b/src/model/statements_statement.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for StatementsStatement { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/status.rs b/src/model/status.rs index 133dfdf8..ba4c968f 100644 --- a/src/model/status.rs +++ b/src/model/status.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for Status { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/statuses.rs b/src/model/statuses.rs index fd15db6a..326086cc 100644 --- a/src/model/statuses.rs +++ b/src/model/statuses.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for Statuses { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/strategy.rs b/src/model/strategy.rs new file mode 100644 index 00000000..a48ef75c --- /dev/null +++ b/src/model/strategy.rs @@ -0,0 +1,28 @@ +use serde::{Serialize, Deserialize}; +/**An instruction specifying what steps the new Identity Verification attempt should require the user to complete: + + +`reset` - Restart the user at the beginning of the session, regardless of whether they successfully completed part of their previous session. + +`incomplete` - Start the new session at the step that the user failed in the previous session, skipping steps that have already been successfully completed. + +`infer` - If the most recent Identity Verification attempt associated with the given `client_user_id` has a status of `failed` or `expired`, retry using the `incomplete` strategy. Otherwise, use the `reset` strategy. + +`custom` - Start the new session with a custom configuration, specified by the value of the `steps` field + +Note: + +The `incomplete` strategy cannot be applied if the session's failing step is `screening` or `risk_check`. + +The `infer` strategy cannot be applied if the session's status is still `active`*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum Strategy { + #[serde(rename = "reset")] + Reset, + #[serde(rename = "incomplete")] + Incomplete, + #[serde(rename = "infer")] + Infer, + #[serde(rename = "custom")] + Custom, +} diff --git a/src/model/student_loan.rs b/src/model/student_loan.rs index 1f0dcdcb..bfaadb8e 100644 --- a/src/model/student_loan.rs +++ b/src/model/student_loan.rs @@ -3,7 +3,7 @@ use super::{PslfStatus, ServicerAddressData, StudentLoanStatus, StudentRepayment ///Contains details about a student loan account #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct StudentLoan { - ///The ID of the account that this liability belongs to. + ///The ID of the account that this liability belongs to. Each account can only contain one liability. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_id: Option, ///The account number of the loan. For some institutions, this may be a masked version of the number (e.g., the last 4 digits instead of the entire number). @@ -29,6 +29,9 @@ pub struct StudentLoan { ///The date of the last payment. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). #[serde(default, skip_serializing_if = "Option::is_none")] pub last_payment_date: Option, + ///The total amount owed as of the last statement issued + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_statement_balance: Option, ///The date of the last statement. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). #[serde(default, skip_serializing_if = "Option::is_none")] pub last_statement_issue_date: Option, @@ -38,7 +41,7 @@ pub struct StudentLoan { ///An object representing the status of the student loan pub loan_status: StudentLoanStatus, /**The minimum payment due for the next billing cycle. There are some exceptions: -Some institutions require a minimum payment across all loans associated with an account number. Our API presents that same minimum payment amount on each loan. The institutions that do this are: Great Lakes ( `ins_116861`), Firstmark (`ins_116295`), Commonbond Firstmark Services (`ins_116950`), Nelnet (`ins_116528`), EdFinancial Services (`ins_116304`), Granite State (`ins_116308`), and Oklahoma Student Loan Authority (`ins_116945`). +Some institutions require a minimum payment across all loans associated with an account number. Our API presents that same minimum payment amount on each loan. The institutions that do this are: Great Lakes ( `ins_116861`), Firstmark (`ins_116295`), Commonbond Firstmark Services (`ins_116950`), Granite State (`ins_116308`), and Oklahoma Student Loan Authority (`ins_116945`). Firstmark (`ins_116295` ) and Navient (`ins_116248`) will display as $0 if there is an autopay program in effect.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub minimum_payment_amount: Option, @@ -57,7 +60,7 @@ Firstmark (`ins_116295` ) and Navient (`ins_116248`) will display as $0 if there ///The relevant account number that should be used to reference this loan for payments. In the majority of cases, `payment_reference_number` will match `account_number,` but in some institutions, such as Great Lakes (`ins_116861`), it will be different. #[serde(default, skip_serializing_if = "Option::is_none")] pub payment_reference_number: Option, - ///Information about the student's eligibility in the Public Service Loan Forgiveness program. This is only returned if the institution is FedLoan (`ins_116527`). + ///Information about the student's eligibility in the Public Service Loan Forgiveness program. This is only returned if the institution is FedLoan (`ins_116527`). Since FedLoan no longer services student loans, this field is no longer returned. pub pslf_status: PslfStatus, ///An object representing the repayment plan for the student loan pub repayment_plan: StudentRepaymentPlan, @@ -77,4 +80,4 @@ impl std::fmt::Display for StudentLoan { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/student_loan_repayment_model.rs b/src/model/student_loan_repayment_model.rs index 6df219d0..06057c23 100644 --- a/src/model/student_loan_repayment_model.rs +++ b/src/model/student_loan_repayment_model.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for StudentLoanRepaymentModel { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/student_loan_status.rs b/src/model/student_loan_status.rs index 89c88c72..1241abfe 100644 --- a/src/model/student_loan_status.rs +++ b/src/model/student_loan_status.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for StudentLoanStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/student_repayment_plan.rs b/src/model/student_repayment_plan.rs index 0d822d6a..8746251a 100644 --- a/src/model/student_repayment_plan.rs +++ b/src/model/student_repayment_plan.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for StudentRepaymentPlan { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/sweep_status.rs b/src/model/sweep_status.rs index 3d56704b..0734b271 100644 --- a/src/model/sweep_status.rs +++ b/src/model/sweep_status.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct SweepStatus(pub serde_json::Value); \ No newline at end of file +pub struct SweepStatus(pub serde_json::Value); diff --git a/src/model/sweep_trigger.rs b/src/model/sweep_trigger.rs new file mode 100644 index 00000000..a8e0ebe6 --- /dev/null +++ b/src/model/sweep_trigger.rs @@ -0,0 +1,18 @@ +use serde::{Serialize, Deserialize}; +/**The trigger of the sweep + +`"manual"` - The sweep is created manually by the customer +`"incoming"` - The sweep is created by incoming funds flow (e.g. Incoming Wire) +`"balance_threshold"` - The sweep is created by balance threshold setting +`"automatic_aggregate"` - The sweep is created by the Plaid automatic aggregation process. These funds did not pass through the Plaid Ledger balance.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum SweepTrigger { + #[serde(rename = "manual")] + Manual, + #[serde(rename = "incoming")] + Incoming, + #[serde(rename = "balance_threshold")] + BalanceThreshold, + #[serde(rename = "automatic_aggregate")] + AutomaticAggregate, +} diff --git a/src/model/sync_updates_available_webhook.rs b/src/model/sync_updates_available_webhook.rs index d3e2495c..def047a4 100644 --- a/src/model/sync_updates_available_webhook.rs +++ b/src/model/sync_updates_available_webhook.rs @@ -1,4 +1,5 @@ use serde::{Serialize, Deserialize}; +use super::WebhookEnvironmentValues; /**Fired when an Item's transactions change. This can be due to any event resulting in new changes, such as an initial 30-day transactions fetch upon the initialization of an Item with transactions, the backfill of historical transactions that occurs shortly after, or when changes are populated from a regularly-scheduled transactions update job. It is recommended to listen for the `SYNC_UPDATES_AVAILABLE` webhook when using the `/transactions/sync` endpoint. Note that when using `/transactions/sync` the older webhooks `INITIAL_UPDATE`, `HISTORICAL_UPDATE`, `DEFAULT_UPDATE`, and `TRANSACTIONS_REMOVED`, which are intended for use with `/transactions/get`, will also continue to be sent in order to maintain backwards compatibility. It is not necessary to listen for and respond to those webhooks when using `/transactions/sync`. After receipt of this webhook, the new changes can be fetched for the Item from `/transactions/sync`. @@ -6,10 +7,10 @@ After receipt of this webhook, the new changes can be fetched for the Item from Note that to receive this webhook for an Item, `/transactions/sync` must have been called at least once on that Item. This means that, unlike the `INITIAL_UPDATE` and `HISTORICAL_UPDATE` webhooks, it will not fire immediately upon Item creation. If `/transactions/sync` is called on an Item that was *not* initialized with Transactions, the webhook will fire twice: once the first 30 days of transactions data has been fetched, and a second time when all available historical transactions data has been fetched. This webhook will fire in the Sandbox environment as it would in Production. It can also be manually triggered in Sandbox by calling `/sandbox/item/fire_webhook`.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct SyncUpdatesAvailableWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///Indicates if historical pull information (maximum transaction history requested, up to 2 years) is available. pub historical_update_complete: bool, ///Indicates if initial pull information (most recent 30 days of transaction history) is available. @@ -25,4 +26,4 @@ impl std::fmt::Display for SyncUpdatesAvailableWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/taxform.rs b/src/model/taxform.rs index f14fb0b7..aeff0c28 100644 --- a/src/model/taxform.rs +++ b/src/model/taxform.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for Taxform { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/taxpayer_id.rs b/src/model/taxpayer_id.rs index 6e203012..03c56a2d 100644 --- a/src/model/taxpayer_id.rs +++ b/src/model/taxpayer_id.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for TaxpayerId { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/taxpayer_identifier.rs b/src/model/taxpayer_identifier.rs index 8a891863..63695cfd 100644 --- a/src/model/taxpayer_identifier.rs +++ b/src/model/taxpayer_identifier.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::TaxpayerIdentifierType; ///Information about the Taxpayer identification values assigned to the individual or legal entity.Information about the Taxpayer identification values assigned to the individual or legal entity. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TaxpayerIdentifier { ///A value from a MISMO prescribed list that classifies identification numbers used by the Internal Revenue Service (IRS) in the administration of tax laws. A Social Security number (SSN) is issued by the SSA; all other taxpayer identification numbers are issued by the IRS. #[serde(rename = "TaxpayerIdentifierType")] #[serde(default, skip_serializing_if = "Option::is_none")] - pub taxpayer_identifier_type: Option, + pub taxpayer_identifier_type: Option, ///The value of the taxpayer identifier as assigned by the IRS to the individual or legal entity. #[serde(rename = "TaxpayerIdentifierValue")] #[serde(default, skip_serializing_if = "Option::is_none")] @@ -15,4 +16,4 @@ impl std::fmt::Display for TaxpayerIdentifier { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/taxpayer_identifier_type.rs b/src/model/taxpayer_identifier_type.rs new file mode 100644 index 00000000..bda5a0ca --- /dev/null +++ b/src/model/taxpayer_identifier_type.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///A value from a MISMO prescribed list that classifies identification numbers used by the Internal Revenue Service (IRS) in the administration of tax laws. A Social Security number (SSN) is issued by the SSA; all other taxpayer identification numbers are issued by the IRS. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TaxpayerIdentifierType { + IndividualTaxpayerIdentificationNumber, + SocialSecurityNumber, +} diff --git a/src/model/taxpayer_identifiers.rs b/src/model/taxpayer_identifiers.rs index bd13d708..add165c6 100644 --- a/src/model/taxpayer_identifiers.rs +++ b/src/model/taxpayer_identifiers.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TaxpayerIdentifier; ///The collection of TAXPAYER_IDENTIFICATION elements -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TaxpayerIdentifiers { ///Information about the Taxpayer identification values assigned to the individual or legal entity.Information about the Taxpayer identification values assigned to the individual or legal entity. #[serde(rename = "TAXPAYER_IDENTIFIER")] @@ -11,4 +11,4 @@ impl std::fmt::Display for TaxpayerIdentifiers { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/total.rs b/src/model/total.rs index 0583f238..cf751ab9 100644 --- a/src/model/total.rs +++ b/src/model/total.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for Total { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/total_canonical_description.rs b/src/model/total_canonical_description.rs index 80357882..252dee91 100644 --- a/src/model/total_canonical_description.rs +++ b/src/model/total_canonical_description.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct TotalCanonicalDescription(pub serde_json::Value); \ No newline at end of file +pub struct TotalCanonicalDescription(pub serde_json::Value); diff --git a/src/model/total_inflow_amount.rs b/src/model/total_inflow_amount.rs new file mode 100644 index 00000000..66998a64 --- /dev/null +++ b/src/model/total_inflow_amount.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Total amount of debit transactions into the account in the time period of the report. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TotalInflowAmount { + ///Value of amount with up to 2 decimal places. + pub amount: f64, + ///The ISO 4217 currency code of the amount or balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**The unofficial currency code associated with the amount or balance. Always `null` if `iso_currency_code` is non-null. +Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for TotalInflowAmount { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/total_inflow_amount30_d.rs b/src/model/total_inflow_amount30_d.rs new file mode 100644 index 00000000..5fee4e1e --- /dev/null +++ b/src/model/total_inflow_amount30_d.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Total amount of debit transactions into the account in the last 30 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TotalInflowAmount30D { + ///Value of amount with up to 2 decimal places. + pub amount: f64, + ///The ISO 4217 currency code of the amount or balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**The unofficial currency code associated with the amount or balance. Always `null` if `iso_currency_code` is non-null. +Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for TotalInflowAmount30D { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/total_inflow_amount60_d.rs b/src/model/total_inflow_amount60_d.rs new file mode 100644 index 00000000..7c6eebdf --- /dev/null +++ b/src/model/total_inflow_amount60_d.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Total amount of debit transactions into the account in the last 60 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TotalInflowAmount60D { + ///Value of amount with up to 2 decimal places. + pub amount: f64, + ///The ISO 4217 currency code of the amount or balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**The unofficial currency code associated with the amount or balance. Always `null` if `iso_currency_code` is non-null. +Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for TotalInflowAmount60D { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/total_inflow_amount90_d.rs b/src/model/total_inflow_amount90_d.rs new file mode 100644 index 00000000..0021637c --- /dev/null +++ b/src/model/total_inflow_amount90_d.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Total amount of debit transactions into the account in the last 90 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TotalInflowAmount90D { + ///Value of amount with up to 2 decimal places. + pub amount: f64, + ///The ISO 4217 currency code of the amount or balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**The unofficial currency code associated with the amount or balance. Always `null` if `iso_currency_code` is non-null. +Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for TotalInflowAmount90D { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/total_monthly_income_insights.rs b/src/model/total_monthly_income_insights.rs new file mode 100644 index 00000000..c39030e2 --- /dev/null +++ b/src/model/total_monthly_income_insights.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///Details about about the total monthly income +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TotalMonthlyIncomeInsights { + ///The aggregated income for the 30 days prior to subscription date + pub baseline_amount: f64, + ///The aggregated income of the last 30 days + pub current_amount: f64, +} +impl std::fmt::Display for TotalMonthlyIncomeInsights { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/total_outflow_amount.rs b/src/model/total_outflow_amount.rs new file mode 100644 index 00000000..f6f6455c --- /dev/null +++ b/src/model/total_outflow_amount.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Total amount of credit transactions into the account in the time period of the report. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TotalOutflowAmount { + ///Value of amount with up to 2 decimal places. + pub amount: f64, + ///The ISO 4217 currency code of the amount or balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**The unofficial currency code associated with the amount or balance. Always `null` if `iso_currency_code` is non-null. +Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for TotalOutflowAmount { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/total_outflow_amount30_d.rs b/src/model/total_outflow_amount30_d.rs new file mode 100644 index 00000000..49ed30de --- /dev/null +++ b/src/model/total_outflow_amount30_d.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Total amount of credit transactions into the account in the last 30 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TotalOutflowAmount30D { + ///Value of amount with up to 2 decimal places. + pub amount: f64, + ///The ISO 4217 currency code of the amount or balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**The unofficial currency code associated with the amount or balance. Always `null` if `iso_currency_code` is non-null. +Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for TotalOutflowAmount30D { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/total_outflow_amount60_d.rs b/src/model/total_outflow_amount60_d.rs new file mode 100644 index 00000000..5c8cc4e9 --- /dev/null +++ b/src/model/total_outflow_amount60_d.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Total amount of credit transactions into the account in the last 60 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TotalOutflowAmount60D { + ///Value of amount with up to 2 decimal places. + pub amount: f64, + ///The ISO 4217 currency code of the amount or balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**The unofficial currency code associated with the amount or balance. Always `null` if `iso_currency_code` is non-null. +Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for TotalOutflowAmount60D { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/total_outflow_amount90_d.rs b/src/model/total_outflow_amount90_d.rs new file mode 100644 index 00000000..50f2ec80 --- /dev/null +++ b/src/model/total_outflow_amount90_d.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Total amount of credit transactions into the account in the last 90 days. This field will be empty for non-depository accounts. This field only takes into account USD transactions from the account. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TotalOutflowAmount90D { + ///Value of amount with up to 2 decimal places. + pub amount: f64, + ///The ISO 4217 currency code of the amount or balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iso_currency_code: Option, + /**The unofficial currency code associated with the amount or balance. Always `null` if `iso_currency_code` is non-null. +Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unofficial_currency_code: Option, +} +impl std::fmt::Display for TotalOutflowAmount90D { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transaction.rs b/src/model/transaction.rs index 62196437..497ec582 100644 --- a/src/model/transaction.rs +++ b/src/model/transaction.rs @@ -17,14 +17,14 @@ This field is returned for select financial institutions and comes as provided b #[serde(default, skip_serializing_if = "Option::is_none")] pub authorized_datetime: Option>, ///The counterparties present in the transaction. Counterparties, such as the merchant or the financial institution, are extracted by Plaid from the raw description. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub counterparties: Option>, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub counterparties: Vec, /**Date and time when a transaction was posted in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DDTHH:mm:ssZ` ). For the date that the transaction was initiated, rather than posted, see the `authorized_datetime` field. This field is returned for select financial institutions and comes as provided by the institution. It may contain default time values (such as 00:00:00). This field is only populated in API version 2019-05-29 and later.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub datetime: Option>, - ///A unique, stable, Plaid-generated ID that maps to the merchant. + ///A unique, stable, Plaid-generated ID that maps to the merchant. In the case of a merchant with multiple retail locations, this field will map to the broader merchant, not a specific location or store. #[serde(default, skip_serializing_if = "Option::is_none")] pub merchant_entity_id: Option, /**The channel used to make a payment. @@ -89,4 +89,4 @@ impl std::ops::DerefMut for Transaction { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.transaction_base } -} \ No newline at end of file +} diff --git a/src/model/transaction_base.rs b/src/model/transaction_base.rs index db71c0ff..1baccb28 100644 --- a/src/model/transaction_base.rs +++ b/src/model/transaction_base.rs @@ -5,10 +5,10 @@ use super::{Location, PaymentMeta}; pub struct TransactionBase { ///The ID of the account in which this transaction occurred. pub account_id: String, - ///The name of the account owner. This field is not typically populated and only relevant when dealing with sub-accounts. + ///This field is not typically populated and only relevant when dealing with sub-accounts. A sub-account most commonly exists in cases where a single account is linked to multiple cards, each with its own card number and card holder name; each card will be considered a sub-account. If the account does have sub-accounts, this field will typically be some combination of the sub-account owner's name and/or the sub-account mask. The format of this field is not standardized and will vary based on institution. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_owner: Option, - ///The settled value of the transaction, denominated in the transactions's currency, as stated in `iso_currency_code` or `unofficial_currency_code`. Positive values when money moves out of the account; negative values when money moves in. For example, debit card purchases are positive; credit card payments, direct deposits, and refunds are negative. + ///The settled value of the transaction, denominated in the transactions's currency, as stated in `iso_currency_code` or `unofficial_currency_code`. For all products except Income: Positive values when money moves out of the account; negative values when money moves in. For example, debit card purchases are positive; credit card payments, direct deposits, and refunds are negative. For Income endpoints, values are positive when representing income. pub amount: f64, /**A hierarchical array of the categories to which this transaction belongs. For a full list of categories, see [`/categories/get`](https://plaid.com/docs/api/products/transactions/#categoriesget). @@ -43,10 +43,12 @@ If the `transactions` object was returned by an Assets endpoint such as `/asset_ pub merchant_name: Option, /**The merchant name or transaction description. +Note: This is a legacy field that is not actively maintained. Use `merchant_name` instead for the merchant name. + If the `transactions` object was returned by a Transactions endpoint such as `/transactions/sync` or `/transactions/get`, this field will always appear. If the `transactions` object was returned by an Assets endpoint such as `/asset_report/get/` or `/asset_report/pdf/get`, this field will only appear in an Asset Report with Insights.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub name: Option, - ///The string returned by the financial institution to describe the transaction. For transactions returned by `/transactions/sync` or `/transactions/get`, this field is in beta and will be omitted unless the client is both enrolled in the closed beta program and has set `options.include_original_description` to `true`. + ///The string returned by the financial institution to describe the transaction. For transactions returned by `/transactions/sync` or `/transactions/get`, this field will only be included if the client has set `options.include_original_description` to `true`. #[serde(default, skip_serializing_if = "Option::is_none")] pub original_description: Option, /**Transaction information specific to inter-bank transfers. If the transaction was not an inter-bank transfer, all fields will be `null`. @@ -54,9 +56,9 @@ If the `transactions` object was returned by a Transactions endpoint such as `/t If the `transactions` object was returned by a Transactions endpoint such as `/transactions/sync` or `/transactions/get`, the `payment_meta` key will always appear, but no data elements are guaranteed. If the `transactions` object was returned by an Assets endpoint such as `/asset_report/get/` or `/asset_report/pdf/get`, this field will only appear in an Asset Report with Insights.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub payment_meta: Option, - ///When `true`, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. + ///When `true`, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. Not all institutions provide pending transactions. pub pending: bool, - ///The ID of a posted transaction's associated pending transaction, where applicable. + ///The ID of a posted transaction's associated pending transaction, where applicable. Not all institutions provide pending transactions. #[serde(default, skip_serializing_if = "Option::is_none")] pub pending_transaction_id: Option, ///The unique ID of the transaction. Like all Plaid identifiers, the `transaction_id` is case sensitive. @@ -85,4 +87,4 @@ impl std::fmt::Display for TransactionBase { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transaction_code.rs b/src/model/transaction_code.rs index 05bcbe32..8c9a8976 100644 --- a/src/model/transaction_code.rs +++ b/src/model/transaction_code.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct TransactionCode(pub serde_json::Value); \ No newline at end of file +pub struct TransactionCode(pub serde_json::Value); diff --git a/src/model/transaction_counterparty.rs b/src/model/transaction_counterparty.rs index 00e53767..153ec701 100644 --- a/src/model/transaction_counterparty.rs +++ b/src/model/transaction_counterparty.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::CounterpartyType; ///The counterparty, such as the merchant or financial institution, is extracted by Plaid from the raw description. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionCounterparty { /**A description of how confident we are that the provided counterparty is involved in the transaction. @@ -28,7 +29,7 @@ pub struct TransactionCounterparty { `payment_terminal`: a point-of-sale payment terminal (e.g Square, Toast) `income_source`: the payer in an income transaction (e.g., an employer, client, or government agency)*/ #[serde(rename = "type")] - pub type_: String, + pub type_: CounterpartyType, ///The website associated with the counterparty. #[serde(default, skip_serializing_if = "Option::is_none")] pub website: Option, @@ -37,4 +38,4 @@ impl std::fmt::Display for TransactionCounterparty { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transaction_override.rs b/src/model/transaction_override.rs index 9be9a934..bca5241c 100644 --- a/src/model/transaction_override.rs +++ b/src/model/transaction_override.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for TransactionOverride { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transaction_stream.rs b/src/model/transaction_stream.rs index b4043edf..d35be013 100644 --- a/src/model/transaction_stream.rs +++ b/src/model/transaction_stream.rs @@ -1,7 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::{PersonalFinanceCategory, TransactionStreamAmount}; +use super::{ + PersonalFinanceCategory, RecurringTransactionFrequency, TransactionStreamAmount, + TransactionStreamStatus, +}; ///A grouping of related transactions -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionStream { ///The ID of the account to which the stream belongs pub account_id: String, @@ -33,7 +36,7 @@ All implementations are encouraged to use the new `personal_finance_category` in `ANNUALLY`: Assigned to a transaction stream that occurs approximately every year. `UNKNOWN`: Assigned to a transaction stream that does not fit any of the pre-defined frequencies.*/ - pub frequency: String, + pub frequency: RecurringTransactionFrequency, ///Indicates whether the transaction stream is still live. pub is_active: bool, ///This will be set to `true` if the stream has been modified by request to a `/transactions/recurring/streams` endpoint. It will be `false` for all other streams. @@ -53,6 +56,9 @@ All implementations are encouraged to use the new `personal_finance_category` in See the [`taxonomy CSV file`](https://plaid.com/documents/transactions-personal-finance-category-taxonomy.csv) for a full list of personal finance categories. If you are migrating to personal finance categories from the legacy categories, also refer to the [`migration guide`](https://plaid.com/docs/transactions/pfc-migration/).*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub personal_finance_category: Option, + ///The predicted date of the next payment. This will only be set if the next payment date can be predicted. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub predicted_next_date: Option, /**The current status of the transaction stream. `MATURE`: A `MATURE` recurring stream should have at least 3 transactions and happen on a regular cadence (For Annual recurring stream, we will mark it `MATURE` after 2 instances). @@ -62,7 +68,7 @@ See the [`taxonomy CSV file`](https://plaid.com/documents/transactions-personal- `TOMBSTONED`: A stream that was previously in the `EARLY_DETECTION` status will move to the `TOMBSTONED` status when no further transactions were found at the next expected date. `UNKNOWN`: A stream is assigned an `UNKNOWN` status when none of the other statuses are applicable.*/ - pub status: String, + pub status: TransactionStreamStatus, ///A unique id for the stream pub stream_id: String, ///An array of Plaid transaction IDs belonging to the stream, sorted by posted date. @@ -73,4 +79,4 @@ impl std::fmt::Display for TransactionStream { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transaction_stream_amount.rs b/src/model/transaction_stream_amount.rs index ef86906f..6248e3a6 100644 --- a/src/model/transaction_stream_amount.rs +++ b/src/model/transaction_stream_amount.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for TransactionStreamAmount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transaction_stream_status.rs b/src/model/transaction_stream_status.rs new file mode 100644 index 00000000..115a2eef --- /dev/null +++ b/src/model/transaction_stream_status.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +/**The current status of the transaction stream. + +`MATURE`: A `MATURE` recurring stream should have at least 3 transactions and happen on a regular cadence (For Annual recurring stream, we will mark it `MATURE` after 2 instances). + +`EARLY_DETECTION`: When a recurring transaction first appears in the transaction history and before it fulfills the requirement of a mature stream, the status will be `EARLY_DETECTION`. + +`TOMBSTONED`: A stream that was previously in the `EARLY_DETECTION` status will move to the `TOMBSTONED` status when no further transactions were found at the next expected date. + +`UNKNOWN`: A stream is assigned an `UNKNOWN` status when none of the other statuses are applicable.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransactionStreamStatus { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "MATURE")] + Mature, + #[serde(rename = "EARLY_DETECTION")] + EarlyDetection, + #[serde(rename = "TOMBSTONED")] + Tombstoned, +} diff --git a/src/model/transactions_category_rule.rs b/src/model/transactions_category_rule.rs index a1ac7080..487781dd 100644 --- a/src/model/transactions_category_rule.rs +++ b/src/model/transactions_category_rule.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransactionsRuleDetails; ///A representation of a transactions category rule. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionsCategoryRule { ///Date and time when a rule was created in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DDTHH:mm:ssZ` ). #[serde(default, skip_serializing_if = "Option::is_none")] @@ -25,4 +25,4 @@ impl std::fmt::Display for TransactionsCategoryRule { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_enhance_get_response.rs b/src/model/transactions_enhance_get_response.rs index 9f087311..396f040d 100644 --- a/src/model/transactions_enhance_get_response.rs +++ b/src/model/transactions_enhance_get_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for TransactionsEnhanceGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_enrich_request_options.rs b/src/model/transactions_enrich_request_options.rs index f6aa8423..b2d7cc49 100644 --- a/src/model/transactions_enrich_request_options.rs +++ b/src/model/transactions_enrich_request_options.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for TransactionsEnrichRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_enrich_response.rs b/src/model/transactions_enrich_response.rs index cb5c2f6c..0403c671 100644 --- a/src/model/transactions_enrich_response.rs +++ b/src/model/transactions_enrich_response.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for TransactionsEnrichResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_get_request_options.rs b/src/model/transactions_get_request_options.rs index 8b22713a..a64b0f0d 100644 --- a/src/model/transactions_get_request_options.rs +++ b/src/model/transactions_get_request_options.rs @@ -10,17 +10,19 @@ Note: An error will be returned if a provided `account_id` is not associated wit ///The number of transactions to fetch. #[serde(default, skip_serializing_if = "Option::is_none")] pub count: Option, - /**This option only applies to calls for Items that were not initialized with Transactions during Link and are now adding the Transactions product to the Item for the first time. In these cases, this option controls the maximum number of days of transaction history that Plaid will request from the financial institution. For developer accounts created after December 3, 2023, if no value is specified, this will default to 90 days. For developer accounts created on December 3, 2023 or earlier, if no value is specified, this will default to 730 days until June 24, 2024, at which point it will default to 90 days. + /**This field only applies to calls for Items where the Transactions product has not already been initialized (i.e. by specifying `transactions` in the `products`, `optional_products`, or `required_if_consented_products` array when calling `/link/token/create` or by making a previous call to `/transactions/sync` or `/transactions/get`). In those cases, the field controls the maximum number of days of transaction history that Plaid will request from the financial institution. The more transaction history is requested, the longer the historical update poll will take. If no value is specified, 90 days of history will be requested by default. If a value under 30 is provided, a minimum of 30 days of history will be requested. -If Transactions has already been added to the Item prior to this call, this field will have no effect. +If you are initializing your Items with transactions during the `/link/token/create` call (e.g. by including `transactions` in the `/link/token/create` `products` array), you must use the [`transactions.days_requested`](https://plaid.com/docs/api/link/#link-token-create-request-transactions-days-requested) field in the `/link/token/create` request instead of in the `/transactions/get` request. -We strongly recommend that customers utilizing [Recurring Transactions](https://plaid.com/docs/api/products/transactions/#transactionsrecurringget) request at least 180 days of history for optimal results.*/ +If the Item has already been initialized with the Transactions product, this field will have no effect. The maximum amount of transaction history to request on an Item cannot be updated if Transactions has already been added to the Item. To request older transaction history on an Item where Transactions has already been added, you must delete the Item via `/item/remove` and send the user through Link to create a new Item. + +Customers using [Recurring Transactions](https://plaid.com/docs/api/products/transactions/#transactionsrecurringget) should request at least 180 days of history for optimal results.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub days_requested: Option, ///Counterparties and extra merchant fields are now returned by default. #[serde(default, skip_serializing_if = "Option::is_none")] pub include_logo_and_counterparty_beta: Option, - ///Include the raw unparsed transaction description from the financial institution. This field is disabled by default. If you need this information in addition to the parsed data provided, contact your Plaid Account Manager, or submit a [Support request](https://dashboard.plaid.com/support/new/product-and-development/product-troubleshooting/product-functionality). + ///Include the raw unparsed transaction description from the financial institution. #[serde(default, skip_serializing_if = "Option::is_none")] pub include_original_description: Option, ///Personal finance categories are now returned by default. @@ -37,4 +39,4 @@ impl std::fmt::Display for TransactionsGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_get_response.rs b/src/model/transactions_get_response.rs index 825c7122..1e0ef9d4 100644 --- a/src/model/transactions_get_response.rs +++ b/src/model/transactions_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::{AccountBase, Item, Transaction}; ///TransactionsGetResponse defines the response schema for `/transactions/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionsGetResponse { ///An array containing the `accounts` associated with the Item for which transactions are being returned. Each transaction can be mapped to its corresponding account via the `account_id` field. #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -20,4 +20,4 @@ impl std::fmt::Display for TransactionsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_recurring_get_request_options.rs b/src/model/transactions_recurring_get_request_options.rs index b05b2415..1e8b40fc 100644 --- a/src/model/transactions_recurring_get_request_options.rs +++ b/src/model/transactions_recurring_get_request_options.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for TransactionsRecurringGetRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_recurring_get_response.rs b/src/model/transactions_recurring_get_response.rs index 8052717c..b775bd5a 100644 --- a/src/model/transactions_recurring_get_response.rs +++ b/src/model/transactions_recurring_get_response.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for TransactionsRecurringGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_refresh_response.rs b/src/model/transactions_refresh_response.rs index 218fc63d..931a498b 100644 --- a/src/model/transactions_refresh_response.rs +++ b/src/model/transactions_refresh_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for TransactionsRefreshResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_removed_webhook.rs b/src/model/transactions_removed_webhook.rs index 6c564ee2..f8f0e998 100644 --- a/src/model/transactions_removed_webhook.rs +++ b/src/model/transactions_removed_webhook.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; /**Fired when transaction(s) for an Item are deleted. The deleted transaction IDs are included in the webhook payload. Plaid will typically check for deleted transaction data several times a day. This webhook is intended for use with `/transactions/get`; if you are using the newer `/transactions/sync` endpoint, this webhook will still be fired to maintain backwards compatibility, but it is recommended to listen for and respond to the `SYNC_UPDATES_AVAILABLE` webhook instead.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionsRemovedWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -24,4 +24,4 @@ impl std::fmt::Display for TransactionsRemovedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_rule_details.rs b/src/model/transactions_rule_details.rs index cdce4093..c608867c 100644 --- a/src/model/transactions_rule_details.rs +++ b/src/model/transactions_rule_details.rs @@ -1,18 +1,19 @@ use serde::{Serialize, Deserialize}; +use super::{TransactionsRuleField, TransactionsRuleType}; ///A representation of transactions rule details. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionsRuleDetails { ///Transaction field for which the rule is defined. - pub field: String, + pub field: TransactionsRuleField, ///For TRANSACTION_ID field, provide transaction_id. For NAME field, provide a string pattern. pub query: String, /**Transaction rule's match type. For TRANSACTION_ID field, EXACT_MATCH is available. Matches are case sensitive.*/ #[serde(rename = "type")] - pub type_: String, + pub type_: TransactionsRuleType, } impl std::fmt::Display for TransactionsRuleDetails { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_rule_field.rs b/src/model/transactions_rule_field.rs new file mode 100644 index 00000000..a492f917 --- /dev/null +++ b/src/model/transactions_rule_field.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///Transaction field for which the rule is defined. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransactionsRuleField { + #[serde(rename = "TRANSACTION_ID")] + TransactionId, + #[serde(rename = "NAME")] + Name, +} diff --git a/src/model/transactions_rule_type.rs b/src/model/transactions_rule_type.rs new file mode 100644 index 00000000..fa8b378e --- /dev/null +++ b/src/model/transactions_rule_type.rs @@ -0,0 +1,10 @@ +use serde::{Serialize, Deserialize}; +/**Transaction rule's match type. For TRANSACTION_ID field, EXACT_MATCH is available. +Matches are case sensitive.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransactionsRuleType { + #[serde(rename = "EXACT_MATCH")] + ExactMatch, + #[serde(rename = "SUBSTRING_MATCH")] + SubstringMatch, +} diff --git a/src/model/transactions_rules_create_response.rs b/src/model/transactions_rules_create_response.rs index e08bc2ec..a5b132a4 100644 --- a/src/model/transactions_rules_create_response.rs +++ b/src/model/transactions_rules_create_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransactionsCategoryRule; ///TransactionsRulesCreateResponse defines the response schema for `/beta/transactions/rules/v1/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionsRulesCreateResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransactionsRulesCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_rules_list_response.rs b/src/model/transactions_rules_list_response.rs index 309106f1..057717d2 100644 --- a/src/model/transactions_rules_list_response.rs +++ b/src/model/transactions_rules_list_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for TransactionsRulesListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_rules_remove_response.rs b/src/model/transactions_rules_remove_response.rs index 055d1ef0..b5643554 100644 --- a/src/model/transactions_rules_remove_response.rs +++ b/src/model/transactions_rules_remove_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for TransactionsRulesRemoveResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_sync_request_options.rs b/src/model/transactions_sync_request_options.rs index a2304a45..e360b4da 100644 --- a/src/model/transactions_sync_request_options.rs +++ b/src/model/transactions_sync_request_options.rs @@ -2,17 +2,19 @@ use serde::{Serialize, Deserialize}; ///An optional object to be used with the request. If specified, `options` must not be `null`. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct TransactionsSyncRequestOptions { - /**This option only applies to calls for Items that were not initialized with Transactions during Link and are now adding the Transactions product to the Item for the first time. In these cases, this option controls the maximum number of days of transaction history that Plaid will request from the financial institution. For developer accounts created after December 3, 2023, if no value is specified, this will default to 90 days. For developer accounts created on December 3, 2023 or earlier, if no value is specified, this will default to 730 days until June 24, 2024, at which point it will default to 90 days. + /**This field only applies to calls for Items where the Transactions product has not already been initialized (i.e., by specifying `transactions` in the `products`, `required_if_supported_products`, or `optional_products` array when calling `/link/token/create` or by making a previous call to `/transactions/sync` or `/transactions/get`). In those cases, the field controls the maximum number of days of transaction history that Plaid will request from the financial institution. The more transaction history is requested, the longer the historical update poll will take. If no value is specified, 90 days of history will be requested by default. -If Transactions has already been added to the Item prior to this call, this field will have no effect. +If you are initializing your Items with transactions during the `/link/token/create` call (e.g. by including `transactions` in the `/link/token/create` `products` array), you must use the [`transactions.days_requested`](https://plaid.com/docs/api/link/#link-token-create-request-transactions-days-requested) field in the `/link/token/create` request instead of in the `/transactions/sync` request. -We strongly recommend that customers utilizing [Recurring Transactions](https://plaid.com/docs/api/products/transactions/#transactionsrecurringget) request at least 180 days of history for optimal results.*/ +If the Item has already been initialized with the Transactions product, this field will have no effect. The maximum amount of transaction history to request on an Item cannot be updated if Transactions has already been added to the Item. To request older transaction history on an Item where Transactions has already been added, you must delete the Item via `/item/remove` and send the user through Link to create a new Item. + +Customers using [Recurring Transactions](https://plaid.com/docs/api/products/transactions/#transactionsrecurringget) should request at least 180 days of history for optimal results.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub days_requested: Option, ///Counterparties and extra merchant fields are now returned by default. #[serde(default, skip_serializing_if = "Option::is_none")] pub include_logo_and_counterparty_beta: Option, - ///Include the raw unparsed transaction description from the financial institution. This field is disabled by default. If you need this information in addition to the parsed data provided, contact your Plaid Account Manager or submit a [Support request](https://dashboard.plaid.com/support/new/product-and-development/product-troubleshooting/product-functionality). + ///Include the raw unparsed transaction description from the financial institution. #[serde(default, skip_serializing_if = "Option::is_none")] pub include_original_description: Option, ///Personal finance categories are now returned by default. @@ -23,4 +25,4 @@ impl std::fmt::Display for TransactionsSyncRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_sync_response.rs b/src/model/transactions_sync_response.rs index c3ec7333..9a9ee509 100644 --- a/src/model/transactions_sync_response.rs +++ b/src/model/transactions_sync_response.rs @@ -1,8 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::{RemovedTransaction, Transaction}; +use super::{AccountBase, RemovedTransaction, Transaction, TransactionsUpdateStatus}; ///TransactionsSyncResponse defines the response schema for `/transactions/sync` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionsSyncResponse { + ///An array of accounts at a financial institution associated with the transactions in this response. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub accounts: Vec, ///Transactions that have been added to the Item since `cursor` ordered by ascending last modified time. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub added: Vec, @@ -18,9 +21,16 @@ pub struct TransactionsSyncResponse { pub removed: Vec, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, + /**A description of the update status for transaction pulls of an Item. + +`TRANSACTIONS_UPDATE_STATUS_UNKNOWN`: Unable to fetch transactions update status for Item. +`NOT_READY`: The Item is pending transaction pull. +`INITIAL_UPDATE_COMPLETE`: Initial pull for the Item is complete, historical pull is pending. +`HISTORICAL_UPDATE_COMPLETE`: Both initial and historical pull for Item are complete.*/ + pub transactions_update_status: TransactionsUpdateStatus, } impl std::fmt::Display for TransactionsSyncResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transactions_update_status.rs b/src/model/transactions_update_status.rs new file mode 100644 index 00000000..6b888168 --- /dev/null +++ b/src/model/transactions_update_status.rs @@ -0,0 +1,18 @@ +use serde::{Serialize, Deserialize}; +/**A description of the update status for transaction pulls of an Item. + +`TRANSACTIONS_UPDATE_STATUS_UNKNOWN`: Unable to fetch transactions update status for Item. +`NOT_READY`: The Item is pending transaction pull. +`INITIAL_UPDATE_COMPLETE`: Initial pull for the Item is complete, historical pull is pending. +`HISTORICAL_UPDATE_COMPLETE`: Both initial and historical pull for Item are complete.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransactionsUpdateStatus { + #[serde(rename = "TRANSACTIONS_UPDATE_STATUS_UNKNOWN")] + TransactionsUpdateStatusUnknown, + #[serde(rename = "NOT_READY")] + NotReady, + #[serde(rename = "INITIAL_UPDATE_COMPLETE")] + InitialUpdateComplete, + #[serde(rename = "HISTORICAL_UPDATE_COMPLETE")] + HistoricalUpdateComplete, +} diff --git a/src/model/transactions_user_insights_get_response.rs b/src/model/transactions_user_insights_get_response.rs index c8b41357..695ba3c7 100644 --- a/src/model/transactions_user_insights_get_response.rs +++ b/src/model/transactions_user_insights_get_response.rs @@ -21,4 +21,4 @@ impl std::fmt::Display for TransactionsUserInsightsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer.rs b/src/model/transfer.rs index fd8a2b45..0082d92f 100644 --- a/src/model/transfer.rs +++ b/src/model/transfer.rs @@ -1,17 +1,21 @@ use serde::{Serialize, Deserialize}; use super::{ - TransferAuthorizationGuaranteeDecision, + AchClass, TransferAuthorizationGuaranteeDecision, TransferAuthorizationGuaranteeDecisionRationale, TransferCreditFundsSource, TransferExpectedSweepSettlementScheduleItem, TransferFailure, TransferMetadata, - TransferRefund, TransferSweepStatus, TransferUserInResponse, + TransferNetwork, TransferRefund, TransferStatus, TransferSweepStatus, TransferType, + TransferUserInResponse, TransferWireDetails, }; ///Represents a transfer within the Transfers API. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Transfer { ///The Plaid `account_id` corresponding to the end-user account that will be debited or credited. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_id: Option, - /**Specifies the use case of the transfer. Required for transfers on an ACH network. + /**Specifies the use case of the transfer. Required for transfers on an ACH network. For more details, see [ACH SEC codes](https://plaid.com/docs/transfer/creating-transfers/#ach-sec-codes). + +Codes supported for credits: `ccd`, `ppd` +Codes supported for debits: `ccd`, `tel`, `web` `"ccd"` - Corporate Credit or Debit - fund transfer between two corporate bank accounts @@ -21,7 +25,7 @@ pub struct Transfer { `"web"` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub ach_class: Option, + pub ach_class: Option, ///The amount of the transfer (decimal string with two digits of precision e.g. "10.00"). When calling `/transfer/authorization/create`, specify the maximum amount to authorize. When calling `/transfer/create`, specify the exact amount of the transfer, up to a maximum of the amount authorized. If this field is left blank when calling `/transfer/create`, the maximum amount authorized in the `authorization_id` will be sent. pub amount: String, ///Plaid’s unique identifier for a transfer authorization. @@ -33,7 +37,7 @@ pub struct Transfer { pub credit_funds_source: TransferCreditFundsSource, ///The description of the transfer. pub description: String, - ///The expected date when the full amount of the transfer settles at the consumers’ account, if the transfer is credit; or at the customer's business checking account, if the transfer is debit. Only set for ACH transfers and is null for non-ACH transfers. Only set for ACH transfers. This will be of the form YYYY-MM-DD. + ///The date when settlement will occur between Plaid and the receiving bank (RDFI). For ACH debits, this is the date funds will be pulled from the bank account being debited. For ACH credits, this is the date funds will be delivered to the bank account being credited. Only set for ACH transfers; `null` for non-ACH transfers. This will be of the form YYYY-MM-DD. #[serde(default, skip_serializing_if = "Option::is_none")] pub expected_settlement_date: Option, ///The expected sweep settlement schedule of this transfer, assuming this transfer is not `returned`. Only applies to ACH debit transfers. @@ -62,6 +66,9 @@ pub struct Transfer { pub id: String, ///The currency of the transfer amount, e.g. "USD" pub iso_currency_code: String, + ///Plaid’s unique identifier for a Plaid Ledger Balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ledger_id: Option, /**The Metadata object is a mapping of client-provided string fields to any string value. The following limitations apply: The JSON values must be Strings (no nested JSON objects allowed) Only ASCII characters may be used @@ -72,15 +79,19 @@ Maximum value length of 500 characters*/ pub metadata: Option, /**The network or rails used for the transfer. -For transfers submitted as `ach`, the next-day cutoff is 5:30 PM Eastern Time. +For transfers submitted as `ach`, the next-day cutoff is 8:30 PM Eastern Time. For transfers submitted as `same-day-ach`, the same-day cutoff is 3:30 PM Eastern Time. If the transfer is submitted after this cutoff but before the next-day cutoff, it will be sent over next-day rails and will not incur same-day charges; this will apply to both legs of the transfer if applicable. -For transfers submitted as `rtp`, Plaid will automatically route between Real Time Payment rail by TCH or FedNow rails as necessary. If a transfer is submitted as `rtp` and the counterparty account is not eligible for RTP, the `/transfer/authorization/create` request will fail with an `INVALID_FIELD` error code. To pre-check to determine whether a counterparty account can support RTP, call `/transfer/capabilities/get` before calling `/transfer/authorization/create`.*/ - pub network: String, +For transfers submitted as `rtp`, Plaid will automatically route between Real Time Payment rail by TCH or FedNow rails as necessary. If a transfer is submitted as `rtp` and the counterparty account is not eligible for RTP, the `/transfer/authorization/create` request will fail with an `INVALID_FIELD` error code. To pre-check to determine whether a counterparty account can support RTP, call `/transfer/capabilities/get` before calling `/transfer/authorization/create`. + +Wire transfers are currently in early availability. To request access to `wire` as a payment network, contact your Account Manager. For transfers submitted as `wire`, the `type` must be `credit`; wire debits are not supported.*/ + pub network: TransferNetwork, /**The trace identifier for the transfer based on its network. This will only be set after the transfer has posted. -For `ach` or `same-day-ach` transfers, this is the ACH trace number. Currently, the field will remain null for transfers on other rails.*/ +For `ach` or `same-day-ach` transfers, this is the ACH trace number. +For `rtp` transfers, this is the Transaction Identification number. +For `wire` transfers, this is the IMAD (Input Message Accountability Data) number.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub network_trace_id: Option, ///Plaid’s unique identifier for the origination account that was used for this transfer. @@ -102,10 +113,11 @@ For `ach` or `same-day-ach` transfers, this is the ACH trace number. Currently, `pending`: A new transfer was created; it is in the pending state. `posted`: The transfer has been successfully submitted to the payment network. `settled`: Credits are available to be withdrawn or debits have been deducted from the Plaid linked account. +`funds_available`: Funds from the transfer have been released from hold and applied to the ledger's available balance. (Only applicable to ACH debits.) `cancelled`: The transfer was cancelled by the client. `failed`: The transfer failed, no funds were moved. `returned`: A posted transfer was returned.*/ - pub status: String, + pub status: TransferStatus, /**The status of the sweep for the transfer. `unswept`: The transfer hasn't been swept yet. @@ -117,15 +129,18 @@ For `ach` or `same-day-ach` transfers, this is the ACH trace number. Currently, pub sweep_status: Option, ///The type of transfer. This will be either `debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account. #[serde(rename = "type")] - pub type_: String, + pub type_: TransferType, ///The date 61 business days from settlement date indicating the following ACH returns can no longer happen: R05, R07, R10, R11, R51, R33, R37, R38, R51, R52, R53. This will be of the form YYYY-MM-DD. #[serde(default, skip_serializing_if = "Option::is_none")] pub unauthorized_return_window: Option, ///The legal name and other information for the account holder. pub user: TransferUserInResponse, + ///Information specific to wire transfers. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wire_details: Option, } impl std::fmt::Display for Transfer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_ach_network.rs b/src/model/transfer_ach_network.rs new file mode 100644 index 00000000..55810d5b --- /dev/null +++ b/src/model/transfer_ach_network.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +/**The ACH networks used for the funds flow. + +For requests submitted as either `ach` or `same-day-ach` the cutoff for same-day is 3:30 PM Eastern Time and the cutoff for next-day transfers is 8:30 PM Eastern Time. It is recommended to submit a request at least 15 minutes before the cutoff time in order to ensure that it will be processed before the cutoff. Any request that is indicated as `same-day-ach` and that misses the same-day cutoff, but is submitted in time for the next-day cutoff, will be sent over next-day rails and will not incur same-day charges.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferAchNetwork { + #[serde(rename = "ach")] + Ach, + #[serde(rename = "same-day-ach")] + SameDayAch, +} diff --git a/src/model/transfer_authorization.rs b/src/model/transfer_authorization.rs index 584ea7ab..c44eda4f 100644 --- a/src/model/transfer_authorization.rs +++ b/src/model/transfer_authorization.rs @@ -1,20 +1,23 @@ use serde::{Serialize, Deserialize}; use super::{ - TransferAuthorizationDecisionRationale, TransferAuthorizationGuaranteeDecision, + TransferAuthorizationDecision, TransferAuthorizationDecisionRationale, + TransferAuthorizationGuaranteeDecision, TransferAuthorizationGuaranteeDecisionRationale, TransferAuthorizationPaymentRisk, TransferAuthorizationProposedTransfer, }; ///Contains the authorization decision for a proposed transfer. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferAuthorization { ///The datetime representing when the authorization was created, in the format `2006-01-02T15:04:05Z`. pub created: chrono::DateTime, /**A decision regarding the proposed transfer. -`approved` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended (i.e., use Link in update to re-authenticate your user when `decision_rationale.code` is `ITEM_LOGIN_REQUIRED`). Refer to the `code` field in the `decision_rationale` object for details. +`approved` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended. Refer to the `code` field in the `decision_rationale` object for details. -`declined` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details.*/ - pub decision: String, +`declined` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details. + +`user_action_required` – An action is required before Plaid can assess the transfer risk and make a decision. The most common scenario is to update authentication for an Item. To complete the required action, initialize Link by setting `transfer.authorization_id` in the request of `/link/token/create`. After Link flow is completed, you may re-attempt the authorization request.*/ + pub decision: TransferAuthorizationDecision, ///The rationale for Plaid's decision regarding a proposed transfer. It is always set for `declined` decisions, and may or may not be null for `approved` decisions. #[serde(default, skip_serializing_if = "Option::is_none")] pub decision_rationale: Option, @@ -38,4 +41,4 @@ impl std::fmt::Display for TransferAuthorization { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_authorization_cancel_response.rs b/src/model/transfer_authorization_cancel_response.rs new file mode 100644 index 00000000..a60fa053 --- /dev/null +++ b/src/model/transfer_authorization_cancel_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///Defines the response schema for `/transfer/authorization/cancel` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferAuthorizationCancelResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for TransferAuthorizationCancelResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_authorization_create_response.rs b/src/model/transfer_authorization_create_response.rs index 6261b481..2731a9bb 100644 --- a/src/model/transfer_authorization_create_response.rs +++ b/src/model/transfer_authorization_create_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransferAuthorization; ///Defines the response schema for `/transfer/authorization/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferAuthorizationCreateResponse { ///Contains the authorization decision for a proposed transfer. pub authorization: TransferAuthorization, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferAuthorizationCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_authorization_decision.rs b/src/model/transfer_authorization_decision.rs new file mode 100644 index 00000000..48b261d4 --- /dev/null +++ b/src/model/transfer_authorization_decision.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**A decision regarding the proposed transfer. + +`approved` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended. Refer to the `code` field in the `decision_rationale` object for details. + +`declined` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details. + +`user_action_required` – An action is required before Plaid can assess the transfer risk and make a decision. The most common scenario is to update authentication for an Item. To complete the required action, initialize Link by setting `transfer.authorization_id` in the request of `/link/token/create`. After Link flow is completed, you may re-attempt the authorization request.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferAuthorizationDecision { + #[serde(rename = "approved")] + Approved, + #[serde(rename = "declined")] + Declined, + #[serde(rename = "user_action_required")] + UserActionRequired, +} diff --git a/src/model/transfer_authorization_decision_rationale.rs b/src/model/transfer_authorization_decision_rationale.rs index 68e1ac68..96249469 100644 --- a/src/model/transfer_authorization_decision_rationale.rs +++ b/src/model/transfer_authorization_decision_rationale.rs @@ -9,11 +9,11 @@ If the `rationale_code` is `null`, the transfer passed the authorization check. Any non-`null` value for an `approved` transfer indicates that the the authorization check could not be run and that you should perform your own risk assessment on the transfer. The code will indicate why the check could not be run. Possible values for an `approved` transfer are: -`MANUALLY_VERIFIED_ITEM` – Item created via same-day micro deposits, limited information available. +`MANUALLY_VERIFIED_ITEM` – Item created via a manual entry flow (i.e. Same Day Micro-deposit, Instant Micro-deposit, Database Insights, or Database Match), limited information available. -`ITEM_LOGIN_REQUIRED` – Unable to collect the account information due to Item staleness. Can be resolved by using Link in [update mode](https://www.plaid.com/docs/link/update-mode). +`ITEM_LOGIN_REQUIRED` – Unable to collect the account information due to Item staleness. Can be resolved by using Link and setting [`transfer.authorization_id`](https://plaid.com/docs/api/link/#link-token-create-request-transfer-authorization-id) in the request to `/link/token/create`. -`MIGRATED_ACCOUNT_ITEM` - Item created via `/transfer/account_migration` endpoint, limited information available. +`MIGRATED_ACCOUNT_ITEM` - Item created via `/transfer/migrate_account` endpoint, limited information available. `ERROR` – Unable to collect the account information due to an unspecified error. @@ -23,7 +23,7 @@ The following codes indicate that the authorization decision was `declined`: `RISK` - Transaction is high-risk. -`TRANSFER_LIMIT_REACHED` - One or several transfer limits are reached, e.g. monthly transfer limit.*/ +`TRANSFER_LIMIT_REACHED` - One or several transfer limits are reached, e.g. monthly transfer limit. Check the accompanying `description` field to understand which limit has been reached.*/ pub code: TransferAuthorizationDecisionRationaleCode, ///A human-readable description of the code associated with a transfer approval or transfer decline. pub description: String, @@ -32,4 +32,4 @@ impl std::fmt::Display for TransferAuthorizationDecisionRationale { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_authorization_decision_rationale_code.rs b/src/model/transfer_authorization_decision_rationale_code.rs index 9f1a7f6f..202d9e8c 100644 --- a/src/model/transfer_authorization_decision_rationale_code.rs +++ b/src/model/transfer_authorization_decision_rationale_code.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct TransferAuthorizationDecisionRationaleCode(pub serde_json::Value); \ No newline at end of file +pub struct TransferAuthorizationDecisionRationaleCode(pub serde_json::Value); diff --git a/src/model/transfer_authorization_device.rs b/src/model/transfer_authorization_device.rs index ccda2790..357f3367 100644 --- a/src/model/transfer_authorization_device.rs +++ b/src/model/transfer_authorization_device.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for TransferAuthorizationDevice { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_authorization_guarantee_decision.rs b/src/model/transfer_authorization_guarantee_decision.rs index 61d59b6a..a5c677af 100644 --- a/src/model/transfer_authorization_guarantee_decision.rs +++ b/src/model/transfer_authorization_guarantee_decision.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct TransferAuthorizationGuaranteeDecision(pub serde_json::Value); \ No newline at end of file +pub struct TransferAuthorizationGuaranteeDecision(pub serde_json::Value); diff --git a/src/model/transfer_authorization_guarantee_decision_rationale.rs b/src/model/transfer_authorization_guarantee_decision_rationale.rs index 2b51cf14..2a5d5d9c 100644 --- a/src/model/transfer_authorization_guarantee_decision_rationale.rs +++ b/src/model/transfer_authorization_guarantee_decision_rationale.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::TransferAuthorizationGuaranteeDecisionRationaleCode; ///The rationale for Plaid's decision to not guarantee a transfer. Will be `null` unless `guarantee_decision` is `NOT_GUARANTEED`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferAuthorizationGuaranteeDecisionRationale { /**A code representing the reason Plaid declined to guarantee this transfer: @@ -13,7 +14,7 @@ pub struct TransferAuthorizationGuaranteeDecisionRationale { `RISK_ESTIMATE_UNAVAILABLE`: A risk estimate is unavailable for this Item. `REQUIRED_PARAM_MISSING`: Required fields are missing.*/ - pub code: String, + pub code: TransferAuthorizationGuaranteeDecisionRationaleCode, ///A human-readable description of why the transfer cannot be guaranteed. pub description: String, } @@ -21,4 +22,4 @@ impl std::fmt::Display for TransferAuthorizationGuaranteeDecisionRationale { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_authorization_guarantee_decision_rationale_code.rs b/src/model/transfer_authorization_guarantee_decision_rationale_code.rs new file mode 100644 index 00000000..7e0ad569 --- /dev/null +++ b/src/model/transfer_authorization_guarantee_decision_rationale_code.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +/**A code representing the reason Plaid declined to guarantee this transfer: + +`RETURN_BANK`: The risk of a bank-initiated return (for example, an R01/NSF) is too high to guarantee this transfer. + +`RETURN_CUSTOMER`: The risk of a customer-initiated return (for example, a R10/Unauthorized) is too high to guarantee this transfer. + +`GUARANTEE_LIMIT_REACHED`: This transfer is low-risk, but Guarantee has exhausted an internal limit on the number or rate of guarantees that applies to this transfer. + +`RISK_ESTIMATE_UNAVAILABLE`: A risk estimate is unavailable for this Item. + +`REQUIRED_PARAM_MISSING`: Required fields are missing.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferAuthorizationGuaranteeDecisionRationaleCode { + #[serde(rename = "RETURN_BANK")] + ReturnBank, + #[serde(rename = "RETURN_CUSTOMER")] + ReturnCustomer, + #[serde(rename = "GUARANTEE_LIMIT_REACHED")] + GuaranteeLimitReached, + #[serde(rename = "RISK_ESTIMATE_UNAVAILABLE")] + RiskEstimateUnavailable, + #[serde(rename = "REQUIRED_PARAM_MISSING")] + RequiredParamMissing, +} diff --git a/src/model/transfer_authorization_payment_risk.rs b/src/model/transfer_authorization_payment_risk.rs index 434838eb..9ee7d33b 100644 --- a/src/model/transfer_authorization_payment_risk.rs +++ b/src/model/transfer_authorization_payment_risk.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::SignalWarning; +use super::{SignalWarning, TransferAuthorizationRiskLevel}; ///This object includes the scores and risk level. This response is offered as an add-on to /transfer/authorization/create. To request access to these fields please contact your Plaid account manager. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferAuthorizationPaymentRisk { /**A score from 1-99 that indicates the transaction return risk: a higher risk score suggests a higher return likelihood. @@ -17,7 +17,7 @@ These returns typically have a return time frame of up to 60 calendar days. Duri pub customer_initiated_return_score: Option, ///Comprises five risk categories (high risk, medium-high risk, medium risk, medium-low risk, low risk) based on the probability of return #[serde(default, skip_serializing_if = "Option::is_none")] - pub risk_level: Option, + pub risk_level: Option, ///If bank information was not available to be used in the Signal model, this array contains warnings describing why bank data is missing. If you want to receive an API error instead of Signal scores in the case of missing bank data, file a support ticket or contact your Plaid account manager. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub warnings: Vec, @@ -26,4 +26,4 @@ impl std::fmt::Display for TransferAuthorizationPaymentRisk { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_authorization_proposed_transfer.rs b/src/model/transfer_authorization_proposed_transfer.rs index 83c2864a..28797bbf 100644 --- a/src/model/transfer_authorization_proposed_transfer.rs +++ b/src/model/transfer_authorization_proposed_transfer.rs @@ -1,12 +1,18 @@ use serde::{Serialize, Deserialize}; -use super::{TransferCreditFundsSource, TransferUserInResponse}; +use super::{ + AchClass, TransferCreditFundsSource, TransferType, TransferUserInResponse, + TransferWireDetails, +}; ///Details regarding the proposed transfer. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferAuthorizationProposedTransfer { ///The Plaid `account_id` for the account that will be debited or credited. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_id: Option, - /**Specifies the use case of the transfer. Required for transfers on an ACH network. + /**Specifies the use case of the transfer. Required for transfers on an ACH network. For more details, see [ACH SEC codes](https://plaid.com/docs/transfer/creating-transfers/#ach-sec-codes). + +Codes supported for credits: `ccd`, `ppd` +Codes supported for debits: `ccd`, `tel`, `web` `"ccd"` - Corporate Credit or Debit - fund transfer between two corporate bank accounts @@ -16,7 +22,7 @@ pub struct TransferAuthorizationProposedTransfer { `"web"` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub ach_class: Option, + pub ach_class: Option, ///The amount of the transfer (decimal string with two digits of precision e.g. "10.00"). When calling `/transfer/authorization/create`, specify the maximum amount to authorize. When calling `/transfer/create`, specify the exact amount of the transfer, up to a maximum of the amount authorized. If this field is left blank when calling `/transfer/create`, the maximum amount authorized in the `authorization_id` will be sent. pub amount: String, pub credit_funds_source: TransferCreditFundsSource, @@ -25,6 +31,9 @@ pub struct TransferAuthorizationProposedTransfer { pub funding_account_id: Option, ///The currency of the transfer amount. The default value is "USD". pub iso_currency_code: String, + ///Plaid’s unique identifier for a Plaid Ledger Balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ledger_id: Option, ///The network or rails used for the transfer. pub network: String, ///Plaid's unique identifier for the origination account that was used for this transfer. @@ -34,12 +43,15 @@ pub struct TransferAuthorizationProposedTransfer { pub originator_client_id: Option, ///The type of transfer. This will be either `debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account. #[serde(rename = "type")] - pub type_: String, + pub type_: TransferType, ///The legal name and other information for the account holder. pub user: TransferUserInResponse, + ///Information specific to wire transfers. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wire_details: Option, } impl std::fmt::Display for TransferAuthorizationProposedTransfer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_authorization_risk_level.rs b/src/model/transfer_authorization_risk_level.rs new file mode 100644 index 00000000..54503c64 --- /dev/null +++ b/src/model/transfer_authorization_risk_level.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///Comprises five risk categories (high risk, medium-high risk, medium risk, medium-low risk, low risk) based on the probability of return +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferAuthorizationRiskLevel { + #[serde(rename = "HIGH_RISK")] + HighRisk, + #[serde(rename = "MEDIUM_HIGH_RISK")] + MediumHighRisk, + #[serde(rename = "MEDIUM_RISK")] + MediumRisk, + #[serde(rename = "MEDIUM_LOW_RISK")] + MediumLowRisk, + #[serde(rename = "LOW_RISK")] + LowRisk, +} diff --git a/src/model/transfer_authorization_user_in_request.rs b/src/model/transfer_authorization_user_in_request.rs index a1d04c62..fb99a884 100644 --- a/src/model/transfer_authorization_user_in_request.rs +++ b/src/model/transfer_authorization_user_in_request.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for TransferAuthorizationUserInRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_balance.rs b/src/model/transfer_balance.rs index ffab91a1..99934b6a 100644 --- a/src/model/transfer_balance.rs +++ b/src/model/transfer_balance.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::TransferBalanceType; ///Information about the balance held with Plaid. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferBalance { ///The amount of this balance available for use (decimal string with two digits of precision e.g. "10.00"). pub available: String, @@ -12,10 +13,10 @@ pub struct TransferBalance { `prefunded_rtp_credits` - Your prefunded RTP credit balance with Plaid `prefunded_ach_credits` - Your prefunded ACH credit balance with Plaid*/ #[serde(rename = "type")] - pub type_: String, + pub type_: TransferBalanceType, } impl std::fmt::Display for TransferBalance { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_balance_get_response.rs b/src/model/transfer_balance_get_response.rs index 9ef0e0dd..3d22b0b8 100644 --- a/src/model/transfer_balance_get_response.rs +++ b/src/model/transfer_balance_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransferBalance; ///Defines the response schema for `/transfer/balance/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferBalanceGetResponse { ///Information about the balance held with Plaid. pub balance: TransferBalance, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferBalanceGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_balance_type.rs b/src/model/transfer_balance_type.rs new file mode 100644 index 00000000..1f4ece48 --- /dev/null +++ b/src/model/transfer_balance_type.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +/**The type of balance. + +`prefunded_rtp_credits` - Your prefunded RTP credit balance with Plaid +`prefunded_ach_credits` - Your prefunded ACH credit balance with Plaid*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferBalanceType { + #[serde(rename = "prefunded_rtp_credits")] + PrefundedRtpCredits, + #[serde(rename = "prefunded_ach_credits")] + PrefundedAchCredits, +} diff --git a/src/model/transfer_cancel_response.rs b/src/model/transfer_cancel_response.rs index 02f7dbb7..1eb4a305 100644 --- a/src/model/transfer_cancel_response.rs +++ b/src/model/transfer_cancel_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for TransferCancelResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_capabilities_get_response.rs b/src/model/transfer_capabilities_get_response.rs index 8accb471..11d22d2c 100644 --- a/src/model/transfer_capabilities_get_response.rs +++ b/src/model/transfer_capabilities_get_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferCapabilitiesGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_capabilities_get_rtp.rs b/src/model/transfer_capabilities_get_rtp.rs index 267050ac..40c9eabd 100644 --- a/src/model/transfer_capabilities_get_rtp.rs +++ b/src/model/transfer_capabilities_get_rtp.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for TransferCapabilitiesGetRtp { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_configuration_get_response.rs b/src/model/transfer_configuration_get_response.rs index 272a7386..199e98c6 100644 --- a/src/model/transfer_configuration_get_response.rs +++ b/src/model/transfer_configuration_get_response.rs @@ -27,4 +27,4 @@ impl std::fmt::Display for TransferConfigurationGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_create_response.rs b/src/model/transfer_create_response.rs index 36c8de72..344d7ae9 100644 --- a/src/model/transfer_create_response.rs +++ b/src/model/transfer_create_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::Transfer; ///Defines the response schema for `/transfer/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferCreateResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_credit_funds_source.rs b/src/model/transfer_credit_funds_source.rs index dbb280f1..e4d2b8c6 100644 --- a/src/model/transfer_credit_funds_source.rs +++ b/src/model/transfer_credit_funds_source.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct TransferCreditFundsSource(pub serde_json::Value); \ No newline at end of file +pub struct TransferCreditFundsSource(pub serde_json::Value); diff --git a/src/model/transfer_credit_usage_configuration.rs b/src/model/transfer_credit_usage_configuration.rs index 3ac39a97..ef765ba8 100644 --- a/src/model/transfer_credit_usage_configuration.rs +++ b/src/model/transfer_credit_usage_configuration.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::{CreditAchClass, OriginatorExpectedTransferFrequency}; ///Specifies the originator's expected usage of credits. For all dollar amounts, use a decimal string with two digits of precision e.g. "10.00". This field is required if the originator is expected to process credit transfers. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferCreditUsageConfiguration { ///The originator’s expected average amount per credit. pub expected_average_amount: String, ///The originator's expected transfer frequency. - pub expected_frequency: String, + pub expected_frequency: OriginatorExpectedTransferFrequency, ///The originator’s expected highest amount for a single credit transfer. pub expected_highest_amount: String, ///The originator’s monthly expected ACH credit processing amount for the next 6-12 months. @@ -18,10 +19,10 @@ pub struct TransferCreditUsageConfiguration { `"web"` - A credit Entry initiated by or on behalf of a holder of a Consumer Account that is intended for a Consumer Account of a Receiver*/ #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub sec_codes: Vec, + pub sec_codes: Vec, } impl std::fmt::Display for TransferCreditUsageConfiguration { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_debit_usage_configuration.rs b/src/model/transfer_debit_usage_configuration.rs index da049c0c..1b33f447 100644 --- a/src/model/transfer_debit_usage_configuration.rs +++ b/src/model/transfer_debit_usage_configuration.rs @@ -1,11 +1,12 @@ use serde::{Serialize, Deserialize}; +use super::{AchClass, OriginatorExpectedTransferFrequency}; ///Specifies the originator's expected usage of debits. For all dollar amounts, use a decimal string with two digits of precision e.g. "10.00". This field is required if the originator is expected to process debit transfers. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferDebitUsageConfiguration { ///The originator’s expected average amount per debit. pub expected_average_amount: String, ///The originator's expected transfer frequency. - pub expected_frequency: String, + pub expected_frequency: OriginatorExpectedTransferFrequency, ///The originator’s expected highest amount for a single debit transfer. pub expected_highest_amount: String, ///The originator’s monthly expected ACH debit processing amount for the next 6-12 months. @@ -20,10 +21,10 @@ pub struct TransferDebitUsageConfiguration { `"web"` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet*/ #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub sec_codes: Vec, + pub sec_codes: Vec, } impl std::fmt::Display for TransferDebitUsageConfiguration { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_device.rs b/src/model/transfer_device.rs index ebd1b4c6..fcb502a8 100644 --- a/src/model/transfer_device.rs +++ b/src/model/transfer_device.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for TransferDevice { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_diligence_document_upload_response.rs b/src/model/transfer_diligence_document_upload_response.rs index cd527acf..d4d5b300 100644 --- a/src/model/transfer_diligence_document_upload_response.rs +++ b/src/model/transfer_diligence_document_upload_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for TransferDiligenceDocumentUploadResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_diligence_status.rs b/src/model/transfer_diligence_status.rs new file mode 100644 index 00000000..1cef027f --- /dev/null +++ b/src/model/transfer_diligence_status.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +///Originator’s diligence status. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferDiligenceStatus { + #[serde(rename = "not_submitted")] + NotSubmitted, + #[serde(rename = "submitted")] + Submitted, + #[serde(rename = "under_review")] + UnderReview, + #[serde(rename = "approved")] + Approved, + #[serde(rename = "denied")] + Denied, + #[serde(rename = "more_information_required")] + MoreInformationRequired, +} diff --git a/src/model/transfer_diligence_submit_response.rs b/src/model/transfer_diligence_submit_response.rs index 906197db..271a444e 100644 --- a/src/model/transfer_diligence_submit_response.rs +++ b/src/model/transfer_diligence_submit_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for TransferDiligenceSubmitResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_document_purpose.rs b/src/model/transfer_document_purpose.rs new file mode 100644 index 00000000..99aa3d05 --- /dev/null +++ b/src/model/transfer_document_purpose.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +/**Specifies the purpose of the uploaded file. + +`"DUE_DILIGENCE"` - The transfer due diligence document of the originator.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferDocumentPurpose { + #[serde(rename = "DUE_DILIGENCE")] + DueDiligence, +} diff --git a/src/model/transfer_event.rs b/src/model/transfer_event.rs index b59a682d..09685c27 100644 --- a/src/model/transfer_event.rs +++ b/src/model/transfer_event.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::TransferFailure; +use super::{OmittableTransferType, TransferEventType, TransferFailure}; ///Represents an event in the Transfers API. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferEvent { ///The account ID associated with the transfer. This field is omitted for Plaid Ledger Sweep events. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -20,6 +20,8 @@ pub struct TransferEvent { `settled`: Credits are available to be withdrawn or debits have been deducted from the Plaid linked account. +`funds_available`: Funds from the transfer have been released from hold and applied to the ledger's available balance. (Only applicable to ACH debits.) + `returned`: A posted transfer was returned. `swept`: The transfer was swept to / from the sweep account. @@ -53,13 +55,16 @@ pub struct TransferEvent { `refund.swept`: The refund was swept from the sweep account. `refund.return_swept`: Due to the refund being returned, funds were pushed back to the sweep account.*/ - pub event_type: String, + pub event_type: TransferEventType, ///The failure reason if the event type for a transfer is `"failed"` or `"returned"`. Null value otherwise. #[serde(default, skip_serializing_if = "Option::is_none")] pub failure_reason: Option, ///The id of the associated funding account, available in the Plaid Dashboard. If present, this indicates which of your business checking accounts will be credited or debited. #[serde(default, skip_serializing_if = "Option::is_none")] pub funding_account_id: Option, + ///Plaid’s unique identifier for a Plaid Ledger Balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ledger_id: Option, ///The ID of the origination account that this balance belongs to. #[serde(default, skip_serializing_if = "Option::is_none")] pub origination_account_id: Option, @@ -84,10 +89,10 @@ pub struct TransferEvent { pub transfer_id: String, ///The type of transfer. Valid values are `debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account. This field is omitted for Plaid Ledger Sweep events. #[serde(default, skip_serializing_if = "Option::is_none")] - pub transfer_type: Option, + pub transfer_type: Option, } impl std::fmt::Display for TransferEvent { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_event_list_response.rs b/src/model/transfer_event_list_response.rs index 022cdddc..3f67de83 100644 --- a/src/model/transfer_event_list_response.rs +++ b/src/model/transfer_event_list_response.rs @@ -3,6 +3,8 @@ use super::TransferEvent; ///Defines the response schema for `/transfer/event/list` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct TransferEventListResponse { + ///Whether there are more events to be pulled from the endpoint that have not already been returned + pub has_more: bool, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -12,4 +14,4 @@ impl std::fmt::Display for TransferEventListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_event_list_transfer_type.rs b/src/model/transfer_event_list_transfer_type.rs index cb32b646..f1784d12 100644 --- a/src/model/transfer_event_list_transfer_type.rs +++ b/src/model/transfer_event_list_transfer_type.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct TransferEventListTransferType(pub serde_json::Value); \ No newline at end of file +pub struct TransferEventListTransferType(pub serde_json::Value); diff --git a/src/model/transfer_event_sync_response.rs b/src/model/transfer_event_sync_response.rs index 154c24ea..57e92841 100644 --- a/src/model/transfer_event_sync_response.rs +++ b/src/model/transfer_event_sync_response.rs @@ -3,6 +3,8 @@ use super::TransferEvent; ///Defines the response schema for `/transfer/event/sync` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct TransferEventSyncResponse { + ///Whether there are more events to be pulled from the endpoint that have not already been returned + pub has_more: bool, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -12,4 +14,4 @@ impl std::fmt::Display for TransferEventSyncResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_event_type.rs b/src/model/transfer_event_type.rs new file mode 100644 index 00000000..bc7dffbd --- /dev/null +++ b/src/model/transfer_event_type.rs @@ -0,0 +1,97 @@ +use serde::{Serialize, Deserialize}; +/**The type of event that this transfer represents. Event types with prefix `sweep` represents events for Plaid Ledger sweeps. + +`pending`: A new transfer was created; it is in the pending state. + +`cancelled`: The transfer was cancelled by the client. + +`failed`: The transfer failed, no funds were moved. + +`posted`: The transfer has been successfully submitted to the payment network. + +`settled`: Credits are available to be withdrawn or debits have been deducted from the Plaid linked account. + +`funds_available`: Funds from the transfer have been released from hold and applied to the ledger's available balance. (Only applicable to ACH debits.) + +`returned`: A posted transfer was returned. + +`swept`: The transfer was swept to / from the sweep account. + +`swept_settled`: Credits are available to be withdrawn or debits have been deducted from the customer’s business checking account. + +`return_swept`: Due to the transfer being returned, funds were pulled from or pushed back to the sweep account. + +`sweep.pending`: A new ledger sweep was created; it is in the pending state. + +`sweep.posted`: The ledger sweep has been successfully submitted to the payment network. + +`sweep.settled`: The transaction has settled in the funding account. This means that funds withdrawn from Plaid Ledger balance have reached the funding account, or funds to be deposited into the Plaid Ledger Balance have been pulled, and the hold period has begun. + +`sweep.returned`: A posted ledger sweep was returned. + +`sweep.failed`: The ledger sweep failed, no funds were moved. + +`refund.pending`: A new refund was created; it is in the pending state. + +`refund.cancelled`: The refund was cancelled. + +`refund.failed`: The refund failed, no funds were moved. + +`refund.posted`: The refund has been successfully submitted to the payment network. + +`refund.settled`: The refund transaction has settled in the Plaid linked account. + +`refund.returned`: A posted refund was returned. + +`refund.swept`: The refund was swept from the sweep account. + +`refund.return_swept`: Due to the refund being returned, funds were pushed back to the sweep account.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferEventType { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "posted")] + Posted, + #[serde(rename = "settled")] + Settled, + #[serde(rename = "funds_available")] + FundsAvailable, + #[serde(rename = "returned")] + Returned, + #[serde(rename = "swept")] + Swept, + #[serde(rename = "swept_settled")] + SweptSettled, + #[serde(rename = "return_swept")] + ReturnSwept, + #[serde(rename = "sweep.pending")] + SweepPending, + #[serde(rename = "sweep.posted")] + SweepPosted, + #[serde(rename = "sweep.settled")] + SweepSettled, + #[serde(rename = "sweep.returned")] + SweepReturned, + #[serde(rename = "sweep.failed")] + SweepFailed, + #[serde(rename = "refund.pending")] + RefundPending, + #[serde(rename = "refund.cancelled")] + RefundCancelled, + #[serde(rename = "refund.failed")] + RefundFailed, + #[serde(rename = "refund.posted")] + RefundPosted, + #[serde(rename = "refund.settled")] + RefundSettled, + #[serde(rename = "refund.returned")] + RefundReturned, + #[serde(rename = "refund.swept")] + RefundSwept, + #[serde(rename = "refund.return_swept")] + RefundReturnSwept, +} diff --git a/src/model/transfer_events_update_webhook.rs b/src/model/transfer_events_update_webhook.rs index e250794a..c596c82f 100644 --- a/src/model/transfer_events_update_webhook.rs +++ b/src/model/transfer_events_update_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; -///Fired when new transfer events are available. Receiving this webhook indicates you should fetch the new events from `/transfer/event/sync`. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::WebhookEnvironmentValues; +///Fired when new transfer events are available. Receiving this webhook indicates you should fetch the new events from `/transfer/event/sync`. If multiple transfer events occur within a single minute, only one webhook will be fired, so a single webhook instance may correspond to multiple transfer events. +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferEventsUpdateWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, ///`TRANSFER_EVENTS_UPDATE` pub webhook_code: String, ///`TRANSFER` @@ -13,4 +14,4 @@ impl std::fmt::Display for TransferEventsUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_expected_sweep_settlement_schedule_item.rs b/src/model/transfer_expected_sweep_settlement_schedule_item.rs index b7bf5c35..6328ecc4 100644 --- a/src/model/transfer_expected_sweep_settlement_schedule_item.rs +++ b/src/model/transfer_expected_sweep_settlement_schedule_item.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for TransferExpectedSweepSettlementScheduleItem { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_failure.rs b/src/model/transfer_failure.rs index 2de7c7f3..5c190ffa 100644 --- a/src/model/transfer_failure.rs +++ b/src/model/transfer_failure.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for TransferFailure { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_funding_account.rs b/src/model/transfer_funding_account.rs index 80ce0259..0985fb67 100644 --- a/src/model/transfer_funding_account.rs +++ b/src/model/transfer_funding_account.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for TransferFundingAccount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_get_response.rs b/src/model/transfer_get_response.rs index 73ad3924..a9b7fd4f 100644 --- a/src/model/transfer_get_response.rs +++ b/src/model/transfer_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::Transfer; ///Defines the response schema for `/transfer/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferGetResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_intent_authorization_decision.rs b/src/model/transfer_intent_authorization_decision.rs new file mode 100644 index 00000000..47b2f5ac --- /dev/null +++ b/src/model/transfer_intent_authorization_decision.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**A decision regarding the proposed transfer. + +`APPROVED` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended (i.e., use Link in update mode to re-authenticate your user when `decision_rationale.code` is `ITEM_LOGIN_REQUIRED`). Refer to the `code` field in the `decision_rationale` object for details. + +`DECLINED` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferIntentAuthorizationDecision { + #[serde(rename = "APPROVED")] + Approved, + #[serde(rename = "DECLINED")] + Declined, +} diff --git a/src/model/transfer_intent_create.rs b/src/model/transfer_intent_create.rs index 114c013a..27e8f54f 100644 --- a/src/model/transfer_intent_create.rs +++ b/src/model/transfer_intent_create.rs @@ -1,12 +1,18 @@ use serde::{Serialize, Deserialize}; -use super::{TransferMetadata, TransferUserInResponse}; +use super::{ + AchClass, TransferIntentCreateMode, TransferIntentCreateNetwork, + TransferIntentStatus, TransferMetadata, TransferUserInResponse, +}; ///Represents a transfer intent within Transfer UI. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferIntentCreate { ///The Plaid `account_id` corresponding to the end-user account that will be debited or credited. Returned only if `account_id` was set on intent creation. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_id: Option, - /**Specifies the use case of the transfer. Required for transfers on an ACH network. + /**Specifies the use case of the transfer. Required for transfers on an ACH network. For more details, see [ACH SEC codes](https://plaid.com/docs/transfer/creating-transfers/#ach-sec-codes). + +Codes supported for credits: `ccd`, `ppd` +Codes supported for debits: `ccd`, `tel`, `web` `"ccd"` - Corporate Credit or Debit - fund transfer between two corporate bank accounts @@ -16,7 +22,7 @@ pub struct TransferIntentCreate { `"web"` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub ach_class: Option, + pub ach_class: Option, ///The amount of the transfer (decimal string with two digits of precision e.g. "10.00"). When calling `/transfer/authorization/create`, specify the maximum amount to authorize. When calling `/transfer/create`, specify the exact amount of the transfer, up to a maximum of the amount authorized. If this field is left blank when calling `/transfer/create`, the maximum amount authorized in the `authorization_id` will be sent. pub amount: String, ///The datetime the transfer was created. This will be of the form `2006-01-02T15:04:05Z`. @@ -42,14 +48,16 @@ Maximum value length of 500 characters*/ `PAYMENT`: Transfers funds from an end user's account to your business account. `DISBURSEMENT`: Transfers funds from your business account to an end user's account.*/ - pub mode: String, + pub mode: TransferIntentCreateMode, /**The network or rails used for the transfer. Defaults to `same-day-ach`. -For transfers submitted as `ach`, the next-day cutoff is 5:30 PM Eastern Time. +For transfers submitted using `ach`, the next-day cutoff is 8:30 PM Eastern Time. + +For transfers submitted using `same-day-ach`, the same-day cutoff is 3:30 PM Eastern Time. If the transfer is submitted after this cutoff but before the next-day cutoff, it will be sent over next-day rails and will not incur same-day charges. -For transfers submitted as `same-day-ach`, the same-day cutoff is 3:30 PM Eastern Time. If the transfer is submitted after this cutoff but before the next-day cutoff, it will be sent over next-day rails and will not incur same-day charges; this will apply to both legs of the transfer if applicable.*/ +For transfers submitted using `rtp`, in the case that the account being credited does not support RTP, the transfer will be sent over ACH as long as an `ach_class` is provided in the request. If RTP isn't supported by the account and no `ach_class` is provided, the transfer will fail to be submitted.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub network: Option, + pub network: Option, ///Plaid’s unique identifier for the origination account for the intent. If not provided, the default account will be used. pub origination_account_id: String, ///When `true`, the transfer requires a `GUARANTEED` decision by Plaid to proceed (Guarantee customers only). @@ -60,7 +68,7 @@ For transfers submitted as `same-day-ach`, the same-day cutoff is 3:30 PM Easter `PENDING`: The transfer intent is pending. `SUCCEEDED`: The transfer intent was successfully created. `FAILED`: The transfer intent was unable to be created.*/ - pub status: String, + pub status: TransferIntentStatus, ///The legal name and other information for the account holder. pub user: TransferUserInResponse, } @@ -68,4 +76,4 @@ impl std::fmt::Display for TransferIntentCreate { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_intent_create_mode.rs b/src/model/transfer_intent_create_mode.rs new file mode 100644 index 00000000..d2d5b1d2 --- /dev/null +++ b/src/model/transfer_intent_create_mode.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +/**The direction of the flow of transfer funds. + +`PAYMENT`: Transfers funds from an end user's account to your business account. + +`DISBURSEMENT`: Transfers funds from your business account to an end user's account.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferIntentCreateMode { + #[serde(rename = "PAYMENT")] + Payment, + #[serde(rename = "DISBURSEMENT")] + Disbursement, +} diff --git a/src/model/transfer_intent_create_network.rs b/src/model/transfer_intent_create_network.rs new file mode 100644 index 00000000..fb7e8f32 --- /dev/null +++ b/src/model/transfer_intent_create_network.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**The network or rails used for the transfer. Defaults to `same-day-ach`. + +For transfers submitted using `ach`, the next-day cutoff is 8:30 PM Eastern Time. + +For transfers submitted using `same-day-ach`, the same-day cutoff is 3:30 PM Eastern Time. If the transfer is submitted after this cutoff but before the next-day cutoff, it will be sent over next-day rails and will not incur same-day charges. + +For transfers submitted using `rtp`, in the case that the account being credited does not support RTP, the transfer will be sent over ACH as long as an `ach_class` is provided in the request. If RTP isn't supported by the account and no `ach_class` is provided, the transfer will fail to be submitted.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferIntentCreateNetwork { + #[serde(rename = "ach")] + Ach, + #[serde(rename = "same-day-ach")] + SameDayAch, + #[serde(rename = "rtp")] + Rtp, +} diff --git a/src/model/transfer_intent_create_response.rs b/src/model/transfer_intent_create_response.rs index 90bc39c4..72867a85 100644 --- a/src/model/transfer_intent_create_response.rs +++ b/src/model/transfer_intent_create_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransferIntentCreate; ///Defines the response schema for `/transfer/intent/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferIntentCreateResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferIntentCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_intent_get.rs b/src/model/transfer_intent_get.rs index 2355ce5c..2e9ce8c8 100644 --- a/src/model/transfer_intent_get.rs +++ b/src/model/transfer_intent_get.rs @@ -1,16 +1,22 @@ use serde::{Serialize, Deserialize}; use super::{ - TransferAuthorizationDecisionRationale, TransferAuthorizationGuaranteeDecision, - TransferAuthorizationGuaranteeDecisionRationale, TransferIntentGetFailureReason, - TransferMetadata, TransferUserInResponse, + AchClass, TransferAuthorizationDecisionRationale, + TransferAuthorizationGuaranteeDecision, + TransferAuthorizationGuaranteeDecisionRationale, TransferIntentAuthorizationDecision, + TransferIntentCreateMode, TransferIntentCreateNetwork, + TransferIntentGetFailureReason, TransferIntentStatus, TransferMetadata, + TransferUserInResponse, }; ///Represents a transfer intent within Transfer UI. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferIntentGet { ///The Plaid `account_id` for the account that will be debited or credited. Returned only if `account_id` was set on intent creation. #[serde(default, skip_serializing_if = "Option::is_none")] pub account_id: Option, - /**Specifies the use case of the transfer. Required for transfers on an ACH network. + /**Specifies the use case of the transfer. Required for transfers on an ACH network. For more details, see [ACH SEC codes](https://plaid.com/docs/transfer/creating-transfers/#ach-sec-codes). + +Codes supported for credits: `ccd`, `ppd` +Codes supported for debits: `ccd`, `tel`, `web` `"ccd"` - Corporate Credit or Debit - fund transfer between two corporate bank accounts @@ -20,16 +26,16 @@ pub struct TransferIntentGet { `"web"` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub ach_class: Option, + pub ach_class: Option, ///The amount of the transfer (decimal string with two digits of precision e.g. "10.00"). When calling `/transfer/authorization/create`, specify the maximum amount to authorize. When calling `/transfer/create`, specify the exact amount of the transfer, up to a maximum of the amount authorized. If this field is left blank when calling `/transfer/create`, the maximum amount authorized in the `authorization_id` will be sent. pub amount: String, /**A decision regarding the proposed transfer. -`APPROVED` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended (i.e., use Link in update to re-authenticate your user when `decision_rationale.code` is `ITEM_LOGIN_REQUIRED`). Refer to the `code` field in the `decision_rationale` object for details. +`APPROVED` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended (i.e., use Link in update mode to re-authenticate your user when `decision_rationale.code` is `ITEM_LOGIN_REQUIRED`). Refer to the `code` field in the `decision_rationale` object for details. `DECLINED` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization_decision: Option, + pub authorization_decision: Option, ///The rationale for Plaid's decision regarding a proposed transfer. It is always set for `declined` decisions, and may or may not be null for `approved` decisions. #[serde(default, skip_serializing_if = "Option::is_none")] pub authorization_decision_rationale: Option, @@ -67,14 +73,16 @@ Maximum value length of 500 characters*/ `PAYMENT`: Transfers funds from an end user's account to your business account. `DISBURSEMENT`: Transfers funds from your business account to an end user's account.*/ - pub mode: String, + pub mode: TransferIntentCreateMode, /**The network or rails used for the transfer. Defaults to `same-day-ach`. -For transfers submitted as `ach`, the next-day cutoff is 5:30 PM Eastern Time. +For transfers submitted using `ach`, the next-day cutoff is 8:30 PM Eastern Time. + +For transfers submitted using `same-day-ach`, the same-day cutoff is 3:30 PM Eastern Time. If the transfer is submitted after this cutoff but before the next-day cutoff, it will be sent over next-day rails and will not incur same-day charges. -For transfers submitted as `same-day-ach`, the same-day cutoff is 3:30 PM Eastern Time. If the transfer is submitted after this cutoff but before the next-day cutoff, it will be sent over next-day rails and will not incur same-day charges; this will apply to both legs of the transfer if applicable.*/ +For transfers submitted using `rtp`, in the case that the account being credited does not support RTP, the transfer will be sent over ACH as long as an `ach_class` is provided in the request. If RTP isn't supported by the account and no `ach_class` is provided, the transfer will fail to be submitted.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub network: Option, + pub network: Option, ///Plaid’s unique identifier for the origination account used for the transfer. pub origination_account_id: String, ///When `true`, the transfer requires a `GUARANTEED` decision by Plaid to proceed (Guarantee customers only). @@ -85,7 +93,7 @@ For transfers submitted as `same-day-ach`, the same-day cutoff is 3:30 PM Easter `PENDING`: The transfer intent is pending. `SUCCEEDED`: The transfer intent was successfully created. `FAILED`: The transfer intent was unable to be created.*/ - pub status: String, + pub status: TransferIntentStatus, ///Plaid's unique identifier for the transfer created through the UI. Returned only if the transfer was successfully created. Null value otherwise. #[serde(default, skip_serializing_if = "Option::is_none")] pub transfer_id: Option, @@ -96,4 +104,4 @@ impl std::fmt::Display for TransferIntentGet { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_intent_get_failure_reason.rs b/src/model/transfer_intent_get_failure_reason.rs index 5a8fda23..1e41bb01 100644 --- a/src/model/transfer_intent_get_failure_reason.rs +++ b/src/model/transfer_intent_get_failure_reason.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for TransferIntentGetFailureReason { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_intent_get_response.rs b/src/model/transfer_intent_get_response.rs index d6318d02..c21b6825 100644 --- a/src/model/transfer_intent_get_response.rs +++ b/src/model/transfer_intent_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransferIntentGet; ///Defines the response schema for `/transfer/intent/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferIntentGetResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferIntentGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_intent_status.rs b/src/model/transfer_intent_status.rs new file mode 100644 index 00000000..53a36931 --- /dev/null +++ b/src/model/transfer_intent_status.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +/**The status of the transfer intent. + +`PENDING`: The transfer intent is pending. +`SUCCEEDED`: The transfer intent was successfully created. +`FAILED`: The transfer intent was unable to be created.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferIntentStatus { + #[serde(rename = "PENDING")] + Pending, + #[serde(rename = "SUCCEEDED")] + Succeeded, + #[serde(rename = "FAILED")] + Failed, +} diff --git a/src/model/transfer_ledger_balance.rs b/src/model/transfer_ledger_balance.rs index 6d16b723..01212757 100644 --- a/src/model/transfer_ledger_balance.rs +++ b/src/model/transfer_ledger_balance.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for TransferLedgerBalance { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_ledger_deposit_response.rs b/src/model/transfer_ledger_deposit_response.rs index 9b110b09..282c711b 100644 --- a/src/model/transfer_ledger_deposit_response.rs +++ b/src/model/transfer_ledger_deposit_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransferSweep; ///Defines the response schema for `/transfer/ledger/deposit` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferLedgerDepositResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, @@ -18,4 +18,4 @@ impl std::fmt::Display for TransferLedgerDepositResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_ledger_distribute_response.rs b/src/model/transfer_ledger_distribute_response.rs index a3d48642..0036b120 100644 --- a/src/model/transfer_ledger_distribute_response.rs +++ b/src/model/transfer_ledger_distribute_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for TransferLedgerDistributeResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_ledger_get_response.rs b/src/model/transfer_ledger_get_response.rs index 67fa56d9..88d3f890 100644 --- a/src/model/transfer_ledger_get_response.rs +++ b/src/model/transfer_ledger_get_response.rs @@ -5,6 +5,12 @@ use super::TransferLedgerBalance; pub struct TransferLedgerGetResponse { ///Information about the balance of the ledger held with Plaid. pub balance: TransferLedgerBalance, + ///Whether this Ledger is the client's default ledger. + pub is_default: bool, + ///The unique identifier of the Ledger that was returned. + pub ledger_id: String, + ///The name of the Ledger + pub name: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, } @@ -12,4 +18,4 @@ impl std::fmt::Display for TransferLedgerGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_ledger_sweep_simulate_event_type.rs b/src/model/transfer_ledger_sweep_simulate_event_type.rs new file mode 100644 index 00000000..ec98caaa --- /dev/null +++ b/src/model/transfer_ledger_sweep_simulate_event_type.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +/**The asynchronous event to be simulated. May be: `posted`, `settled`, `failed`, or `returned`. + +An error will be returned if the event type is incompatible with the current ledger sweep status. Compatible status --> event type transitions include: + +`sweep.pending` --> `sweep.posted` + +`sweep.pending` --> `sweep.failed` + +`sweep.posted` --> `sweep.settled` + +`sweep.posted` --> `sweep.returned` + +`sweep.settled` --> `sweep.returned`*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferLedgerSweepSimulateEventType { + #[serde(rename = "sweep.posted")] + SweepPosted, + #[serde(rename = "sweep.settled")] + SweepSettled, + #[serde(rename = "sweep.returned")] + SweepReturned, + #[serde(rename = "sweep.failed")] + SweepFailed, +} diff --git a/src/model/transfer_ledger_withdraw_response.rs b/src/model/transfer_ledger_withdraw_response.rs index cc037fe2..8959ac8e 100644 --- a/src/model/transfer_ledger_withdraw_response.rs +++ b/src/model/transfer_ledger_withdraw_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransferSweep; ///Defines the response schema for `/transfer/ledger/withdraw` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferLedgerWithdrawResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, @@ -18,4 +18,4 @@ impl std::fmt::Display for TransferLedgerWithdrawResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_list_response.rs b/src/model/transfer_list_response.rs index aa9f8083..0614d178 100644 --- a/src/model/transfer_list_response.rs +++ b/src/model/transfer_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_metadata.rs b/src/model/transfer_metadata.rs index 83452f24..485f9c2b 100644 --- a/src/model/transfer_metadata.rs +++ b/src/model/transfer_metadata.rs @@ -1,14 +1,2 @@ use serde::{Serialize, Deserialize}; -/**The Metadata object is a mapping of client-provided string fields to any string value. The following limitations apply: -The JSON values must be Strings (no nested JSON objects allowed) -Only ASCII characters may be used -Maximum of 50 key/value pairs -Maximum key length of 40 characters -Maximum value length of 500 characters*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct TransferMetadata {} -impl std::fmt::Display for TransferMetadata { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type TransferMetadata = String; diff --git a/src/model/transfer_metrics_get_authorization_usage.rs b/src/model/transfer_metrics_get_authorization_usage.rs new file mode 100644 index 00000000..7979f929 --- /dev/null +++ b/src/model/transfer_metrics_get_authorization_usage.rs @@ -0,0 +1,22 @@ +use serde::{Serialize, Deserialize}; +///Details regarding authorization usage. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferMetricsGetAuthorizationUsage { + ///The daily credit utilization formatted as a decimal. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub daily_credit_utilization: Option, + ///The daily debit utilization formatted as a decimal. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub daily_debit_utilization: Option, + ///The monthly credit utilization formatted as a decimal. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub monthly_credit_utilization: Option, + ///The monthly debit utilization formatted as a decimal. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub monthly_debit_utilization: Option, +} +impl std::fmt::Display for TransferMetricsGetAuthorizationUsage { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_metrics_get_response.rs b/src/model/transfer_metrics_get_response.rs index 754894a4..f9c63867 100644 --- a/src/model/transfer_metrics_get_response.rs +++ b/src/model/transfer_metrics_get_response.rs @@ -1,7 +1,11 @@ use serde::{Serialize, Deserialize}; +use super::{TransferMetricsGetAuthorizationUsage, TransferMetricsGetReturnRates}; ///Defines the response schema for `/transfer/metrics/get` #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct TransferMetricsGetResponse { + ///Details regarding authorization usage. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorization_usage: Option, ///Sum of dollar amount of credit transfers in last 24 hours (decimal string with two digits of precision e.g. "10.00"). pub daily_credit_transfer_volume: String, ///Sum of dollar amount of debit transfers in last 24 hours (decimal string with two digits of precision e.g. "10.00"). @@ -16,9 +20,12 @@ pub struct TransferMetricsGetResponse { pub monthly_transfer_volume: String, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, + ///Details regarding return rates. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub return_rates: Option, } impl std::fmt::Display for TransferMetricsGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_metrics_get_return_rates.rs b/src/model/transfer_metrics_get_return_rates.rs new file mode 100644 index 00000000..f7a76dc2 --- /dev/null +++ b/src/model/transfer_metrics_get_return_rates.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::TransferMetricsGetReturnRatesOverInterval; +///Details regarding return rates. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferMetricsGetReturnRates { + ///Details regarding return rates. + #[serde(rename = "last_60d")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last60_d: Option, +} +impl std::fmt::Display for TransferMetricsGetReturnRates { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_metrics_get_return_rates_over_interval.rs b/src/model/transfer_metrics_get_return_rates_over_interval.rs new file mode 100644 index 00000000..31e97f07 --- /dev/null +++ b/src/model/transfer_metrics_get_return_rates_over_interval.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///Details regarding return rates. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferMetricsGetReturnRatesOverInterval { + ///The administrative return rate. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub administrative_return_rate: Option, + ///The overall return rate. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overall_return_rate: Option, + ///The unauthorized return rate. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub unauthorized_return_rate: Option, +} +impl std::fmt::Display for TransferMetricsGetReturnRatesOverInterval { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_migrate_account_response.rs b/src/model/transfer_migrate_account_response.rs index d99d7991..fb1519ae 100644 --- a/src/model/transfer_migrate_account_response.rs +++ b/src/model/transfer_migrate_account_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for TransferMigrateAccountResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_network.rs b/src/model/transfer_network.rs new file mode 100644 index 00000000..1e6f5405 --- /dev/null +++ b/src/model/transfer_network.rs @@ -0,0 +1,21 @@ +use serde::{Serialize, Deserialize}; +/**The network or rails used for the transfer. + +For transfers submitted as `ach`, the next-day cutoff is 8:30 PM Eastern Time. + +For transfers submitted as `same-day-ach`, the same-day cutoff is 3:30 PM Eastern Time. If the transfer is submitted after this cutoff but before the next-day cutoff, it will be sent over next-day rails and will not incur same-day charges; this will apply to both legs of the transfer if applicable. + +For transfers submitted as `rtp`, Plaid will automatically route between Real Time Payment rail by TCH or FedNow rails as necessary. If a transfer is submitted as `rtp` and the counterparty account is not eligible for RTP, the `/transfer/authorization/create` request will fail with an `INVALID_FIELD` error code. To pre-check to determine whether a counterparty account can support RTP, call `/transfer/capabilities/get` before calling `/transfer/authorization/create`. + +Wire transfers are currently in early availability. To request access to `wire` as a payment network, contact your Account Manager. For transfers submitted as `wire`, the `type` must be `credit`; wire debits are not supported.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferNetwork { + #[serde(rename = "ach")] + Ach, + #[serde(rename = "same-day-ach")] + SameDayAch, + #[serde(rename = "rtp")] + Rtp, + #[serde(rename = "wire")] + Wire, +} diff --git a/src/model/transfer_originator_address.rs b/src/model/transfer_originator_address.rs index f7178cb1..0524fb39 100644 --- a/src/model/transfer_originator_address.rs +++ b/src/model/transfer_originator_address.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for TransferOriginatorAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_originator_create_response.rs b/src/model/transfer_originator_create_response.rs index c89760b0..57ac18b8 100644 --- a/src/model/transfer_originator_create_response.rs +++ b/src/model/transfer_originator_create_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for TransferOriginatorCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_originator_diligence.rs b/src/model/transfer_originator_diligence.rs index fe88ece0..9ac7ac31 100644 --- a/src/model/transfer_originator_diligence.rs +++ b/src/model/transfer_originator_diligence.rs @@ -4,7 +4,7 @@ use super::{ TransferFundingAccount, TransferOriginatorAddress, }; ///The diligence information for the originator. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferOriginatorDiligence { ///The originator's address. pub address: TransferOriginatorAddress, @@ -29,4 +29,4 @@ impl std::fmt::Display for TransferOriginatorDiligence { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_originator_funding_account_update_response.rs b/src/model/transfer_originator_funding_account_update_response.rs index c894595f..2f3e7154 100644 --- a/src/model/transfer_originator_funding_account_update_response.rs +++ b/src/model/transfer_originator_funding_account_update_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for TransferOriginatorFundingAccountUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_originator_get_response.rs b/src/model/transfer_originator_get_response.rs index 8c4961fc..763e9365 100644 --- a/src/model/transfer_originator_get_response.rs +++ b/src/model/transfer_originator_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::DetailedOriginator; ///Defines the response schema for `/transfer/originator/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferOriginatorGetResponse { ///Originator and their status. pub originator: DetailedOriginator, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferOriginatorGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_originator_list_response.rs b/src/model/transfer_originator_list_response.rs index d2fd69f2..edd2df19 100644 --- a/src/model/transfer_originator_list_response.rs +++ b/src/model/transfer_originator_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferOriginatorListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_platform_originator_create_response.rs b/src/model/transfer_platform_originator_create_response.rs new file mode 100644 index 00000000..29d6dc20 --- /dev/null +++ b/src/model/transfer_platform_originator_create_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///Defines the response schema for `/transfer/platform/originator/create` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferPlatformOriginatorCreateResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for TransferPlatformOriginatorCreateResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_platform_person_address.rs b/src/model/transfer_platform_person_address.rs new file mode 100644 index 00000000..ac03c3a1 --- /dev/null +++ b/src/model/transfer_platform_person_address.rs @@ -0,0 +1,24 @@ +use serde::{Serialize, Deserialize}; +///Home address of a person +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferPlatformPersonAddress { + ///The full city name. + pub city: String, + ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. + pub country: String, + ///The postal code of the address. + pub postal_code: String, + /**An ISO 3166-2 subdivision code. +Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc.*/ + pub region: String, + ///The primary street portion of an address. A string with at least one non-whitespace alphabetical character, with a max length of 80 characters. + pub street: String, + ///Extra street information, like an apartment or suite number. If provided, a string with at least one non-whitespace character, with a max length of 50 characters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street2: Option, +} +impl std::fmt::Display for TransferPlatformPersonAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_platform_person_create_response.rs b/src/model/transfer_platform_person_create_response.rs new file mode 100644 index 00000000..bbe1e18b --- /dev/null +++ b/src/model/transfer_platform_person_create_response.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///Defines the response schema for `/transfer/platform/person/create` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferPlatformPersonCreateResponse { + ///An ID that should be used when submitting additional requirements that are associated with this person. + pub person_id: String, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for TransferPlatformPersonCreateResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_platform_person_id_number.rs b/src/model/transfer_platform_person_id_number.rs new file mode 100644 index 00000000..fe7c8cf3 --- /dev/null +++ b/src/model/transfer_platform_person_id_number.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::IdNumberType; +///ID number of the person +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TransferPlatformPersonIdNumber { + ///A globally unique and human readable ID type, specific to the country and document category. For more context on this field, see [Hybrid Input Validation](https://plaid.com/docs/identity-verification/hybrid-input-validation). + #[serde(rename = "type")] + pub type_: IdNumberType, + ///Value of the person's ID Number. Alpha-numeric, with all formatting characters stripped. + pub value: String, +} +impl std::fmt::Display for TransferPlatformPersonIdNumber { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_platform_person_name.rs b/src/model/transfer_platform_person_name.rs new file mode 100644 index 00000000..72b9dcb0 --- /dev/null +++ b/src/model/transfer_platform_person_name.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///The person's legal name +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferPlatformPersonName { + ///A string with at least one non-whitespace character, with a max length of 100 characters. + pub family_name: String, + ///A string with at least one non-whitespace character, with a max length of 100 characters. + pub given_name: String, +} +impl std::fmt::Display for TransferPlatformPersonName { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_platform_requirement.rs b/src/model/transfer_platform_requirement.rs new file mode 100644 index 00000000..76e9b519 --- /dev/null +++ b/src/model/transfer_platform_requirement.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///A piece of information that is outstanding for the scaled platform onboarding process. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferPlatformRequirement { + ///UUID of the person associated with the requirement. Only present for individual-scoped requirements. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub person_id: Option, + ///The type of requirement. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub requirement_type: Option, +} +impl std::fmt::Display for TransferPlatformRequirement { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_platform_requirement_submission.rs b/src/model/transfer_platform_requirement_submission.rs new file mode 100644 index 00000000..66afa9bc --- /dev/null +++ b/src/model/transfer_platform_requirement_submission.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +///A single requirement submission +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferPlatformRequirementSubmission { + ///The `person_id` of the person the requirement submission is related to. A `person_id` is returned by `/transfer/platform/person/create`. This field should not be included for requirements that are not related to a person. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub person_id: Option, + ///The type of requirement being submitted + pub requirement_type: String, + ///The value of the requirement, which can be a string or an object depending on the `requirement_type`. If it is an object, the object should be JSON marshaled into a string. See the documentation on this endpoint for more information and examples. + pub value: String, +} +impl std::fmt::Display for TransferPlatformRequirementSubmission { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_platform_requirement_submit_response.rs b/src/model/transfer_platform_requirement_submit_response.rs new file mode 100644 index 00000000..f253b8d0 --- /dev/null +++ b/src/model/transfer_platform_requirement_submit_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///Defines the response schema for `/transfer/platform/requirement/submit` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferPlatformRequirementSubmitResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for TransferPlatformRequirementSubmitResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_platform_tos_acceptance_metadata.rs b/src/model/transfer_platform_tos_acceptance_metadata.rs new file mode 100644 index 00000000..7e7c28e7 --- /dev/null +++ b/src/model/transfer_platform_tos_acceptance_metadata.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///Metadata related to the acceptance of Terms of Service +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferPlatformTosAcceptanceMetadata { + ///Indicates whether the TOS agreement was accepted + pub agreement_accepted: bool, + ///ISO8601 timestamp indicating when the originator accepted the TOS + pub agreement_accepted_at: chrono::DateTime, + ///The IP address of the originator when they accepted the TOS. Formatted as an IPv4 or IPv6 IP address + pub originator_ip_address: String, +} +impl std::fmt::Display for TransferPlatformTosAcceptanceMetadata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/transfer_questionnaire_create_response.rs b/src/model/transfer_questionnaire_create_response.rs index 77be721f..b8dd2a5a 100644 --- a/src/model/transfer_questionnaire_create_response.rs +++ b/src/model/transfer_questionnaire_create_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for TransferQuestionnaireCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_recurring_cancel_response.rs b/src/model/transfer_recurring_cancel_response.rs index 15c03259..7b5ed035 100644 --- a/src/model/transfer_recurring_cancel_response.rs +++ b/src/model/transfer_recurring_cancel_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for TransferRecurringCancelResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_recurring_create_response.rs b/src/model/transfer_recurring_create_response.rs index 24766e58..04085bb5 100644 --- a/src/model/transfer_recurring_create_response.rs +++ b/src/model/transfer_recurring_create_response.rs @@ -1,14 +1,19 @@ use serde::{Serialize, Deserialize}; -use super::{RecurringTransferNullable, TransferAuthorizationDecisionRationale}; +use super::{ + RecurringTransferNullable, TransferAuthorizationDecision, + TransferAuthorizationDecisionRationale, +}; ///Defines the response schema for `/transfer/recurring/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferRecurringCreateResponse { /**A decision regarding the proposed transfer. -`approved` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended (i.e., use Link in update to re-authenticate your user when `decision_rationale.code` is `ITEM_LOGIN_REQUIRED`). Refer to the `code` field in the `decision_rationale` object for details. +`approved` – The proposed transfer has received the end user's consent and has been approved for processing by Plaid. The `decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended. Refer to the `code` field in the `decision_rationale` object for details. -`declined` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details.*/ - pub decision: String, +`declined` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details. + +`user_action_required` – An action is required before Plaid can assess the transfer risk and make a decision. The most common scenario is to update authentication for an Item. To complete the required action, initialize Link by setting `transfer.authorization_id` in the request of `/link/token/create`. After Link flow is completed, you may re-attempt the authorization request.*/ + pub decision: TransferAuthorizationDecision, ///The rationale for Plaid's decision regarding a proposed transfer. It is always set for `declined` decisions, and may or may not be null for `approved` decisions. #[serde(default, skip_serializing_if = "Option::is_none")] pub decision_rationale: Option, @@ -22,4 +27,4 @@ impl std::fmt::Display for TransferRecurringCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_recurring_get_response.rs b/src/model/transfer_recurring_get_response.rs index 5c877b53..e4718e98 100644 --- a/src/model/transfer_recurring_get_response.rs +++ b/src/model/transfer_recurring_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::RecurringTransfer; ///Defines the response schema for `/transfer/recurring/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferRecurringGetResponse { ///Represents a recurring transfer within the Transfers API. pub recurring_transfer: RecurringTransfer, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferRecurringGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_recurring_list_response.rs b/src/model/transfer_recurring_list_response.rs index f6c8b8a0..a2b4e721 100644 --- a/src/model/transfer_recurring_list_response.rs +++ b/src/model/transfer_recurring_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferRecurringListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_recurring_network.rs b/src/model/transfer_recurring_network.rs new file mode 100644 index 00000000..d3441eb9 --- /dev/null +++ b/src/model/transfer_recurring_network.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Networks eligible for recurring transfers. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferRecurringNetwork { + #[serde(rename = "ach")] + Ach, + #[serde(rename = "same-day-ach")] + SameDayAch, + #[serde(rename = "rtp")] + Rtp, +} diff --git a/src/model/transfer_recurring_schedule.rs b/src/model/transfer_recurring_schedule.rs index c8614b26..69d74ffe 100644 --- a/src/model/transfer_recurring_schedule.rs +++ b/src/model/transfer_recurring_schedule.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::TransferScheduleIntervalUnit; ///The schedule that the recurring transfer will be executed on. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferRecurringSchedule { /**A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). The recurring transfer will end on the last `interval_execution_day` on or before the `end_date`. If the `interval_execution_day` between the start date and the end date (inclusive) is also the same day that `/transfer/recurring/create` was called, the bank *may* make a payment on that day, but it is not guaranteed to do so.*/ @@ -18,14 +19,15 @@ If the `interval_unit` is `month`, `interval_execution_day` should be an integer The transfer will be originated on the next available banking day if the designated day is a non banking day.*/ pub interval_execution_day: i64, ///The unit of the recurring interval. - pub interval_unit: String, + pub interval_unit: TransferScheduleIntervalUnit, /**A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). The recurring transfer will begin on the first `interval_execution_day` on or after the `start_date`. -If the first `interval_execution_day` on or after the start date is also the same day that `/transfer/recurring/create` was called, the bank *may* make the first payment on that day, but it is not guaranteed to do so.*/ +For `rtp` recurring transfers, `start_date` must be in the future. +Otherwise, if the first `interval_execution_day` on or after the start date is also the same day that `/transfer/recurring/create` was called, the bank *may* make the first payment on that day, but it is not guaranteed to do so.*/ pub start_date: chrono::NaiveDate, } impl std::fmt::Display for TransferRecurringSchedule { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_recurring_status.rs b/src/model/transfer_recurring_status.rs new file mode 100644 index 00000000..02add536 --- /dev/null +++ b/src/model/transfer_recurring_status.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +/**The status of the recurring transfer. + +`active`: The recurring transfer is currently active. +`cancelled`: The recurring transfer was cancelled by the client or Plaid. +`expired`: The recurring transfer has completed all originations according to its recurring schedule.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferRecurringStatus { + #[serde(rename = "active")] + Active, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "expired")] + Expired, +} diff --git a/src/model/transfer_refund.rs b/src/model/transfer_refund.rs index 0d656df0..cfc40f4a 100644 --- a/src/model/transfer_refund.rs +++ b/src/model/transfer_refund.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::TransferRefundFailure; +use super::{TransferRefundFailure, TransferRefundStatus}; ///Represents a refund within the Transfers API. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferRefund { ///The amount of the refund (decimal string with two digits of precision e.g. "10.00"). pub amount: String, @@ -12,9 +12,14 @@ pub struct TransferRefund { pub failure_reason: Option, ///Plaid’s unique identifier for a refund. pub id: String, + ///Plaid’s unique identifier for a Plaid Ledger Balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ledger_id: Option, /**The trace identifier for the transfer based on its network. This will only be set after the transfer has posted. -For `ach` or `same-day-ach` transfers, this is the ACH trace number. Currently, the field will remain null for transfers on other rails.*/ +For `ach` or `same-day-ach` transfers, this is the ACH trace number. +For `rtp` transfers, this is the Transaction Identification number. +For `wire` transfers, this is the IMAD (Input Message Accountability Data) number.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub network_trace_id: Option, /**The status of the refund. @@ -25,7 +30,7 @@ For `ach` or `same-day-ach` transfers, this is the ACH trace number. Currently, `cancelled`: The refund was cancelled by the client. `failed`: The refund has failed. `returned`: The refund was returned.*/ - pub status: String, + pub status: TransferRefundStatus, ///The ID of the transfer to refund. pub transfer_id: String, } @@ -33,4 +38,4 @@ impl std::fmt::Display for TransferRefund { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_refund_cancel_response.rs b/src/model/transfer_refund_cancel_response.rs index 96d4596c..8095a19b 100644 --- a/src/model/transfer_refund_cancel_response.rs +++ b/src/model/transfer_refund_cancel_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for TransferRefundCancelResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_refund_create_response.rs b/src/model/transfer_refund_create_response.rs index 9c3511fb..6e486cbd 100644 --- a/src/model/transfer_refund_create_response.rs +++ b/src/model/transfer_refund_create_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransferRefund; ///Defines the response schema for `/transfer/refund/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferRefundCreateResponse { ///Represents a refund within the Transfers API. pub refund: TransferRefund, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferRefundCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_refund_failure.rs b/src/model/transfer_refund_failure.rs index d4b67378..c1a44566 100644 --- a/src/model/transfer_refund_failure.rs +++ b/src/model/transfer_refund_failure.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for TransferRefundFailure { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_refund_get_response.rs b/src/model/transfer_refund_get_response.rs index 1c073416..9f77371e 100644 --- a/src/model/transfer_refund_get_response.rs +++ b/src/model/transfer_refund_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransferRefund; ///Defines the response schema for `/transfer/refund/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferRefundGetResponse { ///Represents a refund within the Transfers API. pub refund: TransferRefund, @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferRefundGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_refund_status.rs b/src/model/transfer_refund_status.rs new file mode 100644 index 00000000..0f7909db --- /dev/null +++ b/src/model/transfer_refund_status.rs @@ -0,0 +1,24 @@ +use serde::{Serialize, Deserialize}; +/**The status of the refund. + +`pending`: A new refund was created; it is in the pending state. +`posted`: The refund has been successfully submitted to the payment network. +`settled`: Credits have been refunded to the Plaid linked account. +`cancelled`: The refund was cancelled by the client. +`failed`: The refund has failed. +`returned`: The refund was returned.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferRefundStatus { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "posted")] + Posted, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "settled")] + Settled, + #[serde(rename = "returned")] + Returned, +} diff --git a/src/model/transfer_repayment.rs b/src/model/transfer_repayment.rs index 4169e29c..50d6ccb7 100644 --- a/src/model/transfer_repayment.rs +++ b/src/model/transfer_repayment.rs @@ -17,4 +17,4 @@ impl std::fmt::Display for TransferRepayment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_repayment_list_response.rs b/src/model/transfer_repayment_list_response.rs index 33cd73bf..920de1a5 100644 --- a/src/model/transfer_repayment_list_response.rs +++ b/src/model/transfer_repayment_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferRepaymentListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_repayment_return.rs b/src/model/transfer_repayment_return.rs index d0de2acf..a66548f6 100644 --- a/src/model/transfer_repayment_return.rs +++ b/src/model/transfer_repayment_return.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for TransferRepaymentReturn { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_repayment_return_list_response.rs b/src/model/transfer_repayment_return_list_response.rs index 7f94a47c..cba923cf 100644 --- a/src/model/transfer_repayment_return_list_response.rs +++ b/src/model/transfer_repayment_return_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferRepaymentReturnListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_schedule_interval_unit.rs b/src/model/transfer_schedule_interval_unit.rs new file mode 100644 index 00000000..9cfd0246 --- /dev/null +++ b/src/model/transfer_schedule_interval_unit.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The unit of the recurring interval. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferScheduleIntervalUnit { + #[serde(rename = "week")] + Week, + #[serde(rename = "month")] + Month, +} diff --git a/src/model/transfer_status.rs b/src/model/transfer_status.rs new file mode 100644 index 00000000..2a0c82ed --- /dev/null +++ b/src/model/transfer_status.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +/**The status of the transfer. + +`pending`: A new transfer was created; it is in the pending state. +`posted`: The transfer has been successfully submitted to the payment network. +`settled`: Credits are available to be withdrawn or debits have been deducted from the Plaid linked account. +`funds_available`: Funds from the transfer have been released from hold and applied to the ledger's available balance. (Only applicable to ACH debits.) +`cancelled`: The transfer was cancelled by the client. +`failed`: The transfer failed, no funds were moved. +`returned`: A posted transfer was returned.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferStatus { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "posted")] + Posted, + #[serde(rename = "settled")] + Settled, + #[serde(rename = "funds_available")] + FundsAvailable, + #[serde(rename = "cancelled")] + Cancelled, + #[serde(rename = "failed")] + Failed, + #[serde(rename = "returned")] + Returned, +} diff --git a/src/model/transfer_sweep.rs b/src/model/transfer_sweep.rs index 811bca9f..de77a005 100644 --- a/src/model/transfer_sweep.rs +++ b/src/model/transfer_sweep.rs @@ -1,5 +1,5 @@ use serde::{Serialize, Deserialize}; -use super::SweepStatus; +use super::{SweepStatus, SweepTrigger}; /**Describes a sweep of funds to / from the sweep account. A sweep is associated with many sweep events (events of type `swept` or `return_swept`) which can be retrieved by invoking the `/transfer/event/list` endpoint with the corresponding `sweep_id`. @@ -7,7 +7,7 @@ A sweep is associated with many sweep events (events of type `swept` or `return_ `swept` events occur when the transfer amount is credited or debited from your sweep account, depending on the `type` of the transfer. `return_swept` events occur when a transfer is returned and Plaid undoes the credit or debit. The total sum of the `swept` and `return_swept` events is equal to the `amount` of the sweep Plaid creates and matches the amount of the entry on your sweep account ledger.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferSweep { /**Signed decimal amount of the sweep as it appears on your sweep account ledger (e.g. "-10.00") @@ -24,9 +24,14 @@ If amount is not present, the sweep was net-settled to zero and outstanding debi pub id: String, ///The currency of the sweep, e.g. "USD". pub iso_currency_code: String, + ///Plaid’s unique identifier for a Plaid Ledger Balance. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ledger_id: Option, /**The trace identifier for the transfer based on its network. This will only be set after the transfer has posted. -For `ach` or `same-day-ach` transfers, this is the ACH trace number. Currently, the field will remain null for transfers on other rails.*/ +For `ach` or `same-day-ach` transfers, this is the ACH trace number. +For `rtp` transfers, this is the Transaction Identification number. +For `wire` transfers, this is the IMAD (Input Message Accountability Data) number.*/ #[serde(default, skip_serializing_if = "Option::is_none")] pub network_trace_id: Option, ///The date when the sweep settled, in the YYYY-MM-DD format. @@ -48,10 +53,10 @@ For `ach` or `same-day-ach` transfers, this is the ACH trace number. Currently, `"balance_threshold"` - The sweep is created by balance threshold setting `"automatic_aggregate"` - The sweep is created by the Plaid automatic aggregation process. These funds did not pass through the Plaid Ledger balance.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub trigger: Option, + pub trigger: Option, } impl std::fmt::Display for TransferSweep { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_sweep_get_response.rs b/src/model/transfer_sweep_get_response.rs index d0fdde7e..c3655c15 100644 --- a/src/model/transfer_sweep_get_response.rs +++ b/src/model/transfer_sweep_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; use super::TransferSweep; ///Defines the response schema for `/transfer/sweep/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferSweepGetResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, @@ -18,4 +18,4 @@ impl std::fmt::Display for TransferSweepGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_sweep_list_response.rs b/src/model/transfer_sweep_list_response.rs index fa441f3e..748cf298 100644 --- a/src/model/transfer_sweep_list_response.rs +++ b/src/model/transfer_sweep_list_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for TransferSweepListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_sweep_status.rs b/src/model/transfer_sweep_status.rs index d02fda22..bcf1b3ac 100644 --- a/src/model/transfer_sweep_status.rs +++ b/src/model/transfer_sweep_status.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct TransferSweepStatus(pub serde_json::Value); \ No newline at end of file +pub struct TransferSweepStatus(pub serde_json::Value); diff --git a/src/model/transfer_test_clock.rs b/src/model/transfer_test_clock.rs index 569e02a3..afc4ceb6 100644 --- a/src/model/transfer_test_clock.rs +++ b/src/model/transfer_test_clock.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for TransferTestClock { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_type.rs b/src/model/transfer_type.rs new file mode 100644 index 00000000..d7e01149 --- /dev/null +++ b/src/model/transfer_type.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The type of transfer. This will be either `debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum TransferType { + #[serde(rename = "debit")] + Debit, + #[serde(rename = "credit")] + Credit, +} diff --git a/src/model/transfer_user_address_in_request.rs b/src/model/transfer_user_address_in_request.rs index 3d0d256f..527b35ff 100644 --- a/src/model/transfer_user_address_in_request.rs +++ b/src/model/transfer_user_address_in_request.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for TransferUserAddressInRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_user_address_in_response.rs b/src/model/transfer_user_address_in_response.rs index 11b686e8..8826b7ed 100644 --- a/src/model/transfer_user_address_in_response.rs +++ b/src/model/transfer_user_address_in_response.rs @@ -22,4 +22,4 @@ impl std::fmt::Display for TransferUserAddressInResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_user_in_request.rs b/src/model/transfer_user_in_request.rs index b18a2f21..9b0a4e48 100644 --- a/src/model/transfer_user_in_request.rs +++ b/src/model/transfer_user_in_request.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for TransferUserInRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_user_in_request_deprecated.rs b/src/model/transfer_user_in_request_deprecated.rs index c061f266..600acb4e 100644 --- a/src/model/transfer_user_in_request_deprecated.rs +++ b/src/model/transfer_user_in_request_deprecated.rs @@ -20,4 +20,4 @@ impl std::fmt::Display for TransferUserInRequestDeprecated { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_user_in_response.rs b/src/model/transfer_user_in_response.rs index 1d69eebc..ca421d31 100644 --- a/src/model/transfer_user_in_response.rs +++ b/src/model/transfer_user_in_response.rs @@ -19,4 +19,4 @@ impl std::fmt::Display for TransferUserInResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/transfer_wire_details.rs b/src/model/transfer_wire_details.rs new file mode 100644 index 00000000..46a8402d --- /dev/null +++ b/src/model/transfer_wire_details.rs @@ -0,0 +1,13 @@ +use serde::{Serialize, Deserialize}; +///Information specific to wire transfers. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TransferWireDetails { + ///Additional information from the wire originator to the beneficiary. Max 140 characters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message_to_beneficiary: Option, +} +impl std::fmt::Display for TransferWireDetails { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/update_entity_screening_request_search_terms.rs b/src/model/update_entity_screening_request_search_terms.rs index 5de18eac..fae2ecb2 100644 --- a/src/model/update_entity_screening_request_search_terms.rs +++ b/src/model/update_entity_screening_request_search_terms.rs @@ -5,15 +5,15 @@ pub struct UpdateEntityScreeningRequestSearchTerms { ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. #[serde(default, skip_serializing_if = "Option::is_none")] pub country: Option, - ///The numeric or alphanumeric identifier associated with this document. + ///The numeric or alphanumeric identifier associated with this document. Must be between 4 and 32 characters long, and cannot have leading or trailing spaces. #[serde(default, skip_serializing_if = "Option::is_none")] pub document_number: Option, - ///A valid email address. + ///A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](https://datatracker.ietf.org/doc/html/rfc3696). #[serde(default, skip_serializing_if = "Option::is_none")] pub email_address: Option, ///ID of the associated entity program. pub entity_watchlist_program_id: String, - ///The name of the organization being screened. + ///The name of the organization being screened. Must have at least one alphabetical character, have a maximum length of 100 characters, and not include leading or trailing spaces. #[serde(default, skip_serializing_if = "Option::is_none")] pub legal_name: Option, ///A phone number in E.164 format. @@ -27,4 +27,4 @@ impl std::fmt::Display for UpdateEntityScreeningRequestSearchTerms { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/update_individual_screening_request_search_terms.rs b/src/model/update_individual_screening_request_search_terms.rs index 779259c0..c5dab58e 100644 --- a/src/model/update_individual_screening_request_search_terms.rs +++ b/src/model/update_individual_screening_request_search_terms.rs @@ -8,10 +8,10 @@ pub struct UpdateIndividualScreeningRequestSearchTerms { ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub date_of_birth: Option, - ///The numeric or alphanumeric identifier associated with this document. + ///The numeric or alphanumeric identifier associated with this document. Must be between 4 and 32 characters long, and cannot have leading or trailing spaces. #[serde(default, skip_serializing_if = "Option::is_none")] pub document_number: Option, - ///The legal name of the individual being screened. + ///The legal name of the individual being screened. Must have at least one alphabetical character, have a maximum length of 100 characters, and not include leading or trailing spaces. #[serde(default, skip_serializing_if = "Option::is_none")] pub legal_name: Option, ///ID of the associated program. @@ -22,4 +22,4 @@ impl std::fmt::Display for UpdateIndividualScreeningRequestSearchTerms { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/user_account_identity.rs b/src/model/user_account_identity.rs new file mode 100644 index 00000000..6bf584dc --- /dev/null +++ b/src/model/user_account_identity.rs @@ -0,0 +1,35 @@ +use serde::{Serialize, Deserialize}; +use super::{UserAccountIdentityAddress, UserAccountIdentityName}; +///The identity data permissioned by the end user during the authorization flow. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct UserAccountIdentity { + ///The user's address. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + ///The user's date of birth. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub date_of_birth: Option, + /**The user's email address. + +Note: email is currently not returned for users, and is an upcoming addition that will be live in early 2025.*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email: Option, + ///The user's first name and last name. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + ///The user's phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: Option, + ///The user's social security number. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ssn: Option, + ///The last 4 digits of the user's social security number. + #[serde(rename = "ssn_last_4")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ssn_last4: Option, +} +impl std::fmt::Display for UserAccountIdentity { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/user_account_identity_address.rs b/src/model/user_account_identity_address.rs new file mode 100644 index 00000000..a128c604 --- /dev/null +++ b/src/model/user_account_identity_address.rs @@ -0,0 +1,30 @@ +use serde::{Serialize, Deserialize}; +///The user's address. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct UserAccountIdentityAddress { + ///The full city name + #[serde(default, skip_serializing_if = "Option::is_none")] + pub city: Option, + ///The ISO 3166-1 alpha-2 country code + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + ///The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + /**The region or state. +Example: `"NC"`*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + /**The full street address +Example: `"564 Main Street, APT 15"`*/ + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street: Option, + ///The second line street address + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street2: Option, +} +impl std::fmt::Display for UserAccountIdentityAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/user_account_identity_name.rs b/src/model/user_account_identity_name.rs new file mode 100644 index 00000000..655c9d92 --- /dev/null +++ b/src/model/user_account_identity_name.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///The user's first name and last name. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct UserAccountIdentityName { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_name: Option, +} +impl std::fmt::Display for UserAccountIdentityName { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/user_account_item.rs b/src/model/user_account_item.rs new file mode 100644 index 00000000..4216f49e --- /dev/null +++ b/src/model/user_account_item.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///An Item created during a Layer authorization session. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct UserAccountItem { + ///The access token associated with the Item data is being requested for. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub access_token: Option, + ///The Plaid Item ID. The `item_id` is always unique; linking the same account at the same institution twice will result in two Items with different `item_id` values. Like all Plaid identifiers, the `item_id` is case-sensitive. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub item_id: Option, +} +impl std::fmt::Display for UserAccountItem { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/user_account_revoked_webhook.rs b/src/model/user_account_revoked_webhook.rs index 6c15796c..a71a040e 100644 --- a/src/model/user_account_revoked_webhook.rs +++ b/src/model/user_account_revoked_webhook.rs @@ -1,13 +1,19 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; -///The `USER_ACCOUNT_REVOKED` webhook is fired when an end user has revoked access to their account on the Data Provider's portal. The user can restore access to the revoked account by regranting permissions on the Data Provider's portal. This webhook is currently in beta. It will be available in GA in Jan 2024. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::{PlaidError, WebhookEnvironmentValues}; +/**The `USER_ACCOUNT_REVOKED` webhook is fired when an end user has revoked access to their account on the Data Provider's portal. This webhook is currently sent only for Chase Items, but may be sent in the future for other financial institutions that allow account-level permissions revocation through their portals. Upon receiving this webhook, it is recommended to delete any Plaid-derived data you have stored that is associated with the revoked account. + +If you are using Auth and receive this webhook, this webhook indicates that the TAN associated with the revoked account is no longer valid and cannot be used to create new transfers. You should not create new ACH transfers for the account that was revoked until access has been re-granted. + +You can request the user to re-grant access to their account by sending them through [update mode](https://www.plaid.com/docs/link/update-mode). Alternatively, they may re-grant access directly through the Data Provider's portal. + +After the user has re-granted access, Auth customers should call the auth endpoint again to obtain the new TAN.*/ +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct UserAccountRevokedWebhook { ///The external account ID of the affected account pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -21,4 +27,4 @@ impl std::fmt::Display for UserAccountRevokedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/user_account_session_get_response.rs b/src/model/user_account_session_get_response.rs new file mode 100644 index 00000000..eff8051b --- /dev/null +++ b/src/model/user_account_session_get_response.rs @@ -0,0 +1,18 @@ +use serde::{Serialize, Deserialize}; +use super::{UserAccountIdentity, UserAccountItem}; +///UserAccountSessionGetResponse defines the response schema for `/user_account/session/get` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct UserAccountSessionGetResponse { + ///The identity data permissioned by the end user during the authorization flow. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub identity: Option, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub items: Vec, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for UserAccountSessionGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/user_address.rs b/src/model/user_address.rs index f9a45d56..9070bca3 100644 --- a/src/model/user_address.rs +++ b/src/model/user_address.rs @@ -4,7 +4,7 @@ use serde::{Serialize, Deserialize}; For more context on this field, see [Input Validation by Country](https://plaid.com/docs/identity-verification/hybrid-input-validation/#input-validation-by-country).*/ #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct UserAddress { - ///City from the end user's address + ///City from the end user's address. A string with at least one non-whitespace alphabetical character, with a max length of 100 characters." #[serde(default, skip_serializing_if = "Option::is_none")] pub city: Option, ///Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. @@ -15,10 +15,10 @@ pub struct UserAddress { ///An ISO 3166-2 subdivision code. Related terms would be "state", "province", "prefecture", "zone", "subdivision", etc. #[serde(default, skip_serializing_if = "Option::is_none")] pub region: Option, - ///The primary street portion of an address. If an address is provided, this field will always be filled. + ///The primary street portion of an address. If an address is provided, this field will always be filled. A string with at least one non-whitespace alphabetical character, with a max length of 80 characters. #[serde(default, skip_serializing_if = "Option::is_none")] pub street: Option, - ///Extra street information, like an apartment or suite number. + ///Extra street information, like an apartment or suite number. If provided, a string with at least one non-whitespace character, with a max length of 50 characters. #[serde(default, skip_serializing_if = "Option::is_none")] pub street2: Option, } @@ -26,4 +26,4 @@ impl std::fmt::Display for UserAddress { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/user_create_response.rs b/src/model/user_create_response.rs index c5b6d359..b7489fa1 100644 --- a/src/model/user_create_response.rs +++ b/src/model/user_create_response.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for UserCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/user_data_overview.rs b/src/model/user_data_overview.rs index ba3b32ba..ffae92a3 100644 --- a/src/model/user_data_overview.rs +++ b/src/model/user_data_overview.rs @@ -21,4 +21,4 @@ impl std::fmt::Display for UserDataOverview { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/user_id_number.rs b/src/model/user_id_number.rs index ffd9019a..c3ee16d8 100644 --- a/src/model/user_id_number.rs +++ b/src/model/user_id_number.rs @@ -1,15 +1,16 @@ use serde::{Serialize, Deserialize}; +use super::IdNumberType; ///ID number submitted by the user, currently used only for the Identity Verification product. If the user has not submitted this data yet, this field will be `null`. Otherwise, both fields are guaranteed to be filled. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct UserIdNumber { ///A globally unique and human readable ID type, specific to the country and document category. For more context on this field, see [Hybrid Input Validation](https://plaid.com/docs/identity-verification/hybrid-input-validation). #[serde(rename = "type")] - pub type_: String, - ///Value of identity document value typed in by user. Alpha-numeric, with all formatting characters stripped. + pub type_: IdNumberType, + ///Value of identity document value typed in by user. Alpha-numeric, with all formatting characters stripped. For specific format requirements by ID type, see [Hybrid Input Validation](https://plaid.com/docs/identity-verification/hybrid-input-validation/). pub value: String, } impl std::fmt::Display for UserIdNumber { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/user_items_get_response.rs b/src/model/user_items_get_response.rs new file mode 100644 index 00000000..2b1e17fe --- /dev/null +++ b/src/model/user_items_get_response.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +use super::Item; +///UserItemsGetResponse defines the response schema for `/user/items/get` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct UserItemsGetResponse { + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub items: Vec, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for UserItemsGetResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/user_permission_revoked_webhook.rs b/src/model/user_permission_revoked_webhook.rs index 81f73ea9..583f8132 100644 --- a/src/model/user_permission_revoked_webhook.rs +++ b/src/model/user_permission_revoked_webhook.rs @@ -1,11 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; -///The `USER_PERMISSION_REVOKED` webhook may be fired when an end user has used either the [my.plaid.com portal](https://my.plaid.com) or the financial institution’s OAuth consent portal to revoke the permission that they previously granted to access an Item. This webhook is not guaranteed to always be fired upon consent revocation, since some institutions’ consent portals do not trigger this webhook. Once access to an Item has been revoked, it cannot be restored. If the user subsequently returns to your application, a new Item must be created for the user. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +use super::{PlaidError, WebhookEnvironmentValues}; +/**The `USER_PERMISSION_REVOKED` webhook may be fired when an end user has revoked the permission that they previously granted to access an Item. If the end user revoked their permissions through Plaid (such as via the Plaid Portal or by contacting Plaid Support), the webhook will fire. If the end user revoked their permissions directly through the institution, this webhook may not always fire, since some institutions’ consent portals do not trigger this webhook. Upon receiving this webhook, it is recommended to delete any stored data from Plaid associated with the Item. To restore the Item, it can be sent through [update mode](https://plaid.com/docs/link/update-mode). + +Note that when working with tokenized account numbers with Auth or Transfer, the account number provided by Plaid will no longer work for creating transfers once user permission has been revoked.*/ +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct UserPermissionRevokedWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -19,4 +21,4 @@ impl std::fmt::Display for UserPermissionRevokedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/user_remove_response.rs b/src/model/user_remove_response.rs new file mode 100644 index 00000000..0817064c --- /dev/null +++ b/src/model/user_remove_response.rs @@ -0,0 +1,12 @@ +use serde::{Serialize, Deserialize}; +///UserRemoveResponse defines the response schema for `/user/remove` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct UserRemoveResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for UserRemoveResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/user_stated_income_source_category.rs b/src/model/user_stated_income_source_category.rs new file mode 100644 index 00000000..114ea741 --- /dev/null +++ b/src/model/user_stated_income_source_category.rs @@ -0,0 +1,27 @@ +use serde::{Serialize, Deserialize}; +///The income category for a specified income source +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum UserStatedIncomeSourceCategory { + #[serde(rename = "OTHER")] + Other, + #[serde(rename = "SALARY")] + Salary, + #[serde(rename = "UNEMPLOYMENT")] + Unemployment, + #[serde(rename = "CASH")] + Cash, + #[serde(rename = "GIG_ECONOMY")] + GigEconomy, + #[serde(rename = "RENTAL")] + Rental, + #[serde(rename = "CHILD_SUPPORT")] + ChildSupport, + #[serde(rename = "MILITARY")] + Military, + #[serde(rename = "RETIREMENT")] + Retirement, + #[serde(rename = "LONG_TERM_DISABILITY")] + LongTermDisability, + #[serde(rename = "BANK_INTEREST")] + BankInterest, +} diff --git a/src/model/user_stated_income_source_frequency.rs b/src/model/user_stated_income_source_frequency.rs new file mode 100644 index 00000000..878ddfb3 --- /dev/null +++ b/src/model/user_stated_income_source_frequency.rs @@ -0,0 +1,15 @@ +use serde::{Serialize, Deserialize}; +///The pay frequency of a specified income source +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum UserStatedIncomeSourceFrequency { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "WEEKLY")] + Weekly, + #[serde(rename = "BIWEEKLY")] + Biweekly, + #[serde(rename = "SEMI_MONTHLY")] + SemiMonthly, + #[serde(rename = "MONTHLY")] + Monthly, +} diff --git a/src/model/user_stated_income_source_pay_type.rs b/src/model/user_stated_income_source_pay_type.rs new file mode 100644 index 00000000..cd11f79d --- /dev/null +++ b/src/model/user_stated_income_source_pay_type.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///The pay type - `GROSS`, `NET`, or `UNKNOWN` for a specified income source +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum UserStatedIncomeSourcePayType { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "GROSS")] + Gross, + #[serde(rename = "NET")] + Net, +} diff --git a/src/model/user_third_party_token_create_response.rs b/src/model/user_third_party_token_create_response.rs new file mode 100644 index 00000000..2fd0b205 --- /dev/null +++ b/src/model/user_third_party_token_create_response.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///UserThirdPartyTokenCreateResponse defines the response schema for `/user/third_party_token/create` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct UserThirdPartyTokenCreateResponse { + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, + ///The third-party user token associated with the requested User data. + pub third_party_user_token: String, +} +impl std::fmt::Display for UserThirdPartyTokenCreateResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/user_third_party_token_remove_response.rs b/src/model/user_third_party_token_remove_response.rs new file mode 100644 index 00000000..854b3d13 --- /dev/null +++ b/src/model/user_third_party_token_remove_response.rs @@ -0,0 +1,14 @@ +use serde::{Serialize, Deserialize}; +///UserThirdPartyTokenCreateResponse defines the response schema for `/user/third_party_token/remove` +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct UserThirdPartyTokenRemoveResponse { + ///`true` if the third-party user token was successfully removed. + pub removed: bool, + ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. + pub request_id: String, +} +impl std::fmt::Display for UserThirdPartyTokenRemoveResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/user_update_response.rs b/src/model/user_update_response.rs index f15709b5..bbc0da0e 100644 --- a/src/model/user_update_response.rs +++ b/src/model/user_update_response.rs @@ -9,4 +9,4 @@ impl std::fmt::Display for UserUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/validation_source.rs b/src/model/validation_source.rs index 2beeee10..ef1356bd 100644 --- a/src/model/validation_source.rs +++ b/src/model/validation_source.rs @@ -15,4 +15,4 @@ impl std::fmt::Display for ValidationSource { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/validation_sources.rs b/src/model/validation_sources.rs index 307a6121..fae64933 100644 --- a/src/model/validation_sources.rs +++ b/src/model/validation_sources.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for ValidationSources { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/verification_expired_webhook.rs b/src/model/verification_expired_webhook.rs index 62ac1a86..bfc24790 100644 --- a/src/model/verification_expired_webhook.rs +++ b/src/model/verification_expired_webhook.rs @@ -1,13 +1,13 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired when an Item was not verified via automated micro-deposits after seven days since the automated micro-deposit was made. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct VerificationExpiredWebhook { ///The `account_id` of the account associated with the webhook pub account_id: String, ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -21,4 +21,4 @@ impl std::fmt::Display for VerificationExpiredWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/verification_of_asset.rs b/src/model/verification_of_asset.rs index cbd6b5e5..d48b60a4 100644 --- a/src/model/verification_of_asset.rs +++ b/src/model/verification_of_asset.rs @@ -3,7 +3,7 @@ use super::{ ReportingInformation, ServiceProductFulfillment, VerificationOfAssetResponse, }; ///Documentation not found in the MISMO model viewer and not provided by Freddie Mac. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct VerificationOfAsset { ///Information about an report identifier and a report name. #[serde(rename = "REPORTING_INFORMATION")] @@ -19,4 +19,4 @@ impl std::fmt::Display for VerificationOfAsset { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/verification_of_asset_response.rs b/src/model/verification_of_asset_response.rs index 956859c2..95ec282a 100644 --- a/src/model/verification_of_asset_response.rs +++ b/src/model/verification_of_asset_response.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for VerificationOfAssetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/verification_status.rs b/src/model/verification_status.rs new file mode 100644 index 00000000..5e85af67 --- /dev/null +++ b/src/model/verification_status.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +/**The verification status. One of the following: + +`"VERIFIED"`: The information was successfully verified. + +`"UNVERIFIED"`: The verification has not yet been performed. + +`"NEEDS_INFO"`: The verification was attempted but could not be completed due to missing information. + +"`UNABLE_TO_VERIFY`": The verification was performed and the information could not be verified. + +`"UNKNOWN"`: The verification status is unknown.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum VerificationStatus { + #[serde(rename = "VERIFIED")] + Verified, + #[serde(rename = "UNVERIFIED")] + Unverified, + #[serde(rename = "NEEDS_INFO")] + NeedsInfo, + #[serde(rename = "UNABLE_TO_VERIFY")] + UnableToVerify, + #[serde(rename = "UNKNOWN")] + Unknown, +} diff --git a/src/model/verify_sms_details.rs b/src/model/verify_sms_details.rs new file mode 100644 index 00000000..a29c58cb --- /dev/null +++ b/src/model/verify_sms_details.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +use super::{SmsVerification, VerifySmsDetailsStatus}; +///Additional information for the `verify_sms` step. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct VerifySmsDetails { + ///The outcome status for the associated Identity Verification attempt's `verify_sms` step. This field will always have the same value as `steps.verify_sms`. + pub status: VerifySmsDetailsStatus, + ///An array where each entry represents a verification attempt for the `verify_sms` step. Each entry represents one user-submitted phone number. Phone number edits, and in some cases error handling due to edge cases like rate limiting, may generate additional verifications. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub verifications: Vec, +} +impl std::fmt::Display for VerifySmsDetails { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/verify_sms_details_status.rs b/src/model/verify_sms_details_status.rs new file mode 100644 index 00000000..3d41dc6a --- /dev/null +++ b/src/model/verify_sms_details_status.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The outcome status for the associated Identity Verification attempt's `verify_sms` step. This field will always have the same value as `steps.verify_sms`. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum VerifySmsDetailsStatus { + #[serde(rename = "success")] + Success, + #[serde(rename = "failed")] + Failed, +} diff --git a/src/model/w2.rs b/src/model/w2.rs index 3a6eccdd..f455d364 100644 --- a/src/model/w2.rs +++ b/src/model/w2.rs @@ -71,4 +71,4 @@ impl std::fmt::Display for W2 { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/w2_box12.rs b/src/model/w2_box12.rs index 26767ebc..2ad8fb4c 100644 --- a/src/model/w2_box12.rs +++ b/src/model/w2_box12.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for W2Box12 { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/w2_box12_override.rs b/src/model/w2_box12_override.rs new file mode 100644 index 00000000..4158dce2 --- /dev/null +++ b/src/model/w2_box12_override.rs @@ -0,0 +1,16 @@ +use serde::{Serialize, Deserialize}; +///Data on the W2 Box 12 +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct W2Box12Override { + ///W2 Box 12 amount. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub amount: Option, + ///W2 Box 12 code. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub code: Option, +} +impl std::fmt::Display for W2Box12Override { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/w2_override.rs b/src/model/w2_override.rs new file mode 100644 index 00000000..710120c2 --- /dev/null +++ b/src/model/w2_override.rs @@ -0,0 +1,77 @@ +use serde::{Serialize, Deserialize}; +use super::{ + PaystubOverrideEmployee, PaystubOverrideEmployer, W2Box12Override, + W2StateAndLocalWagesOverride, +}; +///W2 is an object that represents income data taken from a W2 tax document. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct W2Override { + ///Allocated tips. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub allocated_tips: Option, + #[serde(rename = "box_12")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub box12: Option>, + ///Contents from box 9 on the W2. + #[serde(rename = "box_9")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub box9: Option, + ///Dependent care benefits. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dependent_care_benefits: Option, + ///The employee on the paystub. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub employee: Option, + ///The employer on the paystub. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub employer: Option, + ///An employer identification number or EIN. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub employer_id_number: Option, + ///Federal income tax withheld for the tax year. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub federal_income_tax_withheld: Option, + ///Medicare tax withheld for the tax year. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub medicare_tax_withheld: Option, + ///Wages and tips from medicare. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub medicare_wages_and_tips: Option, + ///Nonqualified plans. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nonqualified_plans: Option, + ///Other. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub other: Option, + ///Retirement plan. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub retirement_plan: Option, + ///Social security tax withheld for the tax year. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub social_security_tax_withheld: Option, + ///Tips from social security. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub social_security_tips: Option, + ///Wages from social security. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub social_security_wages: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state_and_local_wages: Option>, + ///Statutory employee. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub statutory_employee: Option, + ///The tax year of the W2 document. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tax_year: Option, + ///Third party sick pay. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub third_party_sick_pay: Option, + ///Wages from tips and other compensation. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wages_tips_other_comp: Option, +} +impl std::fmt::Display for W2Override { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/w2_state_and_local_wages.rs b/src/model/w2_state_and_local_wages.rs index e3e59285..c4f8b342 100644 --- a/src/model/w2_state_and_local_wages.rs +++ b/src/model/w2_state_and_local_wages.rs @@ -28,4 +28,4 @@ impl std::fmt::Display for W2StateAndLocalWages { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/w2_state_and_local_wages_override.rs b/src/model/w2_state_and_local_wages_override.rs new file mode 100644 index 00000000..59370cc0 --- /dev/null +++ b/src/model/w2_state_and_local_wages_override.rs @@ -0,0 +1,31 @@ +use serde::{Serialize, Deserialize}; +///W2 state and local wages +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct W2StateAndLocalWagesOverride { + ///State identification number of the employer. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub employer_state_id_number: Option, + ///Income tax from the locality. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub local_income_tax: Option, + ///Wages and tips from the locality. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub local_wages_tips: Option, + ///Name of the locality. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality_name: Option, + ///State associated with the wage. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + ///Income tax from the specified state. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state_income_tax: Option, + ///Wages and tips from the specified state. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state_wages_tips: Option, +} +impl std::fmt::Display for W2StateAndLocalWagesOverride { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/wallet.rs b/src/model/wallet.rs index 8d4c1d56..c3257bce 100644 --- a/src/model/wallet.rs +++ b/src/model/wallet.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::{WalletBalance, WalletNumbers}; +use super::{WalletBalance, WalletNumbers, WalletStatus}; ///An object representing the e-wallet -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Wallet { ///An object representing the e-wallet balance pub balance: WalletBalance, @@ -17,7 +17,7 @@ pub struct Wallet { `ACTIVE`: The wallet is active and ready to send money to and receive money from. `CLOSED`: The wallet is closed. Any transactions made to or from this wallet will error.*/ - pub status: String, + pub status: WalletStatus, ///A unique ID identifying the e-wallet pub wallet_id: String, } @@ -25,4 +25,4 @@ impl std::fmt::Display for Wallet { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_balance.rs b/src/model/wallet_balance.rs index b3138018..066d6317 100644 --- a/src/model/wallet_balance.rs +++ b/src/model/wallet_balance.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for WalletBalance { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_create_response.rs b/src/model/wallet_create_response.rs index 3596f012..2f88318b 100644 --- a/src/model/wallet_create_response.rs +++ b/src/model/wallet_create_response.rs @@ -1,9 +1,2 @@ use serde::{Serialize, Deserialize}; -///WalletCreateResponse defines the response schema for `/wallet/create` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct WalletCreateResponse {} -impl std::fmt::Display for WalletCreateResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type WalletCreateResponse = serde_json::Value; diff --git a/src/model/wallet_get_response.rs b/src/model/wallet_get_response.rs index d1929587..8dca1b7f 100644 --- a/src/model/wallet_get_response.rs +++ b/src/model/wallet_get_response.rs @@ -1,9 +1,2 @@ use serde::{Serialize, Deserialize}; -///WalletGetResponse defines the response schema for `/wallet/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct WalletGetResponse {} -impl std::fmt::Display for WalletGetResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type WalletGetResponse = serde_json::Value; diff --git a/src/model/wallet_iso_currency_code.rs b/src/model/wallet_iso_currency_code.rs new file mode 100644 index 00000000..e47ed118 --- /dev/null +++ b/src/model/wallet_iso_currency_code.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///An ISO-4217 currency code, used with e-wallets and transactions. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WalletIsoCurrencyCode { + #[serde(rename = "GBP")] + Gbp, + #[serde(rename = "EUR")] + Eur, +} diff --git a/src/model/wallet_list_response.rs b/src/model/wallet_list_response.rs index 7c0af47f..b040fc0e 100644 --- a/src/model/wallet_list_response.rs +++ b/src/model/wallet_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WalletListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_numbers.rs b/src/model/wallet_numbers.rs index c02a0c5f..6a562f66 100644 --- a/src/model/wallet_numbers.rs +++ b/src/model/wallet_numbers.rs @@ -14,4 +14,4 @@ impl std::fmt::Display for WalletNumbers { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_payment_scheme.rs b/src/model/wallet_payment_scheme.rs index ee597da3..ff803fbd 100644 --- a/src/model/wallet_payment_scheme.rs +++ b/src/model/wallet_payment_scheme.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct WalletPaymentScheme(pub serde_json::Value); \ No newline at end of file +pub struct WalletPaymentScheme(pub serde_json::Value); diff --git a/src/model/wallet_status.rs b/src/model/wallet_status.rs new file mode 100644 index 00000000..404c5774 --- /dev/null +++ b/src/model/wallet_status.rs @@ -0,0 +1,17 @@ +use serde::{Serialize, Deserialize}; +/**The status of the wallet. + +`UNKNOWN`: The wallet status is unknown. + +`ACTIVE`: The wallet is active and ready to send money to and receive money from. + +`CLOSED`: The wallet is closed. Any transactions made to or from this wallet will error.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WalletStatus { + #[serde(rename = "UNKNOWN")] + Unknown, + #[serde(rename = "ACTIVE")] + Active, + #[serde(rename = "CLOSED")] + Closed, +} diff --git a/src/model/wallet_transaction.rs b/src/model/wallet_transaction.rs index 01da64d9..79b831a2 100644 --- a/src/model/wallet_transaction.rs +++ b/src/model/wallet_transaction.rs @@ -1,7 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::{WalletPaymentScheme, WalletTransactionAmount, WalletTransactionCounterparty}; +use super::{ + WalletPaymentScheme, WalletTransactionAmount, WalletTransactionCounterparty, + WalletTransactionFailureReason, WalletTransactionRelation, WalletTransactionStatus, +}; ///The transaction details -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WalletTransaction { ///The amount and currency of a transaction pub amount: WalletTransactionAmount, @@ -16,7 +19,7 @@ pub struct WalletTransaction { `INVALID`: The transaction did not meet certain criteria, such as an inactive account or no valid counterparty, etc. `UNKNOWN`: The transaction was unsuccessful, but the exact cause is unknown.*/ #[serde(default, skip_serializing_if = "Option::is_none")] - pub failure_reason: Option, + pub failure_reason: Option, ///The date and time of the last time the `status` was updated, in IS0 8601 format pub last_status_update: chrono::DateTime, ///The payment id that this transaction is associated with, if any. This is present only for transaction types `PIS_PAY_IN` and `REFUND`. @@ -24,6 +27,9 @@ pub struct WalletTransaction { pub payment_id: Option, ///A reference for the transaction pub reference: String, + ///A list of wallet transactions that this transaction is associated with, if any. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub related_transactions: Option>, /**The payment scheme used to execute this transaction. This is present only for transaction types `PAYOUT` and `REFUND`. `FASTER_PAYMENTS`: The standard payment scheme within the UK. @@ -46,7 +52,7 @@ pub struct WalletTransaction { `FAILED`: The transaction failed to process successfully. This is a terminal status. `BLOCKED`: The transaction has been blocked for violating compliance rules. This is a terminal status.*/ - pub status: String, + pub status: WalletTransactionStatus, ///A unique ID identifying the transaction pub transaction_id: String, /**The type of the transaction. The supported transaction types that are returned are: @@ -60,7 +66,9 @@ pub struct WalletTransaction { `FUNDS_SWEEP`: an automated transaction which debits funds from an e-wallet to a designated client-owned account. -`RETURN`: an automated transaction where a debit transaction was reversed and money moved back to originating account.*/ +`RETURN`: an automated transaction where a debit transaction was reversed and money moved back to originating account. + +`RECALL`: a transaction where the sending bank has requested the return of funds due to a fraud claim, technical error, or other issue associated with the payment.*/ #[serde(rename = "type")] pub type_: String, ///The EMI (E-Money Institution) wallet that this payment is associated with, if any. This wallet is used as an intermediary account to enable Plaid to reconcile the settlement of funds for Payment Initiation requests. @@ -70,4 +78,4 @@ impl std::fmt::Display for WalletTransaction { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_transaction_amount.rs b/src/model/wallet_transaction_amount.rs index 102aa0ea..fe31c5c8 100644 --- a/src/model/wallet_transaction_amount.rs +++ b/src/model/wallet_transaction_amount.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::WalletIsoCurrencyCode; ///The amount and currency of a transaction -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WalletTransactionAmount { ///An ISO-4217 currency code, used with e-wallets and transactions. - pub iso_currency_code: String, + pub iso_currency_code: WalletIsoCurrencyCode, ///The amount of the transaction. Must contain at most two digits of precision e.g. `1.23`. pub value: f64, } @@ -11,4 +12,4 @@ impl std::fmt::Display for WalletTransactionAmount { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_transaction_counterparty.rs b/src/model/wallet_transaction_counterparty.rs index 47faeb91..cffc8739 100644 --- a/src/model/wallet_transaction_counterparty.rs +++ b/src/model/wallet_transaction_counterparty.rs @@ -18,4 +18,4 @@ impl std::fmt::Display for WalletTransactionCounterparty { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_transaction_counterparty_bacs.rs b/src/model/wallet_transaction_counterparty_bacs.rs index 9ee4e1f5..0622a07f 100644 --- a/src/model/wallet_transaction_counterparty_bacs.rs +++ b/src/model/wallet_transaction_counterparty_bacs.rs @@ -1,3 +1,3 @@ use serde::{Serialize, Deserialize}; use super::RecipientBacs; -pub type WalletTransactionCounterpartyBacs = RecipientBacs; \ No newline at end of file +pub type WalletTransactionCounterpartyBacs = RecipientBacs; diff --git a/src/model/wallet_transaction_counterparty_international.rs b/src/model/wallet_transaction_counterparty_international.rs index a782be52..cd54a059 100644 --- a/src/model/wallet_transaction_counterparty_international.rs +++ b/src/model/wallet_transaction_counterparty_international.rs @@ -10,4 +10,4 @@ impl std::fmt::Display for WalletTransactionCounterpartyInternational { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_transaction_counterparty_numbers.rs b/src/model/wallet_transaction_counterparty_numbers.rs index 9dd58dba..e707809e 100644 --- a/src/model/wallet_transaction_counterparty_numbers.rs +++ b/src/model/wallet_transaction_counterparty_numbers.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WalletTransactionCounterpartyNumbers { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_transaction_execute_response.rs b/src/model/wallet_transaction_execute_response.rs index 0ca2024c..b035cc32 100644 --- a/src/model/wallet_transaction_execute_response.rs +++ b/src/model/wallet_transaction_execute_response.rs @@ -1,6 +1,7 @@ use serde::{Serialize, Deserialize}; +use super::WalletTransactionStatus; ///WalletTransactionExecuteResponse defines the response schema for `/wallet/transaction/execute` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WalletTransactionExecuteResponse { ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, @@ -17,7 +18,7 @@ pub struct WalletTransactionExecuteResponse { `FAILED`: The transaction failed to process successfully. This is a terminal status. `BLOCKED`: The transaction has been blocked for violating compliance rules. This is a terminal status.*/ - pub status: String, + pub status: WalletTransactionStatus, ///A unique ID identifying the transaction pub transaction_id: String, } @@ -25,4 +26,4 @@ impl std::fmt::Display for WalletTransactionExecuteResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_transaction_failure_reason.rs b/src/model/wallet_transaction_failure_reason.rs new file mode 100644 index 00000000..12249727 --- /dev/null +++ b/src/model/wallet_transaction_failure_reason.rs @@ -0,0 +1,20 @@ +use serde::{Serialize, Deserialize}; +/**The error code of a failed transaction. Error codes include: +`EXTERNAL_SYSTEM`: The transaction was declined by an external system. +`EXPIRED`: The transaction request has expired. +`CANCELLED`: The transaction request was rescinded. +`INVALID`: The transaction did not meet certain criteria, such as an inactive account or no valid counterparty, etc. +`UNKNOWN`: The transaction was unsuccessful, but the exact cause is unknown.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WalletTransactionFailureReason { + #[serde(rename = "EXTERNAL_SYSTEM")] + ExternalSystem, + #[serde(rename = "EXPIRED")] + Expired, + #[serde(rename = "CANCELLED")] + Cancelled, + #[serde(rename = "INVALID")] + Invalid, + #[serde(rename = "UNKNOWN")] + Unknown, +} diff --git a/src/model/wallet_transaction_get_response.rs b/src/model/wallet_transaction_get_response.rs index a1c3b6a9..b7b34da4 100644 --- a/src/model/wallet_transaction_get_response.rs +++ b/src/model/wallet_transaction_get_response.rs @@ -1,9 +1,2 @@ use serde::{Serialize, Deserialize}; -///WalletTransactionGetResponse defines the response schema for `/wallet/transaction/get` -#[derive(Debug, Clone, Serialize, Deserialize, Default)] -pub struct WalletTransactionGetResponse {} -impl std::fmt::Display for WalletTransactionGetResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "{}", serde_json::to_string(self).unwrap()) - } -} \ No newline at end of file +pub type WalletTransactionGetResponse = serde_json::Value; diff --git a/src/model/wallet_transaction_list_request_options.rs b/src/model/wallet_transaction_list_request_options.rs index d720e424..170cfc48 100644 --- a/src/model/wallet_transaction_list_request_options.rs +++ b/src/model/wallet_transaction_list_request_options.rs @@ -13,4 +13,4 @@ impl std::fmt::Display for WalletTransactionListRequestOptions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_transaction_list_response.rs b/src/model/wallet_transaction_list_response.rs index ae092dc4..1c505174 100644 --- a/src/model/wallet_transaction_list_response.rs +++ b/src/model/wallet_transaction_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WalletTransactionListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/wallet_transaction_relation.rs b/src/model/wallet_transaction_relation.rs new file mode 100644 index 00000000..c51e1168 --- /dev/null +++ b/src/model/wallet_transaction_relation.rs @@ -0,0 +1,25 @@ +use serde::{Serialize, Deserialize}; +/**Transactions are related when they have a logical connection. + +For example, a `PAYOUT` transaction can be returned by the sender, creating a `RETURN` transaction. Each `PAYOUT` transaction can have at most one corresponding `RETURN` transaction in case of reversal. + +These relationships are bi-directional, meaning that both entities have references to each other. For instance, when a transaction of type RETURN occurs, it is linked to the original transaction being returned. Likewise, the original transaction has a reference back to the RETURN transaction that represents the return. + +This field is only populated for transactions of type `RETURN`, `FUNDS_SWEEP`, `REFUND` and `PAYOUT`. + +The relationship between a `PIS_PAY_IN` payment and its corresponding `REFUND` transactions is only available through `refund_ids` property in the payment object. See[`/payment_initiation/payment/get`](https://plaid.com/docs/api/products/payment-initiation/#payment_initiation-payment-get-response-refund-ids).*/ +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct WalletTransactionRelation { + ///The ID of the related transaction. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + ///The type of the transaction. + #[serde(rename = "type")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl std::fmt::Display for WalletTransactionRelation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!(f, "{}", serde_json::to_string(self).unwrap()) + } +} diff --git a/src/model/wallet_transaction_status.rs b/src/model/wallet_transaction_status.rs new file mode 100644 index 00000000..1b037182 --- /dev/null +++ b/src/model/wallet_transaction_status.rs @@ -0,0 +1,29 @@ +use serde::{Serialize, Deserialize}; +/**The status of the transaction. + +`AUTHORISING`: The transaction is being processed for validation and compliance. + +`INITIATED`: The transaction has been initiated and is currently being processed. + +`EXECUTED`: The transaction has been successfully executed and is considered complete. This is only applicable for debit transactions. + +`SETTLED`: The transaction has settled and funds are available for use. This is only applicable for credit transactions. A transaction will typically settle within seconds to several days, depending on which payment rail is used. + +`FAILED`: The transaction failed to process successfully. This is a terminal status. + +`BLOCKED`: The transaction has been blocked for violating compliance rules. This is a terminal status.*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WalletTransactionStatus { + #[serde(rename = "AUTHORISING")] + Authorising, + #[serde(rename = "INITIATED")] + Initiated, + #[serde(rename = "EXECUTED")] + Executed, + #[serde(rename = "SETTLED")] + Settled, + #[serde(rename = "BLOCKED")] + Blocked, + #[serde(rename = "FAILED")] + Failed, +} diff --git a/src/model/wallet_transaction_status_update_webhook.rs b/src/model/wallet_transaction_status_update_webhook.rs index 4e826f70..563d74a1 100644 --- a/src/model/wallet_transaction_status_update_webhook.rs +++ b/src/model/wallet_transaction_status_update_webhook.rs @@ -1,9 +1,10 @@ use serde::{Serialize, Deserialize}; +use super::{WalletTransactionStatus, WebhookEnvironmentValues}; ///Fired when the status of a wallet transaction has changed. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WalletTransactionStatusUpdateWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, + pub environment: WebhookEnvironmentValues, /**The status of the transaction. `AUTHORISING`: The transaction is being processed for validation and compliance. @@ -17,7 +18,7 @@ pub struct WalletTransactionStatusUpdateWebhook { `FAILED`: The transaction failed to process successfully. This is a terminal status. `BLOCKED`: The transaction has been blocked for violating compliance rules. This is a terminal status.*/ - pub new_status: String, + pub new_status: WalletTransactionStatus, /**The status of the transaction. `AUTHORISING`: The transaction is being processed for validation and compliance. @@ -31,7 +32,7 @@ pub struct WalletTransactionStatusUpdateWebhook { `FAILED`: The transaction failed to process successfully. This is a terminal status. `BLOCKED`: The transaction has been blocked for violating compliance rules. This is a terminal status.*/ - pub old_status: String, + pub old_status: WalletTransactionStatus, ///The `payment_id` associated with the transaction. This will be present in case of `REFUND` and `PIS_PAY_IN`. #[serde(default, skip_serializing_if = "Option::is_none")] pub payment_id: Option, @@ -51,4 +52,4 @@ impl std::fmt::Display for WalletTransactionStatusUpdateWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/warning.rs b/src/model/warning.rs index c9c7ea00..1654435d 100644 --- a/src/model/warning.rs +++ b/src/model/warning.rs @@ -4,7 +4,8 @@ use super::Cause; #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct Warning { ///An error object and associated `item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items. - pub cause: Cause, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cause: Option, ///The warning code identifies a specific kind of warning. `OWNERS_UNAVAILABLE` indicates that account-owner information is not available.`INVESTMENTS_UNAVAILABLE` indicates that Investments specific information is not available. `TRANSACTIONS_UNAVAILABLE` indicates that transactions information associated with Credit and Depository accounts are unavailable. pub warning_code: String, ///The warning type, which will always be `ASSET_REPORT_WARNING` @@ -14,4 +15,4 @@ impl std::fmt::Display for Warning { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_audit_trail.rs b/src/model/watchlist_screening_audit_trail.rs index 515fd999..edeac373 100644 --- a/src/model/watchlist_screening_audit_trail.rs +++ b/src/model/watchlist_screening_audit_trail.rs @@ -1,12 +1,13 @@ use serde::{Serialize, Deserialize}; +use super::Source; ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningAuditTrail { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub dashboard_user_id: Option, ///A type indicating whether a dashboard user, an API-based user, or Plaid last touched this object. - pub source: String, + pub source: Source, ///An ISO8601 formatted timestamp. pub timestamp: chrono::DateTime, } @@ -14,4 +15,4 @@ impl std::fmt::Display for WatchlistScreeningAuditTrail { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_document.rs b/src/model/watchlist_screening_document.rs index d450dd5e..8118bba8 100644 --- a/src/model/watchlist_screening_document.rs +++ b/src/model/watchlist_screening_document.rs @@ -1,8 +1,9 @@ use serde::{Serialize, Deserialize}; +use super::WatchlistScreeningDocumentType; ///An official document, usually issued by a governing body or institution, with an associated identifier. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningDocument { - ///The numeric or alphanumeric identifier associated with this document. + ///The numeric or alphanumeric identifier associated with this document. Must be between 4 and 32 characters long, and cannot have leading or trailing spaces. pub number: String, /**The kind of official document represented by this object. @@ -32,10 +33,10 @@ pub struct WatchlistScreeningDocument { `voter_id` - Identification issued for the purpose of voting*/ #[serde(rename = "type")] - pub type_: String, + pub type_: WatchlistScreeningDocumentType, } impl std::fmt::Display for WatchlistScreeningDocument { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_document_type.rs b/src/model/watchlist_screening_document_type.rs new file mode 100644 index 00000000..dfb74429 --- /dev/null +++ b/src/model/watchlist_screening_document_type.rs @@ -0,0 +1,57 @@ +use serde::{Serialize, Deserialize}; +/**The kind of official document represented by this object. + +`birth_certificate` - A certificate of birth + +`drivers_license` - A license to operate a motor vehicle + +`immigration_number` - Immigration or residence documents + +`military_id` - Identification issued by a military group + +`other` - Any document not covered by other categories + +`passport` - An official passport issue by a government + +`personal_identification` - Any generic personal identification that is not covered by other categories + +`ration_card` - Identification that entitles the holder to rations + +`ssn` - United States Social Security Number + +`student_id` - Identification issued by an educational institution + +`tax_id` - Identification issued for the purpose of collecting taxes + +`travel_document` - Visas, entry permits, refugee documents, etc. + +`voter_id` - Identification issued for the purpose of voting*/ +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WatchlistScreeningDocumentType { + #[serde(rename = "birth_certificate")] + BirthCertificate, + #[serde(rename = "drivers_license")] + DriversLicense, + #[serde(rename = "immigration_number")] + ImmigrationNumber, + #[serde(rename = "military_id")] + MilitaryId, + #[serde(rename = "other")] + Other, + #[serde(rename = "passport")] + Passport, + #[serde(rename = "personal_identification")] + PersonalIdentification, + #[serde(rename = "ration_card")] + RationCard, + #[serde(rename = "ssn")] + Ssn, + #[serde(rename = "student_id")] + StudentId, + #[serde(rename = "tax_id")] + TaxId, + #[serde(rename = "travel_document")] + TravelDocument, + #[serde(rename = "voter_id")] + VoterId, +} diff --git a/src/model/watchlist_screening_entity_create_response.rs b/src/model/watchlist_screening_entity_create_response.rs index 24fba491..a2b011ab 100644 --- a/src/model/watchlist_screening_entity_create_response.rs +++ b/src/model/watchlist_screening_entity_create_response.rs @@ -1,9 +1,12 @@ use serde::{Serialize, Deserialize}; -use super::{EntityWatchlistScreeningSearchTerms, WatchlistScreeningAuditTrail}; +use super::{ + EntityWatchlistScreeningSearchTerms, WatchlistScreeningAuditTrail, + WatchlistScreeningStatus, +}; ///The entity screening object allows you to represent an entity in your system, update its profile, and search for it on various watchlists. Note: Rejected entity screenings will not receive new hits, regardless of entity program configuration. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningEntityCreateResponse { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. @@ -18,10 +21,10 @@ pub struct WatchlistScreeningEntityCreateResponse { ///Search terms associated with an entity used for searching against watchlists pub search_terms: EntityWatchlistScreeningSearchTerms, ///A status enum indicating whether a screening is still pending review, has been rejected, or has been cleared. - pub status: String, + pub status: WatchlistScreeningStatus, } impl std::fmt::Display for WatchlistScreeningEntityCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_entity_get_response.rs b/src/model/watchlist_screening_entity_get_response.rs index 49674889..21fd0edb 100644 --- a/src/model/watchlist_screening_entity_get_response.rs +++ b/src/model/watchlist_screening_entity_get_response.rs @@ -1,9 +1,12 @@ use serde::{Serialize, Deserialize}; -use super::{EntityWatchlistScreeningSearchTerms, WatchlistScreeningAuditTrail}; +use super::{ + EntityWatchlistScreeningSearchTerms, WatchlistScreeningAuditTrail, + WatchlistScreeningStatus, +}; ///The entity screening object allows you to represent an entity in your system, update its profile, and search for it on various watchlists. Note: Rejected entity screenings will not receive new hits, regardless of entity program configuration. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningEntityGetResponse { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. @@ -18,10 +21,10 @@ pub struct WatchlistScreeningEntityGetResponse { ///Search terms associated with an entity used for searching against watchlists pub search_terms: EntityWatchlistScreeningSearchTerms, ///A status enum indicating whether a screening is still pending review, has been rejected, or has been cleared. - pub status: String, + pub status: WatchlistScreeningStatus, } impl std::fmt::Display for WatchlistScreeningEntityGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_entity_history_list_response.rs b/src/model/watchlist_screening_entity_history_list_response.rs index 556c57e6..9244ce44 100644 --- a/src/model/watchlist_screening_entity_history_list_response.rs +++ b/src/model/watchlist_screening_entity_history_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningEntityHistoryListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_entity_hit_list_response.rs b/src/model/watchlist_screening_entity_hit_list_response.rs index 33196343..c5e73b22 100644 --- a/src/model/watchlist_screening_entity_hit_list_response.rs +++ b/src/model/watchlist_screening_entity_hit_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningEntityHitListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_entity_list_response.rs b/src/model/watchlist_screening_entity_list_response.rs index b3709dbf..10038f1b 100644 --- a/src/model/watchlist_screening_entity_list_response.rs +++ b/src/model/watchlist_screening_entity_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningEntityListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_entity_program_get_response.rs b/src/model/watchlist_screening_entity_program_get_response.rs index d122b390..43236347 100644 --- a/src/model/watchlist_screening_entity_program_get_response.rs +++ b/src/model/watchlist_screening_entity_program_get_response.rs @@ -1,7 +1,7 @@ use serde::{Serialize, Deserialize}; -use super::WatchlistScreeningAuditTrail; +use super::{EntityWatchlistCode, ProgramNameSensitivity, WatchlistScreeningAuditTrail}; ///A program that configures the active lists, search parameters, and other behavior for initial and ongoing screening of entities. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningEntityProgramGetResponse { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: WatchlistScreeningAuditTrail, @@ -15,7 +15,7 @@ pub struct WatchlistScreeningEntityProgramGetResponse { pub is_rescanning_enabled: bool, ///Watchlists enabled for the associated program #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub lists_enabled: Vec, + pub lists_enabled: Vec, ///A name for the entity program to define its purpose. For example, "High Risk Organizations" or "Applicants". pub name: String, /**The valid name matching sensitivity configurations for a screening program. Note that while certain matching techniques may be more prevalent on less strict settings, all matching algorithms are enabled for every sensitivity. @@ -27,7 +27,7 @@ pub struct WatchlistScreeningEntityProgramGetResponse { `strict` - Aggressive false positive reduction. This sensitivity will require names to be more similar than `coarse` and `balanced` settings, relying less on phonetics, while still accounting for character transpositions, missing tokens, and other common permutations. `exact` - Matches must be nearly exact. This sensitivity will only show hits with exact or nearly exact name matches with only basic correction such as extraneous symbols and capitalization. This setting is generally not recommended unless you have a very specific use case.*/ - pub name_sensitivity: String, + pub name_sensitivity: ProgramNameSensitivity, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, } @@ -35,4 +35,4 @@ impl std::fmt::Display for WatchlistScreeningEntityProgramGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_entity_program_list_response.rs b/src/model/watchlist_screening_entity_program_list_response.rs index 43888bc5..7093e7e7 100644 --- a/src/model/watchlist_screening_entity_program_list_response.rs +++ b/src/model/watchlist_screening_entity_program_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningEntityProgramListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_entity_review_create_response.rs b/src/model/watchlist_screening_entity_review_create_response.rs index afb93d62..f5e013e5 100644 --- a/src/model/watchlist_screening_entity_review_create_response.rs +++ b/src/model/watchlist_screening_entity_review_create_response.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::WatchlistScreeningAuditTrail; /**A review submitted by a team member for an entity watchlist screening. A review can be either a comment on the current screening state, actions taken against hits attached to the watchlist screening, or both.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningEntityReviewCreateResponse { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: WatchlistScreeningAuditTrail, @@ -24,4 +24,4 @@ impl std::fmt::Display for WatchlistScreeningEntityReviewCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_entity_review_list_response.rs b/src/model/watchlist_screening_entity_review_list_response.rs index ee9d7fd5..c7f84a2f 100644 --- a/src/model/watchlist_screening_entity_review_list_response.rs +++ b/src/model/watchlist_screening_entity_review_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningEntityReviewListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_entity_update_request_resettable_field.rs b/src/model/watchlist_screening_entity_update_request_resettable_field.rs new file mode 100644 index 00000000..41caf80b --- /dev/null +++ b/src/model/watchlist_screening_entity_update_request_resettable_field.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///The name of a field that can be reset back to null +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WatchlistScreeningEntityUpdateRequestResettableField { + #[serde(rename = "assignee")] + Assignee, +} diff --git a/src/model/watchlist_screening_entity_update_request_resettable_field_list.rs b/src/model/watchlist_screening_entity_update_request_resettable_field_list.rs new file mode 100644 index 00000000..aa2deacb --- /dev/null +++ b/src/model/watchlist_screening_entity_update_request_resettable_field_list.rs @@ -0,0 +1,6 @@ +use serde::{Serialize, Deserialize}; +use super::WatchlistScreeningEntityUpdateRequestResettableField; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct WatchlistScreeningEntityUpdateRequestResettableFieldList( + pub Vec, +); diff --git a/src/model/watchlist_screening_entity_update_response.rs b/src/model/watchlist_screening_entity_update_response.rs index 70279260..a31dc90b 100644 --- a/src/model/watchlist_screening_entity_update_response.rs +++ b/src/model/watchlist_screening_entity_update_response.rs @@ -1,9 +1,12 @@ use serde::{Serialize, Deserialize}; -use super::{EntityWatchlistScreeningSearchTerms, WatchlistScreeningAuditTrail}; +use super::{ + EntityWatchlistScreeningSearchTerms, WatchlistScreeningAuditTrail, + WatchlistScreeningStatus, +}; ///The entity screening object allows you to represent an entity in your system, update its profile, and search for it on various watchlists. Note: Rejected entity screenings will not receive new hits, regardless of entity program configuration. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningEntityUpdateResponse { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. @@ -18,10 +21,10 @@ pub struct WatchlistScreeningEntityUpdateResponse { ///Search terms associated with an entity used for searching against watchlists pub search_terms: EntityWatchlistScreeningSearchTerms, ///A status enum indicating whether a screening is still pending review, has been rejected, or has been cleared. - pub status: String, + pub status: WatchlistScreeningStatus, } impl std::fmt::Display for WatchlistScreeningEntityUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_hit.rs b/src/model/watchlist_screening_hit.rs index fe2749df..50b97359 100644 --- a/src/model/watchlist_screening_hit.rs +++ b/src/model/watchlist_screening_hit.rs @@ -1,7 +1,10 @@ use serde::{Serialize, Deserialize}; -use super::{ScreeningHitAnalysis, ScreeningHitData}; +use super::{ + IndividualWatchlistCode, ScreeningHitAnalysis, ScreeningHitData, + WatchlistScreeningHitStatus, +}; ///Data from a government watchlist or PEP list that has been attached to the screening. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningHit { ///Analysis information describing why a screening hit matched the provided user information #[serde(default, skip_serializing_if = "Option::is_none")] @@ -43,11 +46,11 @@ pub struct WatchlistScreeningHit { `TR_FOR`: Government of Turkey Foreign Freezing Requests `TR_WMD`: Government of Turkey Weapons of Mass Destruction `TR_CMB`: Government of Turkey Capital Markets Board*/ - pub list_code: String, + pub list_code: IndividualWatchlistCode, ///A universal identifier for a watchlist individual that is stable across searches and updates. pub plaid_uid: String, ///The current state of review. All watchlist screening hits begin in a `pending_review` state but can be changed by creating a review. When a hit is in the `pending_review` state, it will always show the latest version of the watchlist data Plaid has available and be compared against the latest customer information saved in the watchlist screening. Once a hit has been marked as `confirmed` or `dismissed` it will no longer be updated so that the state is as it was when the review was first conducted. - pub review_status: String, + pub review_status: WatchlistScreeningHitStatus, ///The identifier provided by the source sanction or watchlist. When one is not provided by the source, this is `null`. #[serde(default, skip_serializing_if = "Option::is_none")] pub source_uid: Option, @@ -56,4 +59,4 @@ impl std::fmt::Display for WatchlistScreeningHit { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_hit_locations.rs b/src/model/watchlist_screening_hit_locations.rs index f5f18d7b..593ce3d3 100644 --- a/src/model/watchlist_screening_hit_locations.rs +++ b/src/model/watchlist_screening_hit_locations.rs @@ -11,4 +11,4 @@ impl std::fmt::Display for WatchlistScreeningHitLocations { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_hit_status.rs b/src/model/watchlist_screening_hit_status.rs new file mode 100644 index 00000000..b538dd37 --- /dev/null +++ b/src/model/watchlist_screening_hit_status.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///The current state of review. All watchlist screening hits begin in a `pending_review` state but can be changed by creating a review. When a hit is in the `pending_review` state, it will always show the latest version of the watchlist data Plaid has available and be compared against the latest customer information saved in the watchlist screening. Once a hit has been marked as `confirmed` or `dismissed` it will no longer be updated so that the state is as it was when the review was first conducted. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WatchlistScreeningHitStatus { + #[serde(rename = "confirmed")] + Confirmed, + #[serde(rename = "pending_review")] + PendingReview, + #[serde(rename = "dismissed")] + Dismissed, +} diff --git a/src/model/watchlist_screening_individual.rs b/src/model/watchlist_screening_individual.rs index 8d0ea716..baf5cb8a 100644 --- a/src/model/watchlist_screening_individual.rs +++ b/src/model/watchlist_screening_individual.rs @@ -1,9 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::{WatchlistScreeningAuditTrail, WatchlistScreeningSearchTerms}; +use super::{ + WatchlistScreeningAuditTrail, WatchlistScreeningSearchTerms, WatchlistScreeningStatus, +}; ///The screening object allows you to represent a customer in your system, update their profile, and search for them on various watchlists. Note: Rejected customers will not receive new hits, regardless of program configuration. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningIndividual { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. @@ -16,10 +18,10 @@ pub struct WatchlistScreeningIndividual { ///Search terms for creating an individual watchlist screening pub search_terms: WatchlistScreeningSearchTerms, ///A status enum indicating whether a screening is still pending review, has been rejected, or has been cleared. - pub status: String, + pub status: WatchlistScreeningStatus, } impl std::fmt::Display for WatchlistScreeningIndividual { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_create_response.rs b/src/model/watchlist_screening_individual_create_response.rs index f400271e..8fbe4c36 100644 --- a/src/model/watchlist_screening_individual_create_response.rs +++ b/src/model/watchlist_screening_individual_create_response.rs @@ -1,9 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::{WatchlistScreeningAuditTrail, WatchlistScreeningSearchTerms}; +use super::{ + WatchlistScreeningAuditTrail, WatchlistScreeningSearchTerms, WatchlistScreeningStatus, +}; ///The screening object allows you to represent a customer in your system, update their profile, and search for them on various watchlists. Note: Rejected customers will not receive new hits, regardless of program configuration. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningIndividualCreateResponse { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. @@ -18,10 +20,10 @@ pub struct WatchlistScreeningIndividualCreateResponse { ///Search terms for creating an individual watchlist screening pub search_terms: WatchlistScreeningSearchTerms, ///A status enum indicating whether a screening is still pending review, has been rejected, or has been cleared. - pub status: String, + pub status: WatchlistScreeningStatus, } impl std::fmt::Display for WatchlistScreeningIndividualCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_get_response.rs b/src/model/watchlist_screening_individual_get_response.rs index 066268e2..04a11343 100644 --- a/src/model/watchlist_screening_individual_get_response.rs +++ b/src/model/watchlist_screening_individual_get_response.rs @@ -1,9 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::{WatchlistScreeningAuditTrail, WatchlistScreeningSearchTerms}; +use super::{ + WatchlistScreeningAuditTrail, WatchlistScreeningSearchTerms, WatchlistScreeningStatus, +}; ///The screening object allows you to represent a customer in your system, update their profile, and search for them on various watchlists. Note: Rejected customers will not receive new hits, regardless of program configuration. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningIndividualGetResponse { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. @@ -18,10 +20,10 @@ pub struct WatchlistScreeningIndividualGetResponse { ///Search terms for creating an individual watchlist screening pub search_terms: WatchlistScreeningSearchTerms, ///A status enum indicating whether a screening is still pending review, has been rejected, or has been cleared. - pub status: String, + pub status: WatchlistScreeningStatus, } impl std::fmt::Display for WatchlistScreeningIndividualGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_history_list_response.rs b/src/model/watchlist_screening_individual_history_list_response.rs index 9231aeda..c6740cca 100644 --- a/src/model/watchlist_screening_individual_history_list_response.rs +++ b/src/model/watchlist_screening_individual_history_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningIndividualHistoryListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_hit_list_response.rs b/src/model/watchlist_screening_individual_hit_list_response.rs index 07fc3323..a8cdb3ad 100644 --- a/src/model/watchlist_screening_individual_hit_list_response.rs +++ b/src/model/watchlist_screening_individual_hit_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningIndividualHitListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_list_response.rs b/src/model/watchlist_screening_individual_list_response.rs index 5bc4018d..9813df00 100644 --- a/src/model/watchlist_screening_individual_list_response.rs +++ b/src/model/watchlist_screening_individual_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningIndividualListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_program_get_response.rs b/src/model/watchlist_screening_individual_program_get_response.rs index 2b0e49f1..879948c4 100644 --- a/src/model/watchlist_screening_individual_program_get_response.rs +++ b/src/model/watchlist_screening_individual_program_get_response.rs @@ -1,7 +1,9 @@ use serde::{Serialize, Deserialize}; -use super::WatchlistScreeningAuditTrail; +use super::{ + IndividualWatchlistCode, ProgramNameSensitivity, WatchlistScreeningAuditTrail, +}; ///A program that configures the active lists, search parameters, and other behavior for initial and ongoing screening of individuals. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningIndividualProgramGetResponse { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: WatchlistScreeningAuditTrail, @@ -15,7 +17,7 @@ pub struct WatchlistScreeningIndividualProgramGetResponse { pub is_rescanning_enabled: bool, ///Watchlists enabled for the associated program #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub lists_enabled: Vec, + pub lists_enabled: Vec, ///A name for the program to define its purpose. For example, "High Risk Individuals", "US Cardholders", or "Applicants". pub name: String, /**The valid name matching sensitivity configurations for a screening program. Note that while certain matching techniques may be more prevalent on less strict settings, all matching algorithms are enabled for every sensitivity. @@ -27,7 +29,7 @@ pub struct WatchlistScreeningIndividualProgramGetResponse { `strict` - Aggressive false positive reduction. This sensitivity will require names to be more similar than `coarse` and `balanced` settings, relying less on phonetics, while still accounting for character transpositions, missing tokens, and other common permutations. `exact` - Matches must be nearly exact. This sensitivity will only show hits with exact or nearly exact name matches with only basic correction such as extraneous symbols and capitalization. This setting is generally not recommended unless you have a very specific use case.*/ - pub name_sensitivity: String, + pub name_sensitivity: ProgramNameSensitivity, ///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. pub request_id: String, } @@ -35,4 +37,4 @@ impl std::fmt::Display for WatchlistScreeningIndividualProgramGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_program_list_response.rs b/src/model/watchlist_screening_individual_program_list_response.rs index 42ada563..98350772 100644 --- a/src/model/watchlist_screening_individual_program_list_response.rs +++ b/src/model/watchlist_screening_individual_program_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningIndividualProgramListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_review_create_response.rs b/src/model/watchlist_screening_individual_review_create_response.rs index 31629452..7367ff6b 100644 --- a/src/model/watchlist_screening_individual_review_create_response.rs +++ b/src/model/watchlist_screening_individual_review_create_response.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::WatchlistScreeningAuditTrail; /**A review submitted by a team member for an individual watchlist screening. A review can be either a comment on the current screening state, actions taken against hits attached to the watchlist screening, or both.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningIndividualReviewCreateResponse { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: WatchlistScreeningAuditTrail, @@ -24,4 +24,4 @@ impl std::fmt::Display for WatchlistScreeningIndividualReviewCreateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_review_list_response.rs b/src/model/watchlist_screening_individual_review_list_response.rs index f002284b..bd73612d 100644 --- a/src/model/watchlist_screening_individual_review_list_response.rs +++ b/src/model/watchlist_screening_individual_review_list_response.rs @@ -16,4 +16,4 @@ impl std::fmt::Display for WatchlistScreeningIndividualReviewListResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_individual_update_request_resettable_field.rs b/src/model/watchlist_screening_individual_update_request_resettable_field.rs new file mode 100644 index 00000000..2ecaad29 --- /dev/null +++ b/src/model/watchlist_screening_individual_update_request_resettable_field.rs @@ -0,0 +1,7 @@ +use serde::{Serialize, Deserialize}; +///The name of a field that can be reset back to null +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WatchlistScreeningIndividualUpdateRequestResettableField { + #[serde(rename = "assignee")] + Assignee, +} diff --git a/src/model/watchlist_screening_individual_update_request_resettable_field_list.rs b/src/model/watchlist_screening_individual_update_request_resettable_field_list.rs new file mode 100644 index 00000000..08fdd527 --- /dev/null +++ b/src/model/watchlist_screening_individual_update_request_resettable_field_list.rs @@ -0,0 +1,6 @@ +use serde::{Serialize, Deserialize}; +use super::WatchlistScreeningIndividualUpdateRequestResettableField; +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct WatchlistScreeningIndividualUpdateRequestResettableFieldList( + pub Vec, +); diff --git a/src/model/watchlist_screening_individual_update_response.rs b/src/model/watchlist_screening_individual_update_response.rs index a04f5909..04b210e7 100644 --- a/src/model/watchlist_screening_individual_update_response.rs +++ b/src/model/watchlist_screening_individual_update_response.rs @@ -1,9 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::{WatchlistScreeningAuditTrail, WatchlistScreeningSearchTerms}; +use super::{ + WatchlistScreeningAuditTrail, WatchlistScreeningSearchTerms, WatchlistScreeningStatus, +}; ///The screening object allows you to represent a customer in your system, update their profile, and search for them on various watchlists. Note: Rejected customers will not receive new hits, regardless of program configuration. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningIndividualUpdateResponse { - ///ID of the associated user. + ///ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use `/dashboard_user/get`. #[serde(default, skip_serializing_if = "Option::is_none")] pub assignee: Option, ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. @@ -18,10 +20,10 @@ pub struct WatchlistScreeningIndividualUpdateResponse { ///Search terms for creating an individual watchlist screening pub search_terms: WatchlistScreeningSearchTerms, ///A status enum indicating whether a screening is still pending review, has been rejected, or has been cleared. - pub status: String, + pub status: WatchlistScreeningStatus, } impl std::fmt::Display for WatchlistScreeningIndividualUpdateResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_request_search_terms.rs b/src/model/watchlist_screening_request_search_terms.rs index 033a9f5e..a71ee2b7 100644 --- a/src/model/watchlist_screening_request_search_terms.rs +++ b/src/model/watchlist_screening_request_search_terms.rs @@ -8,10 +8,10 @@ pub struct WatchlistScreeningRequestSearchTerms { ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub date_of_birth: Option, - ///The numeric or alphanumeric identifier associated with this document. + ///The numeric or alphanumeric identifier associated with this document. Must be between 4 and 32 characters long, and cannot have leading or trailing spaces. #[serde(default, skip_serializing_if = "Option::is_none")] pub document_number: Option, - ///The legal name of the individual being screened. + ///The legal name of the individual being screened. Must have at least one alphabetical character, have a maximum length of 100 characters, and not include leading or trailing spaces. pub legal_name: String, ///ID of the associated program. pub watchlist_program_id: String, @@ -20,4 +20,4 @@ impl std::fmt::Display for WatchlistScreeningRequestSearchTerms { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_review.rs b/src/model/watchlist_screening_review.rs index 7930b021..a2b747dc 100644 --- a/src/model/watchlist_screening_review.rs +++ b/src/model/watchlist_screening_review.rs @@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize}; use super::WatchlistScreeningAuditTrail; /**A review submitted by a team member for an individual watchlist screening. A review can be either a comment on the current screening state, actions taken against hits attached to the watchlist screening, or both.*/ -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WatchlistScreeningReview { ///Information about the last change made to the parent object specifying what caused the change as well as when it occurred. pub audit_trail: WatchlistScreeningAuditTrail, @@ -22,4 +22,4 @@ impl std::fmt::Display for WatchlistScreeningReview { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_search_terms.rs b/src/model/watchlist_screening_search_terms.rs index 08b0b730..e06aaa1c 100644 --- a/src/model/watchlist_screening_search_terms.rs +++ b/src/model/watchlist_screening_search_terms.rs @@ -8,10 +8,10 @@ pub struct WatchlistScreeningSearchTerms { ///A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). #[serde(default, skip_serializing_if = "Option::is_none")] pub date_of_birth: Option, - ///The numeric or alphanumeric identifier associated with this document. + ///The numeric or alphanumeric identifier associated with this document. Must be between 4 and 32 characters long, and cannot have leading or trailing spaces. #[serde(default, skip_serializing_if = "Option::is_none")] pub document_number: Option, - ///The legal name of the individual being screened. + ///The legal name of the individual being screened. Must have at least one alphabetical character, have a maximum length of 100 characters, and not include leading or trailing spaces. pub legal_name: String, ///The current version of the search terms. Starts at `1` and increments with each edit to `search_terms`. pub version: i64, @@ -22,4 +22,4 @@ impl std::fmt::Display for WatchlistScreeningSearchTerms { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/watchlist_screening_status.rs b/src/model/watchlist_screening_status.rs new file mode 100644 index 00000000..14bece5b --- /dev/null +++ b/src/model/watchlist_screening_status.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///A status enum indicating whether a screening is still pending review, has been rejected, or has been cleared. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WatchlistScreeningStatus { + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "pending_review")] + PendingReview, + #[serde(rename = "cleared")] + Cleared, +} diff --git a/src/model/weak_alias_determination.rs b/src/model/weak_alias_determination.rs new file mode 100644 index 00000000..a9818c4b --- /dev/null +++ b/src/model/weak_alias_determination.rs @@ -0,0 +1,11 @@ +use serde::{Serialize, Deserialize}; +///Names that are explicitly marked as low quality either by their `source` list, or by `plaid` by a series of additional checks done by Plaid. Plaid does not ever surface a hit as a result of a weak name alone. If a name has no quality issues, this value will be `none`. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WeakAliasDetermination { + #[serde(rename = "none")] + None, + #[serde(rename = "source")] + Source, + #[serde(rename = "plaid")] + Plaid, +} diff --git a/src/model/webhook_environment_values.rs b/src/model/webhook_environment_values.rs new file mode 100644 index 00000000..f8d014ac --- /dev/null +++ b/src/model/webhook_environment_values.rs @@ -0,0 +1,9 @@ +use serde::{Serialize, Deserialize}; +///The Plaid environment the webhook was sent from +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WebhookEnvironmentValues { + #[serde(rename = "sandbox")] + Sandbox, + #[serde(rename = "production")] + Production, +} diff --git a/src/model/webhook_type.rs b/src/model/webhook_type.rs new file mode 100644 index 00000000..4c01672b --- /dev/null +++ b/src/model/webhook_type.rs @@ -0,0 +1,19 @@ +use serde::{Serialize, Deserialize}; +///The webhook types that can be fired by this test endpoint. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub enum WebhookType { + #[serde(rename = "AUTH")] + Auth, + #[serde(rename = "HOLDINGS")] + Holdings, + #[serde(rename = "INVESTMENTS_TRANSACTIONS")] + InvestmentsTransactions, + #[serde(rename = "ITEM")] + Item, + #[serde(rename = "LIABILITIES")] + Liabilities, + #[serde(rename = "TRANSACTIONS")] + Transactions, + #[serde(rename = "ASSETS")] + Assets, +} diff --git a/src/model/webhook_update_acknowledged_webhook.rs b/src/model/webhook_update_acknowledged_webhook.rs index 787d1f10..431e4eba 100644 --- a/src/model/webhook_update_acknowledged_webhook.rs +++ b/src/model/webhook_update_acknowledged_webhook.rs @@ -1,11 +1,11 @@ use serde::{Serialize, Deserialize}; -use super::PlaidError; +use super::{PlaidError, WebhookEnvironmentValues}; ///Fired when an Item's webhook is updated. This will be sent to the newly specified webhook. -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct WebhookUpdateAcknowledgedWebhook { ///The Plaid environment the webhook was sent from - pub environment: String, - ///We use standard HTTP response codes for success and failure notifications, and our errors are further classified by `error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. + pub environment: WebhookEnvironmentValues, + ///Errors are identified by `error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead. #[serde(default, skip_serializing_if = "Option::is_none")] pub error: Option, ///The `item_id` of the Item associated with this webhook, warning, or error @@ -21,4 +21,4 @@ impl std::fmt::Display for WebhookUpdateAcknowledgedWebhook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/model/webhook_verification_key_get_response.rs b/src/model/webhook_verification_key_get_response.rs index 3b7fbb91..3ae32fc1 100644 --- a/src/model/webhook_verification_key_get_response.rs +++ b/src/model/webhook_verification_key_get_response.rs @@ -12,4 +12,4 @@ impl std::fmt::Display for WebhookVerificationKeyGetResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!(f, "{}", serde_json::to_string(self).unwrap()) } -} \ No newline at end of file +} diff --git a/src/request/accounts_balance_get.rs b/src/request/accounts_balance_get.rs index 870cdb8e..44f424e7 100644 --- a/src/request/accounts_balance_get.rs +++ b/src/request/accounts_balance_get.rs @@ -1,9 +1,9 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + AccountsBalanceGetRequestOptions, AccountsBalanceGetRequestPaymentDetails, +}; /**You should use this struct via [`PlaidClient::accounts_balance_get`]. On request success, this will return a [`AccountsGetResponse`].*/ @@ -13,12 +13,13 @@ pub struct AccountsBalanceGetRequest { pub options: Option, pub payment_details: Option, } -impl AccountsBalanceGetRequest {} impl FluentRequest<'_, AccountsBalanceGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: AccountsBalanceGetRequestOptions) -> Self { self.params.options = Some(options); self } + ///Set the value of the payment_details field. pub fn payment_details( mut self, payment_details: AccountsBalanceGetRequestPaymentDetails, @@ -28,22 +29,42 @@ impl FluentRequest<'_, AccountsBalanceGetRequest> { } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AccountsBalanceGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/accounts/balance/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } if let Some(ref unwrapped) = self.params.payment_details { - r = r.json(json!({ "payment_details" : unwrapped })); + r = r.json(serde_json::json!({ "payment_details" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve real-time balance data + +The `/accounts/balance/get` endpoint returns the real-time balance for each of an Item's accounts. While other endpoints, such as `/accounts/get`, return a balance object, only `/accounts/balance/get` forces the available and current balance fields to be refreshed rather than cached. This endpoint can be used for existing Items that were added via any of Plaid’s other products. This endpoint can be used as long as Link has been initialized with any other product, `balance` itself is not a product that can be used to initialize Link. As this endpoint triggers a synchronous request for fresh data, latency may be higher than for other Plaid endpoints (typically less than 10 seconds, but occasionally up to 30 seconds or more); if you encounter errors, you may find it necessary to adjust your timeout period when making requests. + +See endpoint docs at .*/ + pub fn accounts_balance_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, AccountsBalanceGetRequest> { + FluentRequest { + client: self, + params: AccountsBalanceGetRequest { + access_token: access_token.to_owned(), + options: None, + payment_details: None, + }, + } + } +} diff --git a/src/request/accounts_get.rs b/src/request/accounts_get.rs index ca320bac..834144aa 100644 --- a/src/request/accounts_get.rs +++ b/src/request/accounts_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::AccountsGetRequestOptions; /**You should use this struct via [`PlaidClient::accounts_get`]. On request success, this will return a [`AccountsGetResponse`].*/ @@ -12,27 +10,51 @@ pub struct AccountsGetRequest { pub access_token: String, pub options: Option, } -impl AccountsGetRequest {} impl FluentRequest<'_, AccountsGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: AccountsGetRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AccountsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/accounts/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve accounts + +The `/accounts/get` endpoint can be used to retrieve a list of accounts associated with any linked Item. Plaid will only return active bank accounts — that is, accounts that are not closed and are capable of carrying a balance. +To return new accounts that were created after the user linked their Item, you can listen for the [`NEW_ACCOUNTS_AVAILABLE`](https://plaid.com/docs/api/items/#new_accounts_available) webhook and then use Link's [update mode](https://plaid.com/docs/link/update-mode/) to request that the user share this new account with you. + +`/accounts/get` is free to use and retrieves cached information, rather than extracting fresh information from the institution. The balance returned will reflect the balance at the time of the last successful Item update. If the Item is enabled for a regularly updating product, such as Transactions, Investments, or Liabilities, the balance will typically update about once a day, as long as the Item is healthy. If the Item is enabled only for products that do not frequently update, such as Auth or Identity, balance data may be much older. + +For realtime balance information, use the paid endpoint `/accounts/balance/get` instead. + +See endpoint docs at .*/ + pub fn accounts_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, AccountsGetRequest> { + FluentRequest { + client: self, + params: AccountsGetRequest { + access_token: access_token.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/application_get.rs b/src/request/application_get.rs index bf093f80..529f0575 100644 --- a/src/request/application_get.rs +++ b/src/request/application_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::application_get`]. On request success, this will return a [`ApplicationGetResponse`].*/ @@ -11,19 +8,37 @@ On request success, this will return a [`ApplicationGetResponse`].*/ pub struct ApplicationGetRequest { pub application_id: String, } -impl ApplicationGetRequest {} impl FluentRequest<'_, ApplicationGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ApplicationGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/application/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "application_id" : self.params.application_id })); + r = r + .json( + serde_json::json!({ "application_id" : self.params.application_id }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve information about a Plaid application + +Allows financial institutions to retrieve information about Plaid clients for the purpose of building control-tower experiences*/ + pub fn application_get( + &self, + application_id: &str, + ) -> FluentRequest<'_, ApplicationGetRequest> { + FluentRequest { + client: self, + params: ApplicationGetRequest { + application_id: application_id.to_owned(), + }, + } + } +} diff --git a/src/request/asset_report_audit_copy_create.rs b/src/request/asset_report_audit_copy_create.rs index 53f7d749..2c9b89bc 100644 --- a/src/request/asset_report_audit_copy_create.rs +++ b/src/request/asset_report_audit_copy_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::asset_report_audit_copy_create`]. On request success, this will return a [`AssetReportAuditCopyCreateResponse`].*/ @@ -12,8 +9,8 @@ pub struct AssetReportAuditCopyCreateRequest { pub asset_report_token: String, pub auditor_id: Option, } -impl AssetReportAuditCopyCreateRequest {} impl FluentRequest<'_, AssetReportAuditCopyCreateRequest> { + ///Set the value of the auditor_id field. pub fn auditor_id(mut self, auditor_id: &str) -> Self { self.params.auditor_id = Some(auditor_id.to_owned()); self @@ -21,19 +18,47 @@ impl FluentRequest<'_, AssetReportAuditCopyCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportAuditCopyCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::AssetReportAuditCopyCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/asset_report/audit_copy/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "asset_report_token" : self.params.asset_report_token })); + r = r + .json( + serde_json::json!( + { "asset_report_token" : self.params.asset_report_token } + ), + ); if let Some(ref unwrapped) = self.params.auditor_id { - r = r.json(json!({ "auditor_id" : unwrapped })); + r = r.json(serde_json::json!({ "auditor_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create Asset Report Audit Copy + +Plaid can provide an Audit Copy of any Asset Report directly to a participating third party on your behalf. For example, Plaid can supply an Audit Copy directly to Fannie Mae on your behalf if you participate in the Day 1 Certainty™ program. An Audit Copy contains the same underlying data as the Asset Report. + +To grant access to an Audit Copy, use the `/asset_report/audit_copy/create` endpoint to create an `audit_copy_token` and then pass that token to the third party who needs access. Each third party has its own `auditor_id`, for example `fannie_mae`. You’ll need to create a separate Audit Copy for each third party to whom you want to grant access to the Report. + +See endpoint docs at .*/ + pub fn asset_report_audit_copy_create( + &self, + asset_report_token: &str, + ) -> FluentRequest<'_, AssetReportAuditCopyCreateRequest> { + FluentRequest { + client: self, + params: AssetReportAuditCopyCreateRequest { + asset_report_token: asset_report_token.to_owned(), + auditor_id: None, + }, + } + } +} diff --git a/src/request/asset_report_audit_copy_get.rs b/src/request/asset_report_audit_copy_get.rs index b04d2565..6c8a7079 100644 --- a/src/request/asset_report_audit_copy_get.rs +++ b/src/request/asset_report_audit_copy_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::asset_report_audit_copy_get`]. On request success, this will return a [`AssetReportGetResponse`].*/ @@ -11,20 +8,42 @@ On request success, this will return a [`AssetReportGetResponse`].*/ pub struct AssetReportAuditCopyGetRequest { pub audit_copy_token: String, } -impl AssetReportAuditCopyGetRequest {} impl FluentRequest<'_, AssetReportAuditCopyGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportAuditCopyGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/asset_report/audit_copy/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "audit_copy_token" : self.params.audit_copy_token })); + r = r + .json( + serde_json::json!( + { "audit_copy_token" : self.params.audit_copy_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve an Asset Report Audit Copy + +`/asset_report/audit_copy/get` allows auditors to get a copy of an Asset Report that was previously shared via the `/asset_report/audit_copy/create` endpoint. The caller of `/asset_report/audit_copy/create` must provide the `audit_copy_token` to the auditor. This token can then be used to call `/asset_report/audit_copy/create`. + +See endpoint docs at .*/ + pub fn asset_report_audit_copy_get( + &self, + audit_copy_token: &str, + ) -> FluentRequest<'_, AssetReportAuditCopyGetRequest> { + FluentRequest { + client: self, + params: AssetReportAuditCopyGetRequest { + audit_copy_token: audit_copy_token.to_owned(), + }, + } + } +} diff --git a/src/request/asset_report_audit_copy_remove.rs b/src/request/asset_report_audit_copy_remove.rs index 4d72d316..0491e744 100644 --- a/src/request/asset_report_audit_copy_remove.rs +++ b/src/request/asset_report_audit_copy_remove.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::asset_report_audit_copy_remove`]. On request success, this will return a [`AssetReportAuditCopyRemoveResponse`].*/ @@ -11,20 +8,44 @@ On request success, this will return a [`AssetReportAuditCopyRemoveResponse`].*/ pub struct AssetReportAuditCopyRemoveRequest { pub audit_copy_token: String, } -impl AssetReportAuditCopyRemoveRequest {} impl FluentRequest<'_, AssetReportAuditCopyRemoveRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportAuditCopyRemoveRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::AssetReportAuditCopyRemoveResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/asset_report/audit_copy/remove"; let mut r = self.client.client.post(url); - r = r.json(json!({ "audit_copy_token" : self.params.audit_copy_token })); + r = r + .json( + serde_json::json!( + { "audit_copy_token" : self.params.audit_copy_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Remove Asset Report Audit Copy + +The `/asset_report/audit_copy/remove` endpoint allows you to remove an Audit Copy. Removing an Audit Copy invalidates the `audit_copy_token` associated with it, meaning both you and any third parties holding the token will no longer be able to use it to access Report data. Items associated with the Asset Report, the Asset Report itself and other Audit Copies of it are not affected and will remain accessible after removing the given Audit Copy. + +See endpoint docs at .*/ + pub fn asset_report_audit_copy_remove( + &self, + audit_copy_token: &str, + ) -> FluentRequest<'_, AssetReportAuditCopyRemoveRequest> { + FluentRequest { + client: self, + params: AssetReportAuditCopyRemoveRequest { + audit_copy_token: audit_copy_token.to_owned(), + }, + } + } +} diff --git a/src/request/asset_report_create.rs b/src/request/asset_report_create.rs index fcc2eb82..fd19afc6 100644 --- a/src/request/asset_report_create.rs +++ b/src/request/asset_report_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::AssetReportCreateRequestOptions; /**You should use this struct via [`PlaidClient::asset_report_create`]. On request success, this will return a [`AssetReportCreateResponse`].*/ @@ -13,8 +11,8 @@ pub struct AssetReportCreateRequest { pub days_requested: i64, pub options: Option, } -impl AssetReportCreateRequest {} impl FluentRequest<'_, AssetReportCreateRequest> { + ///Set the value of the access_tokens field. pub fn access_tokens( mut self, access_tokens: impl IntoIterator>, @@ -26,28 +24,56 @@ impl FluentRequest<'_, AssetReportCreateRequest> { ); self } + ///Set the value of the options field. pub fn options(mut self, options: AssetReportCreateRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/asset_report/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.access_tokens { - r = r.json(json!({ "access_tokens" : unwrapped })); + r = r.json(serde_json::json!({ "access_tokens" : unwrapped })); } - r = r.json(json!({ "days_requested" : self.params.days_requested })); + r = r + .json( + serde_json::json!({ "days_requested" : self.params.days_requested }), + ); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create an Asset Report + +The `/asset_report/create` endpoint initiates the process of creating an Asset Report, which can then be retrieved by passing the `asset_report_token` return value to the `/asset_report/get` or `/asset_report/pdf/get` endpoints. + +The Asset Report takes some time to be created and is not available immediately after calling `/asset_report/create`. The exact amount of time to create the report will vary depending on how many days of history are requested and will typically range from a few seconds to about one minute. When the Asset Report is ready to be retrieved using `/asset_report/get` or `/asset_report/pdf/get`, Plaid will fire a `PRODUCT_READY` webhook. For full details of the webhook schema, see [Asset Report webhooks](https://plaid.com/docs/api/products/assets/#webhooks). + +The `/asset_report/create` endpoint creates an Asset Report at a moment in time. Asset Reports are immutable. To get an updated Asset Report, use the `/asset_report/refresh` endpoint. + +See endpoint docs at .*/ + pub fn asset_report_create( + &self, + days_requested: i64, + ) -> FluentRequest<'_, AssetReportCreateRequest> { + FluentRequest { + client: self, + params: AssetReportCreateRequest { + access_tokens: None, + days_requested, + options: None, + }, + } + } +} diff --git a/src/request/asset_report_filter.rs b/src/request/asset_report_filter.rs index 16bbd45e..205638dd 100644 --- a/src/request/asset_report_filter.rs +++ b/src/request/asset_report_filter.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::asset_report_filter`]. On request success, this will return a [`AssetReportFilterResponse`].*/ @@ -12,10 +9,9 @@ pub struct AssetReportFilterRequest { pub account_ids_to_exclude: Vec, pub asset_report_token: String, } -impl AssetReportFilterRequest {} impl FluentRequest<'_, AssetReportFilterRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportFilterRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,14 +19,48 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportFilterReques let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "account_ids_to_exclude" : self.params.account_ids_to_exclude } ), ); - r = r.json(json!({ "asset_report_token" : self.params.asset_report_token })); + r = r + .json( + serde_json::json!( + { "asset_report_token" : self.params.asset_report_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Filter Asset Report + +By default, an Asset Report will contain all of the accounts on a given Item. In some cases, you may not want the Asset Report to contain all accounts. For example, you might have the end user choose which accounts are relevant in Link using the Account Select view, which you can enable in the dashboard. Or, you might always exclude certain account types or subtypes, which you can identify by using the `/accounts/get` endpoint. To narrow an Asset Report to only a subset of accounts, use the `/asset_report/filter` endpoint. + +To exclude certain Accounts from an Asset Report, first use the `/asset_report/create` endpoint to create the report, then send the `asset_report_token` along with a list of `account_ids` to exclude to the `/asset_report/filter` endpoint, to create a new Asset Report which contains only a subset of the original Asset Report's data. + +Because Asset Reports are immutable, calling `/asset_report/filter` does not alter the original Asset Report in any way; rather, `/asset_report/filter` creates a new Asset Report with a new token and id. Asset Reports created via `/asset_report/filter` do not contain new Asset data, and are not billed. + +Plaid will fire a [`PRODUCT_READY`](https://plaid.com/docs/api/products/assets/#product_ready) webhook once generation of the filtered Asset Report has completed. + +See endpoint docs at .*/ + pub fn asset_report_filter( + &self, + account_ids_to_exclude: &[&str], + asset_report_token: &str, + ) -> FluentRequest<'_, AssetReportFilterRequest> { + FluentRequest { + client: self, + params: AssetReportFilterRequest { + account_ids_to_exclude: account_ids_to_exclude + .iter() + .map(|&x| x.to_owned()) + .collect(), + asset_report_token: asset_report_token.to_owned(), + }, + } + } +} diff --git a/src/request/asset_report_get.rs b/src/request/asset_report_get.rs index cff3f40e..46c99179 100644 --- a/src/request/asset_report_get.rs +++ b/src/request/asset_report_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::AssetReportGetRequestOptions; /**You should use this struct via [`PlaidClient::asset_report_get`]. On request success, this will return a [`AssetReportGetResponse`].*/ @@ -15,54 +13,81 @@ pub struct AssetReportGetRequest { pub options: Option, pub user_token: Option, } -impl AssetReportGetRequest {} impl FluentRequest<'_, AssetReportGetRequest> { + ///Set the value of the asset_report_token field. pub fn asset_report_token(mut self, asset_report_token: &str) -> Self { self.params.asset_report_token = Some(asset_report_token.to_owned()); self } + ///Set the value of the fast_report field. pub fn fast_report(mut self, fast_report: bool) -> Self { self.params.fast_report = Some(fast_report); self } + ///Set the value of the include_insights field. pub fn include_insights(mut self, include_insights: bool) -> Self { self.params.include_insights = Some(include_insights); self } + ///Set the value of the options field. pub fn options(mut self, options: AssetReportGetRequestOptions) -> Self { self.params.options = Some(options); self } + ///Set the value of the user_token field. pub fn user_token(mut self, user_token: &str) -> Self { self.params.user_token = Some(user_token.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/asset_report/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.asset_report_token { - r = r.json(json!({ "asset_report_token" : unwrapped })); + r = r.json(serde_json::json!({ "asset_report_token" : unwrapped })); } if let Some(ref unwrapped) = self.params.fast_report { - r = r.json(json!({ "fast_report" : unwrapped })); + r = r.json(serde_json::json!({ "fast_report" : unwrapped })); } if let Some(ref unwrapped) = self.params.include_insights { - r = r.json(json!({ "include_insights" : unwrapped })); + r = r.json(serde_json::json!({ "include_insights" : unwrapped })); } if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } if let Some(ref unwrapped) = self.params.user_token { - r = r.json(json!({ "user_token" : unwrapped })); + r = r.json(serde_json::json!({ "user_token" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve an Asset Report + +The `/asset_report/get` endpoint retrieves the Asset Report in JSON format. Before calling `/asset_report/get`, you must first create the Asset Report using `/asset_report/create` (or filter an Asset Report using `/asset_report/filter`) and then wait for the [`PRODUCT_READY`](https://plaid.com/docs/api/products/assets/#product_ready) webhook to fire, indicating that the Report is ready to be retrieved. + +By default, an Asset Report includes transaction descriptions as returned by the bank, as opposed to parsed and categorized by Plaid. You can also receive cleaned and categorized transactions, as well as additional insights like merchant name or location information. We call this an Asset Report with Insights. An Asset Report with Insights provides transaction category, location, and merchant information in addition to the transaction strings provided in a standard Asset Report. To retrieve an Asset Report with Insights, call `/asset_report/get` endpoint with `include_insights` set to `true`. + +For latency-sensitive applications, you can optionally call `/asset_report/create` with `options.add_ons` set to `["fast_assets"]`. This will cause Plaid to create two versions of the Asset Report: one with only current and available balance and identity information, and then later on the complete Asset Report. You will receive separate webhooks for each version of the Asset Report. + +See endpoint docs at .*/ + pub fn asset_report_get(&self) -> FluentRequest<'_, AssetReportGetRequest> { + FluentRequest { + client: self, + params: AssetReportGetRequest { + asset_report_token: None, + fast_report: None, + include_insights: None, + options: None, + user_token: None, + }, + } + } +} diff --git a/src/request/asset_report_pdf_get.rs b/src/request/asset_report_pdf_get.rs index 225f1993..f58c76ef 100644 --- a/src/request/asset_report_pdf_get.rs +++ b/src/request/asset_report_pdf_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::AssetReportPDFGetRequestOptions; /**You should use this struct via [`PlaidClient::asset_report_pdf_get`]. On request success, this will return a [`()`].*/ @@ -12,8 +10,8 @@ pub struct AssetReportPdfGetRequest { pub asset_report_token: String, pub options: Option, } -impl AssetReportPdfGetRequest {} impl FluentRequest<'_, AssetReportPdfGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: AssetReportPdfGetRequestOptions) -> Self { self.params.options = Some(options); self @@ -26,13 +24,41 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportPdfGetReques Box::pin(async move { let url = "/asset_report/pdf/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "asset_report_token" : self.params.asset_report_token })); + r = r + .json( + serde_json::json!( + { "asset_report_token" : self.params.asset_report_token } + ), + ); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a PDF Asset Report + +The `/asset_report/pdf/get` endpoint retrieves the Asset Report in PDF format. Before calling `/asset_report/pdf/get`, you must first create the Asset Report using `/asset_report/create` (or filter an Asset Report using `/asset_report/filter`) and then wait for the [`PRODUCT_READY`](https://plaid.com/docs/api/products/assets/#product_ready) webhook to fire, indicating that the Report is ready to be retrieved. + +The response to `/asset_report/pdf/get` is the PDF binary data. The `request_id` is returned in the `Plaid-Request-ID` header. + +[View a sample PDF Asset Report](https://plaid.com/documents/sample-asset-report.pdf). + +See endpoint docs at .*/ + pub fn asset_report_pdf_get( + &self, + asset_report_token: &str, + ) -> FluentRequest<'_, AssetReportPdfGetRequest> { + FluentRequest { + client: self, + params: AssetReportPdfGetRequest { + asset_report_token: asset_report_token.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/asset_report_refresh.rs b/src/request/asset_report_refresh.rs index f0e2e015..67b17162 100644 --- a/src/request/asset_report_refresh.rs +++ b/src/request/asset_report_refresh.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::AssetReportRefreshRequestOptions; /**You should use this struct via [`PlaidClient::asset_report_refresh`]. On request success, this will return a [`AssetReportRefreshResponse`].*/ @@ -13,34 +11,62 @@ pub struct AssetReportRefreshRequest { pub days_requested: Option, pub options: Option, } -impl AssetReportRefreshRequest {} impl FluentRequest<'_, AssetReportRefreshRequest> { + ///Set the value of the days_requested field. pub fn days_requested(mut self, days_requested: i64) -> Self { self.params.days_requested = Some(days_requested); self } + ///Set the value of the options field. pub fn options(mut self, options: AssetReportRefreshRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportRefreshRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/asset_report/refresh"; let mut r = self.client.client.post(url); - r = r.json(json!({ "asset_report_token" : self.params.asset_report_token })); + r = r + .json( + serde_json::json!( + { "asset_report_token" : self.params.asset_report_token } + ), + ); if let Some(ref unwrapped) = self.params.days_requested { - r = r.json(json!({ "days_requested" : unwrapped })); + r = r.json(serde_json::json!({ "days_requested" : unwrapped })); } if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Refresh an Asset Report + +An Asset Report is an immutable snapshot of a user's assets. In order to "refresh" an Asset Report you created previously, you can use the `/asset_report/refresh` endpoint to create a new Asset Report based on the old one, but with the most recent data available. + +The new Asset Report will contain the same Items as the original Report, as well as the same filters applied by any call to `/asset_report/filter`. By default, the new Asset Report will also use the same parameters you submitted with your original `/asset_report/create` request, but the original `days_requested` value and the values of any parameters in the `options` object can be overridden with new values. To change these arguments, simply supply new values for them in your request to `/asset_report/refresh`. Submit an empty string ("") for any previously-populated fields you would like set as empty. + +See endpoint docs at .*/ + pub fn asset_report_refresh( + &self, + asset_report_token: &str, + ) -> FluentRequest<'_, AssetReportRefreshRequest> { + FluentRequest { + client: self, + params: AssetReportRefreshRequest { + asset_report_token: asset_report_token.to_owned(), + days_requested: None, + options: None, + }, + } + } +} diff --git a/src/request/asset_report_remove.rs b/src/request/asset_report_remove.rs index 489f1393..31e02858 100644 --- a/src/request/asset_report_remove.rs +++ b/src/request/asset_report_remove.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::asset_report_remove`]. On request success, this will return a [`AssetReportRemoveResponse`].*/ @@ -11,19 +8,43 @@ On request success, this will return a [`AssetReportRemoveResponse`].*/ pub struct AssetReportRemoveRequest { pub asset_report_token: String, } -impl AssetReportRemoveRequest {} impl FluentRequest<'_, AssetReportRemoveRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AssetReportRemoveRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/asset_report/remove"; let mut r = self.client.client.post(url); - r = r.json(json!({ "asset_report_token" : self.params.asset_report_token })); + r = r + .json( + serde_json::json!( + { "asset_report_token" : self.params.asset_report_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Delete an Asset Report + +The `/item/remove` endpoint allows you to invalidate an `access_token`, meaning you will not be able to create new Asset Reports with it. Removing an Item does not affect any Asset Reports or Audit Copies you have already created, which will remain accessible until you remove them specifically. + +The `/asset_report/remove` endpoint allows you to remove access to an Asset Report. Removing an Asset Report invalidates its `asset_report_token`, meaning you will no longer be able to use it to access Report data or create new Audit Copies. Removing an Asset Report does not affect the underlying Items, but does invalidate any `audit_copy_tokens` associated with the Asset Report. + +See endpoint docs at .*/ + pub fn asset_report_remove( + &self, + asset_report_token: &str, + ) -> FluentRequest<'_, AssetReportRemoveRequest> { + FluentRequest { + client: self, + params: AssetReportRemoveRequest { + asset_report_token: asset_report_token.to_owned(), + }, + } + } +} diff --git a/src/request/auth_get.rs b/src/request/auth_get.rs index 782bc19c..4ec65145 100644 --- a/src/request/auth_get.rs +++ b/src/request/auth_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::AuthGetRequestOptions; /**You should use this struct via [`PlaidClient::auth_get`]. On request success, this will return a [`AuthGetResponse`].*/ @@ -12,27 +10,45 @@ pub struct AuthGetRequest { pub access_token: String, pub options: Option, } -impl AuthGetRequest {} impl FluentRequest<'_, AuthGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: AuthGetRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, AuthGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/auth/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve auth data + +The `/auth/get` endpoint returns the bank account and bank identification numbers (such as routing numbers, for US accounts) associated with an Item's checking and savings accounts, along with high-level account data and balances when available. + +Versioning note: In API version 2017-03-08, the schema of the `numbers` object returned by this endpoint is substantially different. For details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2018-05-22). + +See endpoint docs at .*/ + pub fn auth_get(&self, access_token: &str) -> FluentRequest<'_, AuthGetRequest> { + FluentRequest { + client: self, + params: AuthGetRequest { + access_token: access_token.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/bank_transfer_balance_get.rs b/src/request/bank_transfer_balance_get.rs index 5049d061..48a9618a 100644 --- a/src/request/bank_transfer_balance_get.rs +++ b/src/request/bank_transfer_balance_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::bank_transfer_balance_get`]. On request success, this will return a [`BankTransferBalanceGetResponse`].*/ @@ -11,26 +8,49 @@ On request success, this will return a [`BankTransferBalanceGetResponse`].*/ pub struct BankTransferBalanceGetRequest { pub origination_account_id: Option, } -impl BankTransferBalanceGetRequest {} impl FluentRequest<'_, BankTransferBalanceGetRequest> { + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferBalanceGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::BankTransferBalanceGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/balance/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get balance of your Bank Transfer account + +Use the `/bank_transfer/balance/get` endpoint to see the available balance in your bank transfer account. Debit transfers increase this balance once their status is posted. Credit transfers decrease this balance when they are created. + +The transactable balance shows the amount in your account that you are able to use for transfers, and is essentially your available balance minus your minimum balance. + +Note that this endpoint can only be used with FBO accounts, when using Bank Transfers in the Full Service configuration. It cannot be used on your own account when using Bank Transfers in the BTS Platform configuration. + +See endpoint docs at .*/ + pub fn bank_transfer_balance_get( + &self, + ) -> FluentRequest<'_, BankTransferBalanceGetRequest> { + FluentRequest { + client: self, + params: BankTransferBalanceGetRequest { + origination_account_id: None, + }, + } + } +} diff --git a/src/request/bank_transfer_cancel.rs b/src/request/bank_transfer_cancel.rs index d9c24a4c..8842aa4d 100644 --- a/src/request/bank_transfer_cancel.rs +++ b/src/request/bank_transfer_cancel.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::bank_transfer_cancel`]. On request success, this will return a [`BankTransferCancelResponse`].*/ @@ -11,19 +8,41 @@ On request success, this will return a [`BankTransferCancelResponse`].*/ pub struct BankTransferCancelRequest { pub bank_transfer_id: String, } -impl BankTransferCancelRequest {} impl FluentRequest<'_, BankTransferCancelRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferCancelRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/cancel"; let mut r = self.client.client.post(url); - r = r.json(json!({ "bank_transfer_id" : self.params.bank_transfer_id })); + r = r + .json( + serde_json::json!( + { "bank_transfer_id" : self.params.bank_transfer_id } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Cancel a bank transfer + +Use the `/bank_transfer/cancel` endpoint to cancel a bank transfer. A transfer is eligible for cancelation if the `cancellable` property returned by `/bank_transfer/get` is `true`. + +See endpoint docs at .*/ + pub fn bank_transfer_cancel( + &self, + bank_transfer_id: &str, + ) -> FluentRequest<'_, BankTransferCancelRequest> { + FluentRequest { + client: self, + params: BankTransferCancelRequest { + bank_transfer_id: bank_transfer_id.to_owned(), + }, + } + } +} diff --git a/src/request/bank_transfer_create.rs b/src/request/bank_transfer_create.rs index 8b5c3419..5c95c4ed 100644 --- a/src/request/bank_transfer_create.rs +++ b/src/request/bank_transfer_create.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + ACHClass, BankTransferMetadata, BankTransferNetwork, BankTransferType, + BankTransferUser, +}; /**You should use this struct via [`PlaidClient::bank_transfer_create`]. On request success, this will return a [`BankTransferCreateResponse`].*/ @@ -11,19 +12,18 @@ On request success, this will return a [`BankTransferCreateResponse`].*/ pub struct BankTransferCreateRequest { pub access_token: String, pub account_id: String, - pub ach_class: Option, + pub ach_class: Option, pub amount: String, pub custom_tag: Option, pub description: String, pub idempotency_key: String, pub iso_currency_code: String, pub metadata: Option, - pub network: String, + pub network: BankTransferNetwork, pub origination_account_id: Option, - pub type_: String, + pub type_: BankTransferType, pub user: BankTransferUser, } -impl BankTransferCreateRequest {} pub struct BankTransferCreateRequired<'a> { pub access_token: &'a str, pub account_id: &'a str, @@ -31,60 +31,103 @@ pub struct BankTransferCreateRequired<'a> { pub description: &'a str, pub idempotency_key: &'a str, pub iso_currency_code: &'a str, - pub network: &'a str, - pub type_: &'a str, + pub network: BankTransferNetwork, + pub type_: BankTransferType, pub user: BankTransferUser, } -impl<'a> BankTransferCreateRequired<'a> {} impl FluentRequest<'_, BankTransferCreateRequest> { - pub fn ach_class(mut self, ach_class: &str) -> Self { - self.params.ach_class = Some(ach_class.to_owned()); + ///Set the value of the ach_class field. + pub fn ach_class(mut self, ach_class: AchClass) -> Self { + self.params.ach_class = Some(ach_class); self } + ///Set the value of the custom_tag field. pub fn custom_tag(mut self, custom_tag: &str) -> Self { self.params.custom_tag = Some(custom_tag.to_owned()); self } + ///Set the value of the metadata field. pub fn metadata(mut self, metadata: BankTransferMetadata) -> Self { self.params.metadata = Some(metadata); self } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); if let Some(ref unwrapped) = self.params.ach_class { - r = r.json(json!({ "ach_class" : unwrapped })); + r = r.json(serde_json::json!({ "ach_class" : unwrapped })); } - r = r.json(json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); if let Some(ref unwrapped) = self.params.custom_tag { - r = r.json(json!({ "custom_tag" : unwrapped })); + r = r.json(serde_json::json!({ "custom_tag" : unwrapped })); } - r = r.json(json!({ "description" : self.params.description })); - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); - r = r.json(json!({ "iso_currency_code" : self.params.iso_currency_code })); + r = r.json(serde_json::json!({ "description" : self.params.description })); + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); + r = r + .json( + serde_json::json!( + { "iso_currency_code" : self.params.iso_currency_code } + ), + ); if let Some(ref unwrapped) = self.params.metadata { - r = r.json(json!({ "metadata" : unwrapped })); + r = r.json(serde_json::json!({ "metadata" : unwrapped })); } - r = r.json(json!({ "network" : self.params.network })); + r = r.json(serde_json::json!({ "network" : self.params.network })); if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } - r = r.json(json!({ "type" : self.params.type_ })); - r = r.json(json!({ "user" : self.params.user })); + r = r.json(serde_json::json!({ "type" : self.params.type_ })); + r = r.json(serde_json::json!({ "user" : self.params.user })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a bank transfer + +Use the `/bank_transfer/create` endpoint to initiate a new bank transfer. + +See endpoint docs at .*/ + pub fn bank_transfer_create( + &self, + args: BankTransferCreateRequired, + ) -> FluentRequest<'_, BankTransferCreateRequest> { + FluentRequest { + client: self, + params: BankTransferCreateRequest { + access_token: args.access_token.to_owned(), + account_id: args.account_id.to_owned(), + ach_class: None, + amount: args.amount.to_owned(), + custom_tag: None, + description: args.description.to_owned(), + idempotency_key: args.idempotency_key.to_owned(), + iso_currency_code: args.iso_currency_code.to_owned(), + metadata: None, + network: args.network, + origination_account_id: None, + type_: args.type_, + user: args.user, + }, + } + } +} diff --git a/src/request/bank_transfer_event_list.rs b/src/request/bank_transfer_event_list.rs index 7fbc3eec..69a2c7a5 100644 --- a/src/request/bank_transfer_event_list.rs +++ b/src/request/bank_transfer_event_list.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + BankTransferEventListBankTransferType, BankTransferEventListDirection, + BankTransferEventType, +}; /**You should use this struct via [`PlaidClient::bank_transfer_event_list`]. On request success, this will return a [`BankTransferEventListResponse`].*/ @@ -15,21 +16,23 @@ pub struct BankTransferEventListRequest { pub count: Option, pub direction: Option, pub end_date: Option>, - pub event_types: Option>, + pub event_types: Option>, pub offset: Option, pub origination_account_id: Option, pub start_date: Option>, } -impl BankTransferEventListRequest {} impl FluentRequest<'_, BankTransferEventListRequest> { + ///Set the value of the account_id field. pub fn account_id(mut self, account_id: &str) -> Self { self.params.account_id = Some(account_id.to_owned()); self } + ///Set the value of the bank_transfer_id field. pub fn bank_transfer_id(mut self, bank_transfer_id: &str) -> Self { self.params.bank_transfer_id = Some(bank_transfer_id.to_owned()); self } + ///Set the value of the bank_transfer_type field. pub fn bank_transfer_type( mut self, bank_transfer_type: BankTransferEventListBankTransferType, @@ -37,82 +40,110 @@ impl FluentRequest<'_, BankTransferEventListRequest> { self.params.bank_transfer_type = Some(bank_transfer_type); self } + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the direction field. pub fn direction(mut self, direction: BankTransferEventListDirection) -> Self { self.params.direction = Some(direction); self } + ///Set the value of the end_date field. pub fn end_date(mut self, end_date: chrono::DateTime) -> Self { self.params.end_date = Some(end_date); self } - pub fn event_types( - mut self, - event_types: impl IntoIterator>, - ) -> Self { - self - .params - .event_types = Some( - event_types.into_iter().map(|s| s.as_ref().to_owned()).collect(), - ); + ///Set the value of the event_types field. + pub fn event_types(mut self, event_types: Vec) -> Self { + self.params.event_types = Some(event_types); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } + ///Set the value of the start_date field. pub fn start_date(mut self, start_date: chrono::DateTime) -> Self { self.params.start_date = Some(start_date); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferEventListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::BankTransferEventListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/event/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.account_id { - r = r.json(json!({ "account_id" : unwrapped })); + r = r.json(serde_json::json!({ "account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.bank_transfer_id { - r = r.json(json!({ "bank_transfer_id" : unwrapped })); + r = r.json(serde_json::json!({ "bank_transfer_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.bank_transfer_type { - r = r.json(json!({ "bank_transfer_type" : unwrapped })); + r = r.json(serde_json::json!({ "bank_transfer_type" : unwrapped })); } if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.direction { - r = r.json(json!({ "direction" : unwrapped })); + r = r.json(serde_json::json!({ "direction" : unwrapped })); } if let Some(ref unwrapped) = self.params.end_date { - r = r.json(json!({ "end_date" : unwrapped })); + r = r.json(serde_json::json!({ "end_date" : unwrapped })); } if let Some(ref unwrapped) = self.params.event_types { - r = r.json(json!({ "event_types" : unwrapped })); + r = r.json(serde_json::json!({ "event_types" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.start_date { - r = r.json(json!({ "start_date" : unwrapped })); + r = r.json(serde_json::json!({ "start_date" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List bank transfer events + +Use the `/bank_transfer/event/list` endpoint to get a list of Plaid-initiated ACH or bank transfer events based on specified filter criteria. When using Auth with micro-deposit verification enabled, this endpoint can be used to fetch status updates on ACH micro-deposits. For more details, see [micro-deposit events](https://plaid.com/docs/auth/coverage/microdeposit-events/). + +See endpoint docs at .*/ + pub fn bank_transfer_event_list( + &self, + ) -> FluentRequest<'_, BankTransferEventListRequest> { + FluentRequest { + client: self, + params: BankTransferEventListRequest { + account_id: None, + bank_transfer_id: None, + bank_transfer_type: None, + count: None, + direction: None, + end_date: None, + event_types: None, + offset: None, + origination_account_id: None, + start_date: None, + }, + } + } +} diff --git a/src/request/bank_transfer_event_sync.rs b/src/request/bank_transfer_event_sync.rs index 329531ff..53e41aaf 100644 --- a/src/request/bank_transfer_event_sync.rs +++ b/src/request/bank_transfer_event_sync.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::bank_transfer_event_sync`]. On request success, this will return a [`BankTransferEventSyncResponse`].*/ @@ -12,27 +9,48 @@ pub struct BankTransferEventSyncRequest { pub after_id: i64, pub count: Option, } -impl BankTransferEventSyncRequest {} impl FluentRequest<'_, BankTransferEventSyncRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferEventSyncRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::BankTransferEventSyncResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/event/sync"; let mut r = self.client.client.post(url); - r = r.json(json!({ "after_id" : self.params.after_id })); + r = r.json(serde_json::json!({ "after_id" : self.params.after_id })); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Sync bank transfer events + +`/bank_transfer/event/sync` allows you to request up to the next 25 Plaid-initiated bank transfer events that happened after a specific `event_id`. When using Auth with micro-deposit verification enabled, this endpoint can be used to fetch status updates on ACH micro-deposits. For more details, see [micro-deposit events](https://www.plaid.com/docs/auth/coverage/microdeposit-events/). + +See endpoint docs at .*/ + pub fn bank_transfer_event_sync( + &self, + after_id: i64, + ) -> FluentRequest<'_, BankTransferEventSyncRequest> { + FluentRequest { + client: self, + params: BankTransferEventSyncRequest { + after_id, + count: None, + }, + } + } +} diff --git a/src/request/bank_transfer_get.rs b/src/request/bank_transfer_get.rs index 0de79f9a..333ab865 100644 --- a/src/request/bank_transfer_get.rs +++ b/src/request/bank_transfer_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::bank_transfer_get`]. On request success, this will return a [`BankTransferGetResponse`].*/ @@ -11,19 +8,41 @@ On request success, this will return a [`BankTransferGetResponse`].*/ pub struct BankTransferGetRequest { pub bank_transfer_id: String, } -impl BankTransferGetRequest {} impl FluentRequest<'_, BankTransferGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "bank_transfer_id" : self.params.bank_transfer_id })); + r = r + .json( + serde_json::json!( + { "bank_transfer_id" : self.params.bank_transfer_id } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a bank transfer + +The `/bank_transfer/get` fetches information about the bank transfer corresponding to the given `bank_transfer_id`. + +See endpoint docs at .*/ + pub fn bank_transfer_get( + &self, + bank_transfer_id: &str, + ) -> FluentRequest<'_, BankTransferGetRequest> { + FluentRequest { + client: self, + params: BankTransferGetRequest { + bank_transfer_id: bank_transfer_id.to_owned(), + }, + } + } +} diff --git a/src/request/bank_transfer_list.rs b/src/request/bank_transfer_list.rs index 662dcdc3..ffc78d24 100644 --- a/src/request/bank_transfer_list.rs +++ b/src/request/bank_transfer_list.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::BankTransferDirection; /**You should use this struct via [`PlaidClient::bank_transfer_list`]. On request success, this will return a [`BankTransferListResponse`].*/ @@ -16,61 +14,87 @@ pub struct BankTransferListRequest { pub origination_account_id: Option, pub start_date: Option>, } -impl BankTransferListRequest {} impl FluentRequest<'_, BankTransferListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the direction field. pub fn direction(mut self, direction: BankTransferDirection) -> Self { self.params.direction = Some(direction); self } + ///Set the value of the end_date field. pub fn end_date(mut self, end_date: chrono::DateTime) -> Self { self.params.end_date = Some(end_date); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } + ///Set the value of the start_date field. pub fn start_date(mut self, start_date: chrono::DateTime) -> Self { self.params.start_date = Some(start_date); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.direction { - r = r.json(json!({ "direction" : unwrapped })); + r = r.json(serde_json::json!({ "direction" : unwrapped })); } if let Some(ref unwrapped) = self.params.end_date { - r = r.json(json!({ "end_date" : unwrapped })); + r = r.json(serde_json::json!({ "end_date" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.start_date { - r = r.json(json!({ "start_date" : unwrapped })); + r = r.json(serde_json::json!({ "start_date" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List bank transfers + +Use the `/bank_transfer/list` endpoint to see a list of all your bank transfers and their statuses. Results are paginated; use the `count` and `offset` query parameters to retrieve the desired bank transfers. + + +See endpoint docs at .*/ + pub fn bank_transfer_list(&self) -> FluentRequest<'_, BankTransferListRequest> { + FluentRequest { + client: self, + params: BankTransferListRequest { + count: None, + direction: None, + end_date: None, + offset: None, + origination_account_id: None, + start_date: None, + }, + } + } +} diff --git a/src/request/bank_transfer_migrate_account.rs b/src/request/bank_transfer_migrate_account.rs index d7daf594..587f42a7 100644 --- a/src/request/bank_transfer_migrate_account.rs +++ b/src/request/bank_transfer_migrate_account.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::bank_transfer_migrate_account`]. On request success, this will return a [`BankTransferMigrateAccountResponse`].*/ @@ -14,8 +11,8 @@ pub struct BankTransferMigrateAccountRequest { pub routing_number: String, pub wire_routing_number: Option, } -impl BankTransferMigrateAccountRequest {} impl FluentRequest<'_, BankTransferMigrateAccountRequest> { + ///Set the value of the wire_routing_number field. pub fn wire_routing_number(mut self, wire_routing_number: &str) -> Self { self.params.wire_routing_number = Some(wire_routing_number.to_owned()); self @@ -23,21 +20,52 @@ impl FluentRequest<'_, BankTransferMigrateAccountRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferMigrateAccountRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::BankTransferMigrateAccountResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/migrate_account"; let mut r = self.client.client.post(url); - r = r.json(json!({ "account_number" : self.params.account_number })); - r = r.json(json!({ "account_type" : self.params.account_type })); - r = r.json(json!({ "routing_number" : self.params.routing_number })); + r = r + .json( + serde_json::json!({ "account_number" : self.params.account_number }), + ); + r = r.json(serde_json::json!({ "account_type" : self.params.account_type })); + r = r + .json( + serde_json::json!({ "routing_number" : self.params.routing_number }), + ); if let Some(ref unwrapped) = self.params.wire_routing_number { - r = r.json(json!({ "wire_routing_number" : unwrapped })); + r = r.json(serde_json::json!({ "wire_routing_number" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Migrate account into Bank Transfers + +As an alternative to adding Items via Link, you can also use the `/bank_transfer/migrate_account` endpoint to migrate known account and routing numbers to Plaid Items. Note that Items created in this way are not compatible with endpoints for other products, such as `/accounts/balance/get`, and can only be used with Bank Transfer endpoints. If you require access to other endpoints, create the Item through Link instead. Access to `/bank_transfer/migrate_account` is not enabled by default; to obtain access, contact your Plaid Account Manager. + +See endpoint docs at .*/ + pub fn bank_transfer_migrate_account( + &self, + account_number: &str, + account_type: &str, + routing_number: &str, + ) -> FluentRequest<'_, BankTransferMigrateAccountRequest> { + FluentRequest { + client: self, + params: BankTransferMigrateAccountRequest { + account_number: account_number.to_owned(), + account_type: account_type.to_owned(), + routing_number: routing_number.to_owned(), + wire_routing_number: None, + }, + } + } +} diff --git a/src/request/bank_transfer_sweep_get.rs b/src/request/bank_transfer_sweep_get.rs index 2930833e..c3011c3d 100644 --- a/src/request/bank_transfer_sweep_get.rs +++ b/src/request/bank_transfer_sweep_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::bank_transfer_sweep_get`]. On request success, this will return a [`BankTransferSweepGetResponse`].*/ @@ -11,19 +8,36 @@ On request success, this will return a [`BankTransferSweepGetResponse`].*/ pub struct BankTransferSweepGetRequest { pub sweep_id: String, } -impl BankTransferSweepGetRequest {} impl FluentRequest<'_, BankTransferSweepGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferSweepGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/sweep/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "sweep_id" : self.params.sweep_id })); + r = r.json(serde_json::json!({ "sweep_id" : self.params.sweep_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a sweep + +The `/bank_transfer/sweep/get` endpoint fetches information about the sweep corresponding to the given `sweep_id`. + +See endpoint docs at .*/ + pub fn bank_transfer_sweep_get( + &self, + sweep_id: &str, + ) -> FluentRequest<'_, BankTransferSweepGetRequest> { + FluentRequest { + client: self, + params: BankTransferSweepGetRequest { + sweep_id: sweep_id.to_owned(), + }, + } + } +} diff --git a/src/request/bank_transfer_sweep_list.rs b/src/request/bank_transfer_sweep_list.rs index b5f2f9b6..ab0732c8 100644 --- a/src/request/bank_transfer_sweep_list.rs +++ b/src/request/bank_transfer_sweep_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::bank_transfer_sweep_list`]. On request success, this will return a [`BankTransferSweepListResponse`].*/ @@ -14,47 +11,72 @@ pub struct BankTransferSweepListRequest { pub origination_account_id: Option, pub start_time: Option>, } -impl BankTransferSweepListRequest {} impl FluentRequest<'_, BankTransferSweepListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the end_time field. pub fn end_time(mut self, end_time: chrono::DateTime) -> Self { self.params.end_time = Some(end_time); self } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } + ///Set the value of the start_time field. pub fn start_time(mut self, start_time: chrono::DateTime) -> Self { self.params.start_time = Some(start_time); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BankTransferSweepListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::BankTransferSweepListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/bank_transfer/sweep/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.end_time { - r = r.json(json!({ "end_time" : unwrapped })); + r = r.json(serde_json::json!({ "end_time" : unwrapped })); } if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.start_time { - r = r.json(json!({ "start_time" : unwrapped })); + r = r.json(serde_json::json!({ "start_time" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List sweeps + +The `/bank_transfer/sweep/list` endpoint fetches information about the sweeps matching the given filters. + +See endpoint docs at .*/ + pub fn bank_transfer_sweep_list( + &self, + ) -> FluentRequest<'_, BankTransferSweepListRequest> { + FluentRequest { + client: self, + params: BankTransferSweepListRequest { + count: None, + end_time: None, + origination_account_id: None, + start_time: None, + }, + } + } +} diff --git a/src/request/base_report_get.rs b/src/request/base_report_get.rs deleted file mode 100644 index e41156e6..00000000 --- a/src/request/base_report_get.rs +++ /dev/null @@ -1,29 +0,0 @@ -use serde_json::json; -use crate::model::*; -use crate::FluentRequest; -use serde::{Serialize, Deserialize}; -use httpclient::InMemoryResponseExt; -use crate::PlaidClient; -/**You should use this struct via [`PlaidClient::base_report_get`]. - -On request success, this will return a [`BaseReportGetResponse`].*/ -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct BaseReportGetRequest { - pub user_token: String, -} -impl BaseReportGetRequest {} -impl FluentRequest<'_, BaseReportGetRequest> {} -impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BaseReportGetRequest> { - type Output = httpclient::InMemoryResult; - type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; - fn into_future(self) -> Self::IntoFuture { - Box::pin(async move { - let url = "/cra/base_report/get"; - let mut r = self.client.client.post(url); - r = r.json(json!({ "user_token" : self.params.user_token })); - r = self.client.authenticate(r); - let res = r.await?; - res.json().map_err(Into::into) - }) - } -} \ No newline at end of file diff --git a/src/request/beacon_account_risk_evaluate.rs b/src/request/beacon_account_risk_evaluate.rs new file mode 100644 index 00000000..63abcebe --- /dev/null +++ b/src/request/beacon_account_risk_evaluate.rs @@ -0,0 +1,120 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::{ + SignalDevice, BeaconAccountRiskEvaluateEvaluationReason, + BeaconAccountRiskEvaluateRequestOptions, +}; +/**You should use this struct via [`PlaidClient::beacon_account_risk_evaluate`]. + +On request success, this will return a [`BeaconAccountRiskEvaluateResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BeaconAccountRiskEvaluateRequest { + pub access_token: Option, + pub client_evaluation_id: Option, + pub client_user_id: Option, + pub device: Option, + pub evaluate_time: Option, + pub evaluation_reason: Option, + pub options: Option, +} +impl FluentRequest<'_, BeaconAccountRiskEvaluateRequest> { + ///Set the value of the access_token field. + pub fn access_token(mut self, access_token: &str) -> Self { + self.params.access_token = Some(access_token.to_owned()); + self + } + ///Set the value of the client_evaluation_id field. + pub fn client_evaluation_id(mut self, client_evaluation_id: &str) -> Self { + self.params.client_evaluation_id = Some(client_evaluation_id.to_owned()); + self + } + ///Set the value of the client_user_id field. + pub fn client_user_id(mut self, client_user_id: &str) -> Self { + self.params.client_user_id = Some(client_user_id.to_owned()); + self + } + ///Set the value of the device field. + pub fn device(mut self, device: SignalDevice) -> Self { + self.params.device = Some(device); + self + } + ///Set the value of the evaluate_time field. + pub fn evaluate_time(mut self, evaluate_time: &str) -> Self { + self.params.evaluate_time = Some(evaluate_time.to_owned()); + self + } + ///Set the value of the evaluation_reason field. + pub fn evaluation_reason( + mut self, + evaluation_reason: BeaconAccountRiskEvaluateEvaluationReason, + ) -> Self { + self.params.evaluation_reason = Some(evaluation_reason); + self + } + ///Set the value of the options field. + pub fn options(mut self, options: BeaconAccountRiskEvaluateRequestOptions) -> Self { + self.params.options = Some(options); + self + } +} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, BeaconAccountRiskEvaluateRequest> { + type Output = httpclient::InMemoryResult< + crate::model::BeaconAccountRiskEvaluateResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/beacon/account_risk/v1/evaluate"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.access_token { + r = r.json(serde_json::json!({ "access_token" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.client_evaluation_id { + r = r.json(serde_json::json!({ "client_evaluation_id" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.client_user_id { + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.device { + r = r.json(serde_json::json!({ "device" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.evaluate_time { + r = r.json(serde_json::json!({ "evaluate_time" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.evaluation_reason { + r = r.json(serde_json::json!({ "evaluation_reason" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.options { + r = r.json(serde_json::json!({ "options" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Evaluate risk of a bank account + +Use `/beacon/account_risk/v1/evaluate` to get risk insights for a linked account. + +See endpoint docs at .*/ + pub fn beacon_account_risk_evaluate( + &self, + ) -> FluentRequest<'_, BeaconAccountRiskEvaluateRequest> { + FluentRequest { + client: self, + params: BeaconAccountRiskEvaluateRequest { + access_token: None, + client_evaluation_id: None, + client_user_id: None, + device: None, + evaluate_time: None, + evaluation_reason: None, + options: None, + }, + } + } +} diff --git a/src/request/beacon_duplicate_get.rs b/src/request/beacon_duplicate_get.rs index 9bb2dc8c..090d1a63 100644 --- a/src/request/beacon_duplicate_get.rs +++ b/src/request/beacon_duplicate_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::beacon_duplicate_get`]. On request success, this will return a [`BeaconDuplicateGetResponse`].*/ @@ -11,10 +8,9 @@ On request success, this will return a [`BeaconDuplicateGetResponse`].*/ pub struct BeaconDuplicateGetRequest { pub beacon_duplicate_id: String, } -impl BeaconDuplicateGetRequest {} impl FluentRequest<'_, BeaconDuplicateGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconDuplicateGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -22,11 +18,38 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconDuplicateGetReque let mut r = self.client.client.post(url); r = r .json( - json!({ "beacon_duplicate_id" : self.params.beacon_duplicate_id }), + serde_json::json!( + { "beacon_duplicate_id" : self.params.beacon_duplicate_id } + ), ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get a Beacon Duplicate + +Returns a Beacon Duplicate for a given Beacon Duplicate id. + +A Beacon Duplicate represents a pair of similar Beacon Users within your organization. + +Two Beacon User revisions are returned for each Duplicate record in either the `beacon_user1` or `beacon_user2` response fields. + +The `analysis` field in the response indicates which fields matched between `beacon_user1` and `beacon_user2`. + + +See endpoint docs at .*/ + pub fn beacon_duplicate_get( + &self, + beacon_duplicate_id: &str, + ) -> FluentRequest<'_, BeaconDuplicateGetRequest> { + FluentRequest { + client: self, + params: BeaconDuplicateGetRequest { + beacon_duplicate_id: beacon_duplicate_id.to_owned(), + }, + } + } +} diff --git a/src/request/beacon_report_create.rs b/src/request/beacon_report_create.rs index 431bde3d..a1ba6c2d 100644 --- a/src/request/beacon_report_create.rs +++ b/src/request/beacon_report_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{FraudAmount, BeaconReportCreateType}; /**You should use this struct via [`PlaidClient::beacon_report_create`]. On request success, this will return a [`BeaconReportCreateResponse`].*/ @@ -12,31 +10,57 @@ pub struct BeaconReportCreateRequest { pub beacon_user_id: String, pub fraud_amount: Option, pub fraud_date: chrono::NaiveDate, - pub type_: String, + pub type_: BeaconReportCreateType, } -impl BeaconReportCreateRequest {} impl FluentRequest<'_, BeaconReportCreateRequest> { + ///Set the value of the fraud_amount field. pub fn fraud_amount(mut self, fraud_amount: FraudAmount) -> Self { self.params.fraud_amount = Some(fraud_amount); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconReportCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beacon/report/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "beacon_user_id" : self.params.beacon_user_id })); + r = r + .json( + serde_json::json!({ "beacon_user_id" : self.params.beacon_user_id }), + ); if let Some(ref unwrapped) = self.params.fraud_amount { - r = r.json(json!({ "fraud_amount" : unwrapped })); + r = r.json(serde_json::json!({ "fraud_amount" : unwrapped })); } - r = r.json(json!({ "fraud_date" : self.params.fraud_date })); - r = r.json(json!({ "type" : self.params.type_ })); + r = r.json(serde_json::json!({ "fraud_date" : self.params.fraud_date })); + r = r.json(serde_json::json!({ "type" : self.params.type_ })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a Beacon Report + +Create a fraud report for a given Beacon User. + +See endpoint docs at .*/ + pub fn beacon_report_create( + &self, + beacon_user_id: &str, + fraud_date: chrono::NaiveDate, + type_: BeaconReportCreateType, + ) -> FluentRequest<'_, BeaconReportCreateRequest> { + FluentRequest { + client: self, + params: BeaconReportCreateRequest { + beacon_user_id: beacon_user_id.to_owned(), + fraud_amount: None, + fraud_date, + type_, + }, + } + } +} diff --git a/src/request/beacon_report_get.rs b/src/request/beacon_report_get.rs index 40dc182a..be6e5796 100644 --- a/src/request/beacon_report_get.rs +++ b/src/request/beacon_report_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::beacon_report_get`]. On request success, this will return a [`BeaconReportGetResponse`].*/ @@ -11,19 +8,41 @@ On request success, this will return a [`BeaconReportGetResponse`].*/ pub struct BeaconReportGetRequest { pub beacon_report_id: String, } -impl BeaconReportGetRequest {} impl FluentRequest<'_, BeaconReportGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconReportGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beacon/report/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "beacon_report_id" : self.params.beacon_report_id })); + r = r + .json( + serde_json::json!( + { "beacon_report_id" : self.params.beacon_report_id } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get a Beacon Report + +Returns a Beacon report for a given Beacon report id. + +See endpoint docs at .*/ + pub fn beacon_report_get( + &self, + beacon_report_id: &str, + ) -> FluentRequest<'_, BeaconReportGetRequest> { + FluentRequest { + client: self, + params: BeaconReportGetRequest { + beacon_report_id: beacon_report_id.to_owned(), + }, + } + } +} diff --git a/src/request/beacon_report_list.rs b/src/request/beacon_report_list.rs index d7aa84aa..353113d0 100644 --- a/src/request/beacon_report_list.rs +++ b/src/request/beacon_report_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::beacon_report_list`]. On request success, this will return a [`BeaconReportListResponse`].*/ @@ -12,27 +9,49 @@ pub struct BeaconReportListRequest { pub beacon_user_id: String, pub cursor: Option, } -impl BeaconReportListRequest {} impl FluentRequest<'_, BeaconReportListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconReportListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beacon/report/list"; let mut r = self.client.client.post(url); - r = r.json(json!({ "beacon_user_id" : self.params.beacon_user_id })); + r = r + .json( + serde_json::json!({ "beacon_user_id" : self.params.beacon_user_id }), + ); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List Beacon Reports for a Beacon User + +Use the `/beacon/report/list` endpoint to view all Beacon Reports you created for a specific Beacon User. The reports returned by this endpoint are exclusively reports you created for a specific user. A Beacon User can only have one active report at a time, but a new report can be created if a previous report has been deleted. The results from this endpoint are paginated; the `next_cursor` field will be populated if there is another page of results that can be retrieved. To fetch the next page, pass the `next_cursor` value as the `cursor` parameter in the next request. + +See endpoint docs at .*/ + pub fn beacon_report_list( + &self, + beacon_user_id: &str, + ) -> FluentRequest<'_, BeaconReportListRequest> { + FluentRequest { + client: self, + params: BeaconReportListRequest { + beacon_user_id: beacon_user_id.to_owned(), + cursor: None, + }, + } + } +} diff --git a/src/request/beacon_report_syndication_get.rs b/src/request/beacon_report_syndication_get.rs index 4f8f79e1..fac7eba7 100644 --- a/src/request/beacon_report_syndication_get.rs +++ b/src/request/beacon_report_syndication_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::beacon_report_syndication_get`]. On request success, this will return a [`BeaconReportSyndicationGetResponse`].*/ @@ -11,11 +8,12 @@ On request success, this will return a [`BeaconReportSyndicationGetResponse`].*/ pub struct BeaconReportSyndicationGetRequest { pub beacon_report_syndication_id: String, } -impl BeaconReportSyndicationGetRequest {} impl FluentRequest<'_, BeaconReportSyndicationGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconReportSyndicationGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::BeaconReportSyndicationGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,7 +21,7 @@ for FluentRequest<'a, BeaconReportSyndicationGetRequest> { let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "beacon_report_syndication_id" : self.params .beacon_report_syndication_id } ), @@ -33,4 +31,22 @@ for FluentRequest<'a, BeaconReportSyndicationGetRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get a Beacon Report Syndication + +Returns a Beacon Report Syndication for a given Beacon Report Syndication id. + +See endpoint docs at .*/ + pub fn beacon_report_syndication_get( + &self, + beacon_report_syndication_id: &str, + ) -> FluentRequest<'_, BeaconReportSyndicationGetRequest> { + FluentRequest { + client: self, + params: BeaconReportSyndicationGetRequest { + beacon_report_syndication_id: beacon_report_syndication_id.to_owned(), + }, + } + } +} diff --git a/src/request/beacon_report_syndication_list.rs b/src/request/beacon_report_syndication_list.rs index c9af7948..d61a8577 100644 --- a/src/request/beacon_report_syndication_list.rs +++ b/src/request/beacon_report_syndication_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::beacon_report_syndication_list`]. On request success, this will return a [`BeaconReportSyndicationListResponse`].*/ @@ -12,8 +9,8 @@ pub struct BeaconReportSyndicationListRequest { pub beacon_user_id: String, pub cursor: Option, } -impl BeaconReportSyndicationListRequest {} impl FluentRequest<'_, BeaconReportSyndicationListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -21,19 +18,43 @@ impl FluentRequest<'_, BeaconReportSyndicationListRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconReportSyndicationListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::BeaconReportSyndicationListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beacon/report_syndication/list"; let mut r = self.client.client.post(url); - r = r.json(json!({ "beacon_user_id" : self.params.beacon_user_id })); + r = r + .json( + serde_json::json!({ "beacon_user_id" : self.params.beacon_user_id }), + ); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List Beacon Report Syndications for a Beacon User + +Use the `/beacon/report_syndication/list` endpoint to view all Beacon Reports that have been syndicated to a specific Beacon User. This endpoint returns Beacon Report Syndications which are references to Beacon Reports created either by you, or another Beacon customer, that matched the specified Beacon User. A Beacon User can have multiple active Beacon Report Syndications at once. The results from this endpoint are paginated; the `next_cursor` field will be populated if there is another page of results that can be retrieved. To fetch the next page, pass the `next_cursor` value as the `cursor` parameter in the next request. + +See endpoint docs at .*/ + pub fn beacon_report_syndication_list( + &self, + beacon_user_id: &str, + ) -> FluentRequest<'_, BeaconReportSyndicationListRequest> { + FluentRequest { + client: self, + params: BeaconReportSyndicationListRequest { + beacon_user_id: beacon_user_id.to_owned(), + cursor: None, + }, + } + } +} diff --git a/src/request/beacon_user_account_insights_get.rs b/src/request/beacon_user_account_insights_get.rs new file mode 100644 index 00000000..edbcbcc0 --- /dev/null +++ b/src/request/beacon_user_account_insights_get.rs @@ -0,0 +1,53 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::beacon_user_account_insights_get`]. + +On request success, this will return a [`BeaconUserAccountInsightsGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BeaconUserAccountInsightsGetRequest { + pub access_token: String, + pub beacon_user_id: String, +} +impl FluentRequest<'_, BeaconUserAccountInsightsGetRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, BeaconUserAccountInsightsGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::BeaconUserAccountInsightsGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/beacon/user/account_insights/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r + .json( + serde_json::json!({ "beacon_user_id" : self.params.beacon_user_id }), + ); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Get Account Insights for a Beacon User + +Get Account Insights for all Accounts linked to this Beacon User. The insights for each account are computed based on the information that was last retrieved from the financial institution. + +See endpoint docs at .*/ + pub fn beacon_user_account_insights_get( + &self, + access_token: &str, + beacon_user_id: &str, + ) -> FluentRequest<'_, BeaconUserAccountInsightsGetRequest> { + FluentRequest { + client: self, + params: BeaconUserAccountInsightsGetRequest { + access_token: access_token.to_owned(), + beacon_user_id: beacon_user_id.to_owned(), + }, + } + } +} diff --git a/src/request/beacon_user_create.rs b/src/request/beacon_user_create.rs index ba56ef3d..b6255678 100644 --- a/src/request/beacon_user_create.rs +++ b/src/request/beacon_user_create.rs @@ -1,33 +1,81 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::BeaconUserRequestData; /**You should use this struct via [`PlaidClient::beacon_user_create`]. On request success, this will return a [`BeaconUserCreateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserCreateRequest { + pub access_tokens: Option>, pub client_user_id: String, pub program_id: String, pub user: BeaconUserRequestData, } -impl BeaconUserCreateRequest {} -impl FluentRequest<'_, BeaconUserCreateRequest> {} +impl FluentRequest<'_, BeaconUserCreateRequest> { + ///Set the value of the access_tokens field. + pub fn access_tokens( + mut self, + access_tokens: impl IntoIterator>, + ) -> Self { + self + .params + .access_tokens = Some( + access_tokens.into_iter().map(|s| s.as_ref().to_owned()).collect(), + ); + self + } +} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconUserCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beacon/user/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "client_user_id" : self.params.client_user_id })); - r = r.json(json!({ "program_id" : self.params.program_id })); - r = r.json(json!({ "user" : self.params.user })); + if let Some(ref unwrapped) = self.params.access_tokens { + r = r.json(serde_json::json!({ "access_tokens" : unwrapped })); + } + r = r + .json( + serde_json::json!({ "client_user_id" : self.params.client_user_id }), + ); + r = r.json(serde_json::json!({ "program_id" : self.params.program_id })); + r = r.json(serde_json::json!({ "user" : self.params.user })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a Beacon User + +Create and scan a Beacon User against your Beacon Program, according to your program's settings. + +When you submit a new user to `/beacon/user/create`, several checks are performed immediately: + + - The user's PII (provided within the `user` object) is searched against all other users within the Beacon Program you specified. If a match is found that violates your program's "Duplicate Information Filtering" settings, the user will be returned with a status of `pending_review`. + + - The user's PII is also searched against all fraud reports created by your organization across all of your Beacon Programs. If the user's data matches a fraud report that your team created, the user will be returned with a status of `rejected`. + + - Finally, the user's PII is searched against all fraud report shared with the Beacon Network by other companies. If a matching fraud report is found, the user will be returned with a `pending_review` status if your program has enabled automatic flagging based on network fraud. + +See endpoint docs at .*/ + pub fn beacon_user_create( + &self, + client_user_id: &str, + program_id: &str, + user: BeaconUserRequestData, + ) -> FluentRequest<'_, BeaconUserCreateRequest> { + FluentRequest { + client: self, + params: BeaconUserCreateRequest { + access_tokens: None, + client_user_id: client_user_id.to_owned(), + program_id: program_id.to_owned(), + user, + }, + } + } +} diff --git a/src/request/beacon_user_get.rs b/src/request/beacon_user_get.rs index 2580f474..45be376d 100644 --- a/src/request/beacon_user_get.rs +++ b/src/request/beacon_user_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::beacon_user_get`]. On request success, this will return a [`BeaconUserGetResponse`].*/ @@ -11,19 +8,42 @@ On request success, this will return a [`BeaconUserGetResponse`].*/ pub struct BeaconUserGetRequest { pub beacon_user_id: String, } -impl BeaconUserGetRequest {} impl FluentRequest<'_, BeaconUserGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconUserGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beacon/user/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "beacon_user_id" : self.params.beacon_user_id })); + r = r + .json( + serde_json::json!({ "beacon_user_id" : self.params.beacon_user_id }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get a Beacon User + +Fetch a Beacon User. + +The Beacon User is returned with all of their associated information and a `status` based on the Beacon Network duplicate record and fraud checks. + + +See endpoint docs at .*/ + pub fn beacon_user_get( + &self, + beacon_user_id: &str, + ) -> FluentRequest<'_, BeaconUserGetRequest> { + FluentRequest { + client: self, + params: BeaconUserGetRequest { + beacon_user_id: beacon_user_id.to_owned(), + }, + } + } +} diff --git a/src/request/beacon_user_history_list.rs b/src/request/beacon_user_history_list.rs new file mode 100644 index 00000000..1899e6c0 --- /dev/null +++ b/src/request/beacon_user_history_list.rs @@ -0,0 +1,59 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::beacon_user_history_list`]. + +On request success, this will return a [`BeaconUserHistoryListResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct BeaconUserHistoryListRequest { + pub beacon_user_id: String, + pub cursor: Option, +} +impl FluentRequest<'_, BeaconUserHistoryListRequest> { + ///Set the value of the cursor field. + pub fn cursor(mut self, cursor: &str) -> Self { + self.params.cursor = Some(cursor.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconUserHistoryListRequest> { + type Output = httpclient::InMemoryResult< + crate::model::BeaconUserHistoryListResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/beacon/user/history/list"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!({ "beacon_user_id" : self.params.beacon_user_id }), + ); + if let Some(ref unwrapped) = self.params.cursor { + r = r.json(serde_json::json!({ "cursor" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**List a Beacon User's history + +List all changes to the Beacon User in reverse-chronological order. + +See endpoint docs at .*/ + pub fn beacon_user_history_list( + &self, + beacon_user_id: &str, + ) -> FluentRequest<'_, BeaconUserHistoryListRequest> { + FluentRequest { + client: self, + params: BeaconUserHistoryListRequest { + beacon_user_id: beacon_user_id.to_owned(), + cursor: None, + }, + } + } +} diff --git a/src/request/beacon_user_review.rs b/src/request/beacon_user_review.rs index 5ca54262..69b69f25 100644 --- a/src/request/beacon_user_review.rs +++ b/src/request/beacon_user_review.rs @@ -1,31 +1,62 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::BeaconUserStatus; /**You should use this struct via [`PlaidClient::beacon_user_review`]. On request success, this will return a [`BeaconUserGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserReviewRequest { pub beacon_user_id: String, - pub status: String, + pub status: BeaconUserStatus, } -impl BeaconUserReviewRequest {} impl FluentRequest<'_, BeaconUserReviewRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconUserReviewRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beacon/user/review"; let mut r = self.client.client.post(url); - r = r.json(json!({ "beacon_user_id" : self.params.beacon_user_id })); - r = r.json(json!({ "status" : self.params.status })); + r = r + .json( + serde_json::json!({ "beacon_user_id" : self.params.beacon_user_id }), + ); + r = r.json(serde_json::json!({ "status" : self.params.status })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Review a Beacon User + +Update the status of a Beacon User. + +When updating a Beacon User's status via this endpoint, Plaid validates that the status change is consistent with the related state for this Beacon User. Specifically, we will check: + +1. Whether there are any associated Beacon Reports connected to the Beacon User, and +2. Whether there are any confirmed Beacon Report Syndications connected to the Beacon User. + +When updating a Beacon User's status to "rejected", we enforce that either a Beacon Report has been created for the Beacon User or a Beacon Report Syndication has been confirmed. +When updating a Beacon User's status to "cleared", we enforce that there are no active Beacon Reports or confirmed Beacon Report Syndications associated with the user. If you previously created a Beacon Report for this user, you must delete it before updating the Beacon User's status to "cleared". +There are no restrictions on updating a Beacon User's status to "pending_review". + +If these conditions are not met, the request will be rejected with an error explaining the issue. + +See endpoint docs at .*/ + pub fn beacon_user_review( + &self, + beacon_user_id: &str, + status: BeaconUserStatus, + ) -> FluentRequest<'_, BeaconUserReviewRequest> { + FluentRequest { + client: self, + params: BeaconUserReviewRequest { + beacon_user_id: beacon_user_id.to_owned(), + status, + }, + } + } +} diff --git a/src/request/beacon_user_update.rs b/src/request/beacon_user_update.rs index bbe542bf..bdc39a97 100644 --- a/src/request/beacon_user_update.rs +++ b/src/request/beacon_user_update.rs @@ -1,31 +1,85 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::BeaconUserUpdateRequestData; /**You should use this struct via [`PlaidClient::beacon_user_update`]. On request success, this will return a [`BeaconUserUpdateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct BeaconUserUpdateRequest { + pub access_tokens: Option>, pub beacon_user_id: String, - pub user: BeaconUserUpdateRequestData, + pub user: Option, +} +impl FluentRequest<'_, BeaconUserUpdateRequest> { + ///Set the value of the access_tokens field. + pub fn access_tokens( + mut self, + access_tokens: impl IntoIterator>, + ) -> Self { + self + .params + .access_tokens = Some( + access_tokens.into_iter().map(|s| s.as_ref().to_owned()).collect(), + ); + self + } + ///Set the value of the user field. + pub fn user(mut self, user: BeaconUserUpdateRequestData) -> Self { + self.params.user = Some(user); + self + } } -impl BeaconUserUpdateRequest {} -impl FluentRequest<'_, BeaconUserUpdateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, BeaconUserUpdateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beacon/user/update"; let mut r = self.client.client.post(url); - r = r.json(json!({ "beacon_user_id" : self.params.beacon_user_id })); - r = r.json(json!({ "user" : self.params.user })); + if let Some(ref unwrapped) = self.params.access_tokens { + r = r.json(serde_json::json!({ "access_tokens" : unwrapped })); + } + r = r + .json( + serde_json::json!({ "beacon_user_id" : self.params.beacon_user_id }), + ); + if let Some(ref unwrapped) = self.params.user { + r = r.json(serde_json::json!({ "user" : unwrapped })); + } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update the identity data of a Beacon User + +Update the identity data for a Beacon User in your Beacon Program or add new accounts to the Beacon User. + +Similar to `/beacon/user/create`, several checks are performed immediately when you submit an identity data change to `/beacon/user/update`: + + - The user's updated PII is searched against all other users within the Beacon Program you specified. If a match is found that violates your program's "Duplicate Information Filtering" settings, the user will be returned with a status of `pending_review`. + + - The user's updated PII is also searched against all fraud reports created by your organization across all of your Beacon Programs. If the user's data matches a fraud report that your team created, the user will be returned with a status of `rejected`. + + - Finally, the user's PII is searched against all fraud report shared with the Beacon Network by other companies. If a matching fraud report is found, the user will be returned with a `pending_review` status if your program has enabled automatic flagging based on network fraud. + +Plaid maintains a version history for each Beacon User, so the Beacon User's identity data before and after the update is retained as separate versions. + +See endpoint docs at .*/ + pub fn beacon_user_update( + &self, + beacon_user_id: &str, + ) -> FluentRequest<'_, BeaconUserUpdateRequest> { + FluentRequest { + client: self, + params: BeaconUserUpdateRequest { + access_tokens: None, + beacon_user_id: beacon_user_id.to_owned(), + user: None, + }, + } + } +} diff --git a/src/request/categories_get.rs b/src/request/categories_get.rs index f0badafc..4d97c8e6 100644 --- a/src/request/categories_get.rs +++ b/src/request/categories_get.rs @@ -1,27 +1,43 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::categories_get`]. On request success, this will return a [`CategoriesGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct CategoriesGetRequest {} -impl CategoriesGetRequest {} +pub struct CategoriesGetRequest { + pub body: serde_json::Value, +} impl FluentRequest<'_, CategoriesGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CategoriesGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/categories/get"; let mut r = self.client.client.post(url); - r = r.set_query(self.params); + r = r.json(serde_json::json!({ "body" : self.params.body })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get categories + +Send a request to the `/categories/get` endpoint to get detailed information on categories returned by Plaid. This endpoint does not require authentication. + +All implementations are recommended to use the newer `personal_finance_category` taxonomy instead of the older `category` taxonomy supported by this endpoint. The [`personal_finance_category taxonomy` CSV file](https://plaid.com/documents/transactions-personal-finance-category-taxonomy.csv) is available for download and is not accessible via API. + +See endpoint docs at .*/ + pub fn categories_get( + &self, + body: serde_json::Value, + ) -> FluentRequest<'_, CategoriesGetRequest> { + FluentRequest { + client: self, + params: CategoriesGetRequest { body }, + } + } +} diff --git a/src/request/consent_events_get.rs b/src/request/consent_events_get.rs new file mode 100644 index 00000000..2cfca07f --- /dev/null +++ b/src/request/consent_events_get.rs @@ -0,0 +1,41 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::consent_events_get`]. + +On request success, this will return a [`ConsentEventsGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ConsentEventsGetRequest { + pub access_token: String, +} +impl FluentRequest<'_, ConsentEventsGetRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ConsentEventsGetRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/consent/events/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**List a historical log of item consent events + +See endpoint docs at .*/ + pub fn consent_events_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, ConsentEventsGetRequest> { + FluentRequest { + client: self, + params: ConsentEventsGetRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/consumer_report_pdf_get.rs b/src/request/consumer_report_pdf_get.rs new file mode 100644 index 00000000..a0f7550d --- /dev/null +++ b/src/request/consumer_report_pdf_get.rs @@ -0,0 +1,45 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::consumer_report_pdf_get`]. + +On request success, this will return a [`()`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ConsumerReportPdfGetRequest { + pub user_token: String, +} +impl FluentRequest<'_, ConsumerReportPdfGetRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ConsumerReportPdfGetRequest> { + type Output = httpclient::InMemoryResult<()>; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/consumer_report/pdf/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve a PDF Reports + +Retrieves all existing CRB Bank Income and Base reports for the consumer in PDF format. + +Response is PDF binary data. The `request_id` is returned in the `Plaid-Request-ID` header. + +See endpoint docs at .*/ + pub fn consumer_report_pdf_get( + &self, + user_token: &str, + ) -> FluentRequest<'_, ConsumerReportPdfGetRequest> { + FluentRequest { + client: self, + params: ConsumerReportPdfGetRequest { + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/cra_bank_income_create.rs b/src/request/cra_bank_income_create.rs new file mode 100644 index 00000000..308102a9 --- /dev/null +++ b/src/request/cra_bank_income_create.rs @@ -0,0 +1,94 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::ConsumerReportPermissiblePurpose; +/**You should use this struct via [`PlaidClient::cra_bank_income_create`]. + +On request success, this will return a [`CraBankIncomeCreateResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraBankIncomeCreateRequest { + pub consumer_report_permissible_purpose: Option, + pub days_requested: Option, + pub user_token: Option, + pub webhook: Option, +} +impl FluentRequest<'_, CraBankIncomeCreateRequest> { + ///Set the value of the consumer_report_permissible_purpose field. + pub fn consumer_report_permissible_purpose( + mut self, + consumer_report_permissible_purpose: ConsumerReportPermissiblePurpose, + ) -> Self { + self + .params + .consumer_report_permissible_purpose = Some( + consumer_report_permissible_purpose, + ); + self + } + ///Set the value of the days_requested field. + pub fn days_requested(mut self, days_requested: i64) -> Self { + self.params.days_requested = Some(days_requested); + self + } + ///Set the value of the user_token field. + pub fn user_token(mut self, user_token: &str) -> Self { + self.params.user_token = Some(user_token.to_owned()); + self + } + ///Set the value of the webhook field. + pub fn webhook(mut self, webhook: &str) -> Self { + self.params.webhook = Some(webhook.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraBankIncomeCreateRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/bank_income/create"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.consumer_report_permissible_purpose + { + r = r + .json( + serde_json::json!( + { "consumer_report_permissible_purpose" : unwrapped } + ), + ); + } + if let Some(ref unwrapped) = self.params.days_requested { + r = r.json(serde_json::json!({ "days_requested" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.user_token { + r = r.json(serde_json::json!({ "user_token" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.webhook { + r = r.json(serde_json::json!({ "webhook" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Create a CRA report for income verification + +`/cra/bank_income/create` creates a CRA report for income verification + +See endpoint docs at .*/ + pub fn cra_bank_income_create( + &self, + ) -> FluentRequest<'_, CraBankIncomeCreateRequest> { + FluentRequest { + client: self, + params: CraBankIncomeCreateRequest { + consumer_report_permissible_purpose: None, + days_requested: None, + user_token: None, + webhook: None, + }, + } + } +} diff --git a/src/request/cra_bank_income_get.rs b/src/request/cra_bank_income_get.rs index 5d29f1d8..d9ddc755 100644 --- a/src/request/cra_bank_income_get.rs +++ b/src/request/cra_bank_income_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::cra_bank_income_get`]. On request success, this will return a [`CraBankIncomeGetResponse`].*/ @@ -11,26 +8,41 @@ On request success, this will return a [`CraBankIncomeGetResponse`].*/ pub struct CraBankIncomeGetRequest { pub user_token: Option, } -impl CraBankIncomeGetRequest {} impl FluentRequest<'_, CraBankIncomeGetRequest> { + ///Set the value of the user_token field. pub fn user_token(mut self, user_token: &str) -> Self { self.params.user_token = Some(user_token.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraBankIncomeGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/cra/bank_income/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.user_token { - r = r.json(json!({ "user_token" : unwrapped })); + r = r.json(serde_json::json!({ "user_token" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve information from the bank accounts used for income verification + +`/cra/bank_income/get` returns the bank income report(s) for a specified user. + +See endpoint docs at .*/ + pub fn cra_bank_income_get(&self) -> FluentRequest<'_, CraBankIncomeGetRequest> { + FluentRequest { + client: self, + params: CraBankIncomeGetRequest { + user_token: None, + }, + } + } +} diff --git a/src/request/cra_base_report_create.rs b/src/request/cra_base_report_create.rs new file mode 100644 index 00000000..dbe1f7e2 --- /dev/null +++ b/src/request/cra_base_report_create.rs @@ -0,0 +1,72 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::ConsumerReportPermissiblePurpose; +/**You should use this struct via [`PlaidClient::cra_base_report_create`]. + +On request success, this will return a [`CraBaseReportCreateResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraBaseReportCreateRequest { + pub consumer_report_permissible_purpose: ConsumerReportPermissiblePurpose, + pub days_requested: i64, + pub user_token: String, + pub webhook: Option, +} +impl FluentRequest<'_, CraBaseReportCreateRequest> { + ///Set the value of the webhook field. + pub fn webhook(mut self, webhook: &str) -> Self { + self.params.webhook = Some(webhook.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraBaseReportCreateRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/base_report/create"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!( + { "consumer_report_permissible_purpose" : self.params + .consumer_report_permissible_purpose } + ), + ); + r = r + .json( + serde_json::json!({ "days_requested" : self.params.days_requested }), + ); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + if let Some(ref unwrapped) = self.params.webhook { + r = r.json(serde_json::json!({ "webhook" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Create a Base Report + +This endpoint allows the customer to create a Base Report by passing in a user token. The Base Report will be generated based on the most recently linked item from the user token. + +See endpoint docs at .*/ + pub fn cra_base_report_create( + &self, + consumer_report_permissible_purpose: ConsumerReportPermissiblePurpose, + days_requested: i64, + user_token: &str, + ) -> FluentRequest<'_, CraBaseReportCreateRequest> { + FluentRequest { + client: self, + params: CraBaseReportCreateRequest { + consumer_report_permissible_purpose, + days_requested, + user_token: user_token.to_owned(), + webhook: None, + }, + } + } +} diff --git a/src/request/cra_base_report_get.rs b/src/request/cra_base_report_get.rs new file mode 100644 index 00000000..a73afe70 --- /dev/null +++ b/src/request/cra_base_report_get.rs @@ -0,0 +1,43 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::cra_base_report_get`]. + +On request success, this will return a [`CraBaseReportGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraBaseReportGetRequest { + pub user_token: String, +} +impl FluentRequest<'_, CraBaseReportGetRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraBaseReportGetRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/base_report/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve a Base Report + +This endpoint allows the customer to retrieve a Base Report. Customers should pass in the `user_token` created in `/user/create`. + +See endpoint docs at .*/ + pub fn cra_base_report_get( + &self, + user_token: &str, + ) -> FluentRequest<'_, CraBaseReportGetRequest> { + FluentRequest { + client: self, + params: CraBaseReportGetRequest { + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/cra_check_report_base_report_get.rs b/src/request/cra_check_report_base_report_get.rs new file mode 100644 index 00000000..c152615b --- /dev/null +++ b/src/request/cra_check_report_base_report_get.rs @@ -0,0 +1,80 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::cra_check_report_base_report_get`]. + +On request success, this will return a [`CraCheckReportBaseReportGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraCheckReportBaseReportGetRequest { + pub item_ids: Option>, + pub third_party_user_token: Option, + pub user_token: Option, +} +impl FluentRequest<'_, CraCheckReportBaseReportGetRequest> { + ///Set the value of the item_ids field. + pub fn item_ids( + mut self, + item_ids: impl IntoIterator>, + ) -> Self { + self + .params + .item_ids = Some( + item_ids.into_iter().map(|s| s.as_ref().to_owned()).collect(), + ); + self + } + ///Set the value of the third_party_user_token field. + pub fn third_party_user_token(mut self, third_party_user_token: &str) -> Self { + self.params.third_party_user_token = Some(third_party_user_token.to_owned()); + self + } + ///Set the value of the user_token field. + pub fn user_token(mut self, user_token: &str) -> Self { + self.params.user_token = Some(user_token.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, CraCheckReportBaseReportGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::CraCheckReportBaseReportGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/check_report/base_report/get"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.item_ids { + r = r.json(serde_json::json!({ "item_ids" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.third_party_user_token { + r = r.json(serde_json::json!({ "third_party_user_token" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.user_token { + r = r.json(serde_json::json!({ "user_token" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve a Base Report + +This endpoint allows you to retrieve the Base Report for your user, allowing you to receive comprehensive bank account and cash flow data. You should call this endpoint after you've received a `CHECK_REPORT_READY` webhook, either after the Link session for the user or after calling `/cra/check_report/create`. If the most recent consumer report for the user doesn't have sufficient data to generate the base report, or the consumer report has expired, you will receive an error indicating that you should create a new consumer report by calling `/cra/check_report/create`. + +See endpoint docs at .*/ + pub fn cra_check_report_base_report_get( + &self, + ) -> FluentRequest<'_, CraCheckReportBaseReportGetRequest> { + FluentRequest { + client: self, + params: CraCheckReportBaseReportGetRequest { + item_ids: None, + third_party_user_token: None, + user_token: None, + }, + } + } +} diff --git a/src/request/cra_check_report_create.rs b/src/request/cra_check_report_create.rs new file mode 100644 index 00000000..71b7b189 --- /dev/null +++ b/src/request/cra_check_report_create.rs @@ -0,0 +1,82 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::ConsumerReportPermissiblePurpose; +/**You should use this struct via [`PlaidClient::cra_check_report_create`]. + +On request success, this will return a [`CraCheckReportCreateResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraCheckReportCreateRequest { + pub consumer_report_permissible_purpose: ConsumerReportPermissiblePurpose, + pub days_requested: i64, + pub days_required: Option, + pub user_token: String, + pub webhook: String, +} +pub struct CraCheckReportCreateRequired<'a> { + pub consumer_report_permissible_purpose: ConsumerReportPermissiblePurpose, + pub days_requested: i64, + pub user_token: &'a str, + pub webhook: &'a str, +} +impl FluentRequest<'_, CraCheckReportCreateRequest> { + ///Set the value of the days_required field. + pub fn days_required(mut self, days_required: i64) -> Self { + self.params.days_required = Some(days_required); + self + } +} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraCheckReportCreateRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/check_report/create"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!( + { "consumer_report_permissible_purpose" : self.params + .consumer_report_permissible_purpose } + ), + ); + r = r + .json( + serde_json::json!({ "days_requested" : self.params.days_requested }), + ); + if let Some(ref unwrapped) = self.params.days_required { + r = r.json(serde_json::json!({ "days_required" : unwrapped })); + } + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = r.json(serde_json::json!({ "webhook" : self.params.webhook })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Create a Consumer Report + +`/cra/check_report/create` creates a Consumer Report powered by Plaid Check. You can call this endpoint to create a new report if `consumer_report_permissible_purpose` was omitted during Link token creation. If you did provide a `consumer_report_permissible_purpose` during Link token creation, then Plaid Check will automatically begin creating a Consumer Report once the user completes the Link process, and it is not necessary to call `/cra/check_report/create` before retrieving the report. + + `/cra/check_report/create` can also be used to refresh data in an existing report. A Consumer Report will last for 24 hours before expiring; you should call any `/get` endpoints on the report before it expires. If a report expires, you can call `/cra/check_report/create` again to re-generate it. Note that refreshing or regenerating a report is a billable event. + +See endpoint docs at .*/ + pub fn cra_check_report_create( + &self, + args: CraCheckReportCreateRequired, + ) -> FluentRequest<'_, CraCheckReportCreateRequest> { + FluentRequest { + client: self, + params: CraCheckReportCreateRequest { + consumer_report_permissible_purpose: args + .consumer_report_permissible_purpose, + days_requested: args.days_requested, + days_required: None, + user_token: args.user_token.to_owned(), + webhook: args.webhook.to_owned(), + }, + } + } +} diff --git a/src/request/cra_check_report_income_insights_get.rs b/src/request/cra_check_report_income_insights_get.rs new file mode 100644 index 00000000..6a01a1ef --- /dev/null +++ b/src/request/cra_check_report_income_insights_get.rs @@ -0,0 +1,63 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::cra_check_report_income_insights_get`]. + +On request success, this will return a [`CraCheckReportIncomeInsightsGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraCheckReportIncomeInsightsGetRequest { + pub third_party_user_token: Option, + pub user_token: Option, +} +impl FluentRequest<'_, CraCheckReportIncomeInsightsGetRequest> { + ///Set the value of the third_party_user_token field. + pub fn third_party_user_token(mut self, third_party_user_token: &str) -> Self { + self.params.third_party_user_token = Some(third_party_user_token.to_owned()); + self + } + ///Set the value of the user_token field. + pub fn user_token(mut self, user_token: &str) -> Self { + self.params.user_token = Some(user_token.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, CraCheckReportIncomeInsightsGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::CraCheckReportIncomeInsightsGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/check_report/income_insights/get"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.third_party_user_token { + r = r.json(serde_json::json!({ "third_party_user_token" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.user_token { + r = r.json(serde_json::json!({ "user_token" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve cash flow information from your user's banks + +This endpoint allows you to retrieve the Income Insights report for your user. You should call this endpoint after you've received a `CHECK_REPORT_READY` webhook, either after the Link session for the user or after calling `/cra/check_report/create`. If the most recent consumer report for the user doesn’t have sufficient data to generate the base report, or the consumer report has expired, you will receive an error indicating that you should create a new consumer report by calling `/cra/check_report/create`. + +See endpoint docs at .*/ + pub fn cra_check_report_income_insights_get( + &self, + ) -> FluentRequest<'_, CraCheckReportIncomeInsightsGetRequest> { + FluentRequest { + client: self, + params: CraCheckReportIncomeInsightsGetRequest { + third_party_user_token: None, + user_token: None, + }, + } + } +} diff --git a/src/request/cra_check_report_network_insights_get.rs b/src/request/cra_check_report_network_insights_get.rs new file mode 100644 index 00000000..f7a20f78 --- /dev/null +++ b/src/request/cra_check_report_network_insights_get.rs @@ -0,0 +1,65 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::cra_check_report_network_insights_get`]. + +On request success, this will return a [`CraCheckReportNetworkInsightsGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraCheckReportNetworkInsightsGetRequest { + pub third_party_user_token: Option, + pub user_token: Option, +} +impl FluentRequest<'_, CraCheckReportNetworkInsightsGetRequest> { + ///Set the value of the third_party_user_token field. + pub fn third_party_user_token(mut self, third_party_user_token: &str) -> Self { + self.params.third_party_user_token = Some(third_party_user_token.to_owned()); + self + } + ///Set the value of the user_token field. + pub fn user_token(mut self, user_token: &str) -> Self { + self.params.user_token = Some(user_token.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, CraCheckReportNetworkInsightsGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::CraCheckReportNetworkInsightsGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/check_report/network_insights/get"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.third_party_user_token { + r = r.json(serde_json::json!({ "third_party_user_token" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.user_token { + r = r.json(serde_json::json!({ "user_token" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve network attributes for the user + +This endpoint allows you to retrieve the Network Insights product for your user. You should call this endpoint after you've received the `CHECK_REPORT_READY` webhook, either after the Link session for the user or after calling `/cra/check_report/create`. If the most recent consumer report for the user doesn’t have sufficient data to generate the report, or the consumer report has expired, you will receive an error indicating that you should create a new consumer report by calling `/cra/check_report/create`. + +If you did not initialize Link with the `cra_network_attributes` product or have generated a report using `/cra/check_report/create`, we will generate the attributes when you call this endpoint. + +See endpoint docs at .*/ + pub fn cra_check_report_network_insights_get( + &self, + ) -> FluentRequest<'_, CraCheckReportNetworkInsightsGetRequest> { + FluentRequest { + client: self, + params: CraCheckReportNetworkInsightsGetRequest { + third_party_user_token: None, + user_token: None, + }, + } + } +} diff --git a/src/request/cra_check_report_partner_insights_get.rs b/src/request/cra_check_report_partner_insights_get.rs new file mode 100644 index 00000000..aa3a9e7d --- /dev/null +++ b/src/request/cra_check_report_partner_insights_get.rs @@ -0,0 +1,76 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::CraCheckReportPartnerInsightsGetOptions; +/**You should use this struct via [`PlaidClient::cra_check_report_partner_insights_get`]. + +On request success, this will return a [`CraCheckReportPartnerInsightsGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraCheckReportPartnerInsightsGetRequest { + pub options: Option, + pub third_party_user_token: Option, + pub user_token: Option, +} +impl FluentRequest<'_, CraCheckReportPartnerInsightsGetRequest> { + ///Set the value of the options field. + pub fn options(mut self, options: CraCheckReportPartnerInsightsGetOptions) -> Self { + self.params.options = Some(options); + self + } + ///Set the value of the third_party_user_token field. + pub fn third_party_user_token(mut self, third_party_user_token: &str) -> Self { + self.params.third_party_user_token = Some(third_party_user_token.to_owned()); + self + } + ///Set the value of the user_token field. + pub fn user_token(mut self, user_token: &str) -> Self { + self.params.user_token = Some(user_token.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, CraCheckReportPartnerInsightsGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::CraCheckReportPartnerInsightsGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/check_report/partner_insights/get"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.options { + r = r.json(serde_json::json!({ "options" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.third_party_user_token { + r = r.json(serde_json::json!({ "third_party_user_token" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.user_token { + r = r.json(serde_json::json!({ "user_token" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve cash flow insights from partners + +This endpoint allows you to retrieve the Partner Insights report for your user. You should call this endpoint after you've received the `CHECK_REPORT_READY` webhook, either after the Link session for the user or after calling `/cra/check_report/create`. If the most recent consumer report for the user doesn’t have sufficient data to generate the base report, or the consumer report has expired, you will receive an error indicating that you should create a new consumer report by calling `/cra/check_report/create`. + +If you did not initialize Link with the `credit_partner_insights` product or have generated a report using `/cra/check_report/create`, we will call our partners to generate the insights when you call this endpoint. In this case, you may optionally provide parameters under `options` to configure which insights you want to receive. + +See endpoint docs at .*/ + pub fn cra_check_report_partner_insights_get( + &self, + ) -> FluentRequest<'_, CraCheckReportPartnerInsightsGetRequest> { + FluentRequest { + client: self, + params: CraCheckReportPartnerInsightsGetRequest { + options: None, + third_party_user_token: None, + user_token: None, + }, + } + } +} diff --git a/src/request/cra_check_report_pdf_get.rs b/src/request/cra_check_report_pdf_get.rs new file mode 100644 index 00000000..a6add914 --- /dev/null +++ b/src/request/cra_check_report_pdf_get.rs @@ -0,0 +1,71 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::CraPDFAddOns; +/**You should use this struct via [`PlaidClient::cra_check_report_pdf_get`]. + +On request success, this will return a [`()`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraCheckReportPdfGetRequest { + pub add_ons: Option>, + pub third_party_user_token: Option, + pub user_token: Option, +} +impl FluentRequest<'_, CraCheckReportPdfGetRequest> { + ///Set the value of the add_ons field. + pub fn add_ons(mut self, add_ons: Vec) -> Self { + self.params.add_ons = Some(add_ons); + self + } + ///Set the value of the third_party_user_token field. + pub fn third_party_user_token(mut self, third_party_user_token: &str) -> Self { + self.params.third_party_user_token = Some(third_party_user_token.to_owned()); + self + } + ///Set the value of the user_token field. + pub fn user_token(mut self, user_token: &str) -> Self { + self.params.user_token = Some(user_token.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraCheckReportPdfGetRequest> { + type Output = httpclient::InMemoryResult<()>; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/check_report/pdf/get"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.add_ons { + r = r.json(serde_json::json!({ "add_ons" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.third_party_user_token { + r = r.json(serde_json::json!({ "third_party_user_token" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.user_token { + r = r.json(serde_json::json!({ "user_token" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve Consumer Reports as a PDF + +`/cra/check_report/pdf/get` retrieves the most recent Consumer Report in PDF format. By default, the most recent Base Report (if it exists) for the user will be returned. To request that the most recent Income Insights report be included in the PDF as well, use the `add-ons` field. + +See endpoint docs at .*/ + pub fn cra_check_report_pdf_get( + &self, + ) -> FluentRequest<'_, CraCheckReportPdfGetRequest> { + FluentRequest { + client: self, + params: CraCheckReportPdfGetRequest { + add_ons: None, + third_party_user_token: None, + user_token: None, + }, + } + } +} diff --git a/src/request/cra_loans_applications_register.rs b/src/request/cra_loans_applications_register.rs new file mode 100644 index 00000000..2e552d66 --- /dev/null +++ b/src/request/cra_loans_applications_register.rs @@ -0,0 +1,47 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::CraLoanApplication; +/**You should use this struct via [`PlaidClient::cra_loans_applications_register`]. + +On request success, this will return a [`CraLoansApplicationsRegisterResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoansApplicationsRegisterRequest { + pub applications: Vec, +} +impl FluentRequest<'_, CraLoansApplicationsRegisterRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, CraLoansApplicationsRegisterRequest> { + type Output = httpclient::InMemoryResult< + crate::model::CraLoansApplicationsRegisterResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/loans/applications/register"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "applications" : self.params.applications })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Register loan applications and decisions. + +`/cra/loans/applications/register` registers loan applications and decisions. + +See endpoint docs at .*/ + pub fn cra_loans_applications_register( + &self, + applications: Vec, + ) -> FluentRequest<'_, CraLoansApplicationsRegisterRequest> { + FluentRequest { + client: self, + params: CraLoansApplicationsRegisterRequest { + applications, + }, + } + } +} diff --git a/src/request/cra_loans_register.rs b/src/request/cra_loans_register.rs new file mode 100644 index 00000000..e3a4cdcb --- /dev/null +++ b/src/request/cra_loans_register.rs @@ -0,0 +1,42 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::CraLoanRegister; +/**You should use this struct via [`PlaidClient::cra_loans_register`]. + +On request success, this will return a [`CraLoansRegisterResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoansRegisterRequest { + pub loans: Vec, +} +impl FluentRequest<'_, CraLoansRegisterRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraLoansRegisterRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/loans/register"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "loans" : self.params.loans })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Register a list of loans to their applicants. + +`/cra/loans/register` registers a list of loans to their applicants. + +See endpoint docs at .*/ + pub fn cra_loans_register( + &self, + loans: Vec, + ) -> FluentRequest<'_, CraLoansRegisterRequest> { + FluentRequest { + client: self, + params: CraLoansRegisterRequest { loans }, + } + } +} diff --git a/src/request/cra_loans_unregister.rs b/src/request/cra_loans_unregister.rs new file mode 100644 index 00000000..c8e3b898 --- /dev/null +++ b/src/request/cra_loans_unregister.rs @@ -0,0 +1,42 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::CraLoanUnregister; +/**You should use this struct via [`PlaidClient::cra_loans_unregister`]. + +On request success, this will return a [`CraLoanUnregisterResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoansUnregisterRequest { + pub loans: Vec, +} +impl FluentRequest<'_, CraLoansUnregisterRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraLoansUnregisterRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/loans/unregister"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "loans" : self.params.loans })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Unregister a list of loans. + +`/cra/loans/unregister` indicates the loans have reached a final status and no further updates are expected. + +See endpoint docs at .*/ + pub fn cra_loans_unregister( + &self, + loans: Vec, + ) -> FluentRequest<'_, CraLoansUnregisterRequest> { + FluentRequest { + client: self, + params: CraLoansUnregisterRequest { loans }, + } + } +} diff --git a/src/request/cra_loans_update.rs b/src/request/cra_loans_update.rs new file mode 100644 index 00000000..4385cca8 --- /dev/null +++ b/src/request/cra_loans_update.rs @@ -0,0 +1,42 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::CraLoanUpdate; +/**You should use this struct via [`PlaidClient::cra_loans_update`]. + +On request success, this will return a [`CraLoansUpdateResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraLoansUpdateRequest { + pub loans: Vec, +} +impl FluentRequest<'_, CraLoansUpdateRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraLoansUpdateRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/loans/update"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "loans" : self.params.loans })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Updates loan data. + +`/cra/loans/update` updates loan information such as the status and payment history. + +See endpoint docs at .*/ + pub fn cra_loans_update( + &self, + loans: Vec, + ) -> FluentRequest<'_, CraLoansUpdateRequest> { + FluentRequest { + client: self, + params: CraLoansUpdateRequest { loans }, + } + } +} diff --git a/src/request/cra_monitoring_insights_get.rs b/src/request/cra_monitoring_insights_get.rs new file mode 100644 index 00000000..fb01ef4a --- /dev/null +++ b/src/request/cra_monitoring_insights_get.rs @@ -0,0 +1,57 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::MonitoringConsumerReportPermissiblePurpose; +/**You should use this struct via [`PlaidClient::cra_monitoring_insights_get`]. + +On request success, this will return a [`CraMonitoringInsightsGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraMonitoringInsightsGetRequest { + pub consumer_report_permissible_purpose: MonitoringConsumerReportPermissiblePurpose, + pub user_token: String, +} +impl FluentRequest<'_, CraMonitoringInsightsGetRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, CraMonitoringInsightsGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::CraMonitoringInsightsGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/monitoring_insights/get"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!( + { "consumer_report_permissible_purpose" : self.params + .consumer_report_permissible_purpose } + ), + ); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve a Monitoring Insights Report + +This endpoint allows you to retrieve a Monitoring Insights report by passing in the `user_token` referred to in the webhook you received. + +See endpoint docs at .*/ + pub fn cra_monitoring_insights_get( + &self, + consumer_report_permissible_purpose: MonitoringConsumerReportPermissiblePurpose, + user_token: &str, + ) -> FluentRequest<'_, CraMonitoringInsightsGetRequest> { + FluentRequest { + client: self, + params: CraMonitoringInsightsGetRequest { + consumer_report_permissible_purpose, + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/cra_monitoring_insights_subscribe.rs b/src/request/cra_monitoring_insights_subscribe.rs new file mode 100644 index 00000000..b1adba6f --- /dev/null +++ b/src/request/cra_monitoring_insights_subscribe.rs @@ -0,0 +1,50 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::cra_monitoring_insights_subscribe`]. + +On request success, this will return a [`CraMonitoringInsightsSubscribeResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraMonitoringInsightsSubscribeRequest { + pub user_token: String, + pub webhook: String, +} +impl FluentRequest<'_, CraMonitoringInsightsSubscribeRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, CraMonitoringInsightsSubscribeRequest> { + type Output = httpclient::InMemoryResult< + crate::model::CraMonitoringInsightsSubscribeResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/monitoring_insights/subscribe"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = r.json(serde_json::json!({ "webhook" : self.params.webhook })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Subscribe to Monitoring Insights + +This endpoint allows you to subscribe to insights for a user's linked CRA items, which are updated every 14 days. + +See endpoint docs at .*/ + pub fn cra_monitoring_insights_subscribe( + &self, + user_token: &str, + webhook: &str, + ) -> FluentRequest<'_, CraMonitoringInsightsSubscribeRequest> { + FluentRequest { + client: self, + params: CraMonitoringInsightsSubscribeRequest { + user_token: user_token.to_owned(), + webhook: webhook.to_owned(), + }, + } + } +} diff --git a/src/request/cra_monitoring_insights_unsubscribe.rs b/src/request/cra_monitoring_insights_unsubscribe.rs new file mode 100644 index 00000000..67ceed0c --- /dev/null +++ b/src/request/cra_monitoring_insights_unsubscribe.rs @@ -0,0 +1,51 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::cra_monitoring_insights_unsubscribe`]. + +On request success, this will return a [`CraMonitoringInsightsUnsubscribeResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraMonitoringInsightsUnsubscribeRequest { + pub subscription_id: String, +} +impl FluentRequest<'_, CraMonitoringInsightsUnsubscribeRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, CraMonitoringInsightsUnsubscribeRequest> { + type Output = httpclient::InMemoryResult< + crate::model::CraMonitoringInsightsUnsubscribeResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/monitoring_insights/unsubscribe"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!( + { "subscription_id" : self.params.subscription_id } + ), + ); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Unsubscribe from Monitoring Insights + +This endpoint allows you to unsubscribe from previously subscribed Monitoring Insights. + +See endpoint docs at .*/ + pub fn cra_monitoring_insights_unsubscribe( + &self, + subscription_id: &str, + ) -> FluentRequest<'_, CraMonitoringInsightsUnsubscribeRequest> { + FluentRequest { + client: self, + params: CraMonitoringInsightsUnsubscribeRequest { + subscription_id: subscription_id.to_owned(), + }, + } + } +} diff --git a/src/request/cra_partner_insights_get.rs b/src/request/cra_partner_insights_get.rs new file mode 100644 index 00000000..81f2aee6 --- /dev/null +++ b/src/request/cra_partner_insights_get.rs @@ -0,0 +1,45 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::cra_partner_insights_get`]. + +On request success, this will return a [`CraPartnerInsightsGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct CraPartnerInsightsGetRequest { + pub user_token: String, +} +impl FluentRequest<'_, CraPartnerInsightsGetRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CraPartnerInsightsGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::CraPartnerInsightsGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/cra/partner_insights/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve cash flow insights from the bank accounts used for income verification + +`/cra/partner_insights/get` returns cash flow insights for a specified user. + +See endpoint docs at .*/ + pub fn cra_partner_insights_get( + &self, + user_token: &str, + ) -> FluentRequest<'_, CraPartnerInsightsGetRequest> { + FluentRequest { + client: self, + params: CraPartnerInsightsGetRequest { + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/create_payment_token.rs b/src/request/create_payment_token.rs index b01f3f7a..eab7bfe7 100644 --- a/src/request/create_payment_token.rs +++ b/src/request/create_payment_token.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::create_payment_token`]. On request success, this will return a [`PaymentInitiationPaymentTokenCreateResponse`].*/ @@ -11,21 +8,40 @@ On request success, this will return a [`PaymentInitiationPaymentTokenCreateResp pub struct CreatePaymentTokenRequest { pub payment_id: String, } -impl CreatePaymentTokenRequest {} impl FluentRequest<'_, CreatePaymentTokenRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreatePaymentTokenRequest> { type Output = httpclient::InMemoryResult< - PaymentInitiationPaymentTokenCreateResponse, + crate::model::PaymentInitiationPaymentTokenCreateResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/payment/token/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "payment_id" : self.params.payment_id })); + r = r.json(serde_json::json!({ "payment_id" : self.params.payment_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create payment token + +The `/payment_initiation/payment/token/create` endpoint has been deprecated. New Plaid customers will be unable to use this endpoint, and existing customers are encouraged to migrate to the newer, `link_token`-based flow. The recommended flow is to provide the `payment_id` to `/link/token/create`, which returns a `link_token` used to initialize Link. + +The `/payment_initiation/payment/token/create` is used to create a `payment_token`, which can then be used in Link initialization to enter a payment initiation flow. You can only use a `payment_token` once. If this attempt fails, the end user aborts the flow, or the token expires, you will need to create a new payment token. Creating a new payment token does not require end user input. + +See endpoint docs at .*/ + pub fn create_payment_token( + &self, + payment_id: &str, + ) -> FluentRequest<'_, CreatePaymentTokenRequest> { + FluentRequest { + client: self, + params: CreatePaymentTokenRequest { + payment_id: payment_id.to_owned(), + }, + } + } +} diff --git a/src/request/credit_asset_report_freddie_mac_get.rs b/src/request/credit_asset_report_freddie_mac_get.rs index 27fdfbeb..fdc966ac 100644 --- a/src/request/credit_asset_report_freddie_mac_get.rs +++ b/src/request/credit_asset_report_freddie_mac_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_asset_report_freddie_mac_get`]. On request success, this will return a [`AssetReportFreddieGetResponse`].*/ @@ -11,20 +8,44 @@ On request success, this will return a [`AssetReportFreddieGetResponse`].*/ pub struct CreditAssetReportFreddieMacGetRequest { pub audit_copy_token: String, } -impl CreditAssetReportFreddieMacGetRequest {} impl FluentRequest<'_, CreditAssetReportFreddieMacGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditAssetReportFreddieMacGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::AssetReportFreddieGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/asset_report/freddie_mac/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "audit_copy_token" : self.params.audit_copy_token })); + r = r + .json( + serde_json::json!( + { "audit_copy_token" : self.params.audit_copy_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve an Asset Report with Freddie Mac format. Only Freddie Mac can use this endpoint. + +The `credit/asset_report/freddie_mac/get` endpoint retrieves the Asset Report in Freddie Mac's JSON format. + +See endpoint docs at .*/ + pub fn credit_asset_report_freddie_mac_get( + &self, + audit_copy_token: &str, + ) -> FluentRequest<'_, CreditAssetReportFreddieMacGetRequest> { + FluentRequest { + client: self, + params: CreditAssetReportFreddieMacGetRequest { + audit_copy_token: audit_copy_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_audit_copy_token_create.rs b/src/request/credit_audit_copy_token_create.rs index 241b3be9..21262abc 100644 --- a/src/request/credit_audit_copy_token_create.rs +++ b/src/request/credit_audit_copy_token_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_audit_copy_token_create`]. On request success, this will return a [`CreditAuditCopyTokenCreateResponse`].*/ @@ -11,20 +8,44 @@ On request success, this will return a [`CreditAuditCopyTokenCreateResponse`].*/ pub struct CreditAuditCopyTokenCreateRequest { pub report_tokens: Vec, } -impl CreditAuditCopyTokenCreateRequest {} impl FluentRequest<'_, CreditAuditCopyTokenCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditAuditCopyTokenCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditAuditCopyTokenCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/audit_copy_token/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "report_tokens" : self.params.report_tokens })); + r = r + .json( + serde_json::json!({ "report_tokens" : self.params.report_tokens }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create Asset or Income Report Audit Copy Token + +Plaid can create an Audit Copy token of an Asset Report and/or Income Report to share with participating Government Sponsored Entity (GSE). If you participate in the Day 1 Certainty™ program, Plaid can supply an Audit Copy token directly to Fannie Mae on your behalf. An Audit Copy token contains the same underlying data as the Asset Report and/or Income Report (result of /credit/payroll_income/get). + +Use the `/credit/audit_copy_token/create` endpoint to create an `audit_copy_token` and then pass that token to the GSE who needs access. + +See endpoint docs at .*/ + pub fn credit_audit_copy_token_create( + &self, + report_tokens: &[&str], + ) -> FluentRequest<'_, CreditAuditCopyTokenCreateRequest> { + FluentRequest { + client: self, + params: CreditAuditCopyTokenCreateRequest { + report_tokens: report_tokens.iter().map(|&x| x.to_owned()).collect(), + }, + } + } +} diff --git a/src/request/credit_audit_copy_token_update.rs b/src/request/credit_audit_copy_token_update.rs index 7dc04816..37cc1503 100644 --- a/src/request/credit_audit_copy_token_update.rs +++ b/src/request/credit_audit_copy_token_update.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_audit_copy_token_update`]. On request success, this will return a [`CreditAuditCopyTokenUpdateResponse`].*/ @@ -12,21 +9,50 @@ pub struct CreditAuditCopyTokenUpdateRequest { pub audit_copy_token: String, pub report_tokens: Vec, } -impl CreditAuditCopyTokenUpdateRequest {} impl FluentRequest<'_, CreditAuditCopyTokenUpdateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditAuditCopyTokenUpdateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditAuditCopyTokenUpdateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/audit_copy_token/update"; let mut r = self.client.client.post(url); - r = r.json(json!({ "audit_copy_token" : self.params.audit_copy_token })); - r = r.json(json!({ "report_tokens" : self.params.report_tokens })); + r = r + .json( + serde_json::json!( + { "audit_copy_token" : self.params.audit_copy_token } + ), + ); + r = r + .json( + serde_json::json!({ "report_tokens" : self.params.report_tokens }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update an Audit Copy Token + +The `/credit/audit_copy_token/update` endpoint updates an existing Audit Copy Token by adding the report tokens in the `report_tokens` field to the `audit_copy_token`. If the Audit Copy Token already contains a report of a certain type, it will be replaced with the token provided in the `report_tokens` field. + +See endpoint docs at .*/ + pub fn credit_audit_copy_token_update( + &self, + audit_copy_token: &str, + report_tokens: &[&str], + ) -> FluentRequest<'_, CreditAuditCopyTokenUpdateRequest> { + FluentRequest { + client: self, + params: CreditAuditCopyTokenUpdateRequest { + audit_copy_token: audit_copy_token.to_owned(), + report_tokens: report_tokens.iter().map(|&x| x.to_owned()).collect(), + }, + } + } +} diff --git a/src/request/credit_bank_employment_get.rs b/src/request/credit_bank_employment_get.rs index a60ca2eb..aa8a42d1 100644 --- a/src/request/credit_bank_employment_get.rs +++ b/src/request/credit_bank_employment_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_bank_employment_get`]. On request success, this will return a [`CreditBankEmploymentGetResponse`].*/ @@ -11,20 +8,39 @@ On request success, this will return a [`CreditBankEmploymentGetResponse`].*/ pub struct CreditBankEmploymentGetRequest { pub user_token: String, } -impl CreditBankEmploymentGetRequest {} impl FluentRequest<'_, CreditBankEmploymentGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditBankEmploymentGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditBankEmploymentGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beta/credit/v1/bank_employment/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "user_token" : self.params.user_token })); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve information from the bank accounts used for employment verification + +`/credit/bank_employment/get` returns the employment report(s) derived from bank transaction data for a specified user. + +See endpoint docs at .*/ + pub fn credit_bank_employment_get( + &self, + user_token: &str, + ) -> FluentRequest<'_, CreditBankEmploymentGetRequest> { + FluentRequest { + client: self, + params: CreditBankEmploymentGetRequest { + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_bank_income_get.rs b/src/request/credit_bank_income_get.rs index ce62acf1..91f072fb 100644 --- a/src/request/credit_bank_income_get.rs +++ b/src/request/credit_bank_income_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::CreditBankIncomeGetRequestOptions; /**You should use this struct via [`PlaidClient::credit_bank_income_get`]. On request success, this will return a [`CreditBankIncomeGetResponse`].*/ @@ -12,33 +10,52 @@ pub struct CreditBankIncomeGetRequest { pub options: Option, pub user_token: Option, } -impl CreditBankIncomeGetRequest {} impl FluentRequest<'_, CreditBankIncomeGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: CreditBankIncomeGetRequestOptions) -> Self { self.params.options = Some(options); self } + ///Set the value of the user_token field. pub fn user_token(mut self, user_token: &str) -> Self { self.params.user_token = Some(user_token.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditBankIncomeGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/bank_income/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } if let Some(ref unwrapped) = self.params.user_token { - r = r.json(json!({ "user_token" : unwrapped })); + r = r.json(serde_json::json!({ "user_token" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve information from the bank accounts used for income verification + +`/credit/bank_income/get` returns the bank income report(s) for a specified user. A single report corresponds to all institutions linked in a single Link session. To include multiple institutions in a single report, use [Multi-Item Link](https://plaid.com/docs/link/multi-item-link). To return older reports, use the `options.count` field. + +See endpoint docs at .*/ + pub fn credit_bank_income_get( + &self, + ) -> FluentRequest<'_, CreditBankIncomeGetRequest> { + FluentRequest { + client: self, + params: CreditBankIncomeGetRequest { + options: None, + user_token: None, + }, + } + } +} diff --git a/src/request/credit_bank_income_pdf_get.rs b/src/request/credit_bank_income_pdf_get.rs index ba22e33a..03bca96a 100644 --- a/src/request/credit_bank_income_pdf_get.rs +++ b/src/request/credit_bank_income_pdf_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_bank_income_pdf_get`]. On request success, this will return a [`()`].*/ @@ -11,7 +8,6 @@ On request success, this will return a [`()`].*/ pub struct CreditBankIncomePdfGetRequest { pub user_token: String, } -impl CreditBankIncomePdfGetRequest {} impl FluentRequest<'_, CreditBankIncomePdfGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditBankIncomePdfGetRequest> { type Output = httpclient::InMemoryResult<()>; @@ -20,10 +16,28 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditBankIncomePdfGetR Box::pin(async move { let url = "/credit/bank_income/pdf/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "user_token" : self.params.user_token })); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve information from the bank accounts used for income verification in PDF format + +`/credit/bank_income/pdf/get` returns the most recent bank income report for a specified user in PDF format. A single report corresponds to all institutions linked in a single Link session. To include multiple institutions in a single report, use [Multi-Item Link](https://plaid.com/docs/link/multi-item-link). + +See endpoint docs at .*/ + pub fn credit_bank_income_pdf_get( + &self, + user_token: &str, + ) -> FluentRequest<'_, CreditBankIncomePdfGetRequest> { + FluentRequest { + client: self, + params: CreditBankIncomePdfGetRequest { + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_bank_income_refresh.rs b/src/request/credit_bank_income_refresh.rs index b94b4008..c1fb32d3 100644 --- a/src/request/credit_bank_income_refresh.rs +++ b/src/request/credit_bank_income_refresh.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::CreditBankIncomeRefreshRequestOptions; /**You should use this struct via [`PlaidClient::credit_bank_income_refresh`]. On request success, this will return a [`CreditBankIncomeRefreshResponse`].*/ @@ -12,8 +10,8 @@ pub struct CreditBankIncomeRefreshRequest { pub options: Option, pub user_token: String, } -impl CreditBankIncomeRefreshRequest {} impl FluentRequest<'_, CreditBankIncomeRefreshRequest> { + ///Set the value of the options field. pub fn options(mut self, options: CreditBankIncomeRefreshRequestOptions) -> Self { self.params.options = Some(options); self @@ -21,19 +19,40 @@ impl FluentRequest<'_, CreditBankIncomeRefreshRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditBankIncomeRefreshRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditBankIncomeRefreshResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/bank_income/refresh"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "user_token" : self.params.user_token })); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Refresh a user's bank income information + +`/credit/bank_income/refresh` refreshes the most recent bank income report data for a specific user. If the most recent bank income report is no longer valid (i.e. deleted), the endpoint will refresh the most recent valid report instead. + +See endpoint docs at .*/ + pub fn credit_bank_income_refresh( + &self, + user_token: &str, + ) -> FluentRequest<'_, CreditBankIncomeRefreshRequest> { + FluentRequest { + client: self, + params: CreditBankIncomeRefreshRequest { + options: None, + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_bank_income_webhook_update.rs b/src/request/credit_bank_income_webhook_update.rs index 8572729f..3fdd6176 100644 --- a/src/request/credit_bank_income_webhook_update.rs +++ b/src/request/credit_bank_income_webhook_update.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_bank_income_webhook_update`]. On request success, this will return a [`CreditBankIncomeWebhookUpdateResponse`].*/ @@ -12,21 +9,49 @@ pub struct CreditBankIncomeWebhookUpdateRequest { pub enable_webhooks: bool, pub user_token: String, } -impl CreditBankIncomeWebhookUpdateRequest {} impl FluentRequest<'_, CreditBankIncomeWebhookUpdateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditBankIncomeWebhookUpdateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditBankIncomeWebhookUpdateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/bank_income/webhook/update"; let mut r = self.client.client.post(url); - r = r.json(json!({ "enable_webhooks" : self.params.enable_webhooks })); - r = r.json(json!({ "user_token" : self.params.user_token })); + r = r + .json( + serde_json::json!( + { "enable_webhooks" : self.params.enable_webhooks } + ), + ); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Subscribe and unsubscribe to proactive notifications for a user's income profile + +`/credit/bank_income/webhook/update` allows you to subscribe or unsubscribe a user for income webhook notifications. By default, all users start out unsubscribed. + +If a user is subscribed, on significant changes to the user's income profile, you will receive a `BANK_INCOME_REFRESH_UPDATE` webhook, prompting you to refresh bank income data for the user. + +See endpoint docs at .*/ + pub fn credit_bank_income_webhook_update( + &self, + enable_webhooks: bool, + user_token: &str, + ) -> FluentRequest<'_, CreditBankIncomeWebhookUpdateRequest> { + FluentRequest { + client: self, + params: CreditBankIncomeWebhookUpdateRequest { + enable_webhooks, + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_bank_statements_uploads_get.rs b/src/request/credit_bank_statements_uploads_get.rs index 3a686eff..3e14bb2f 100644 --- a/src/request/credit_bank_statements_uploads_get.rs +++ b/src/request/credit_bank_statements_uploads_get.rs @@ -1,30 +1,61 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::CreditBankStatementsUploadsGetRequestOptions; /**You should use this struct via [`PlaidClient::credit_bank_statements_uploads_get`]. On request success, this will return a [`CreditBankStatementsUploadsGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditBankStatementsUploadsGetRequest { + pub options: Option, pub user_token: String, } -impl CreditBankStatementsUploadsGetRequest {} -impl FluentRequest<'_, CreditBankStatementsUploadsGetRequest> {} +impl FluentRequest<'_, CreditBankStatementsUploadsGetRequest> { + ///Set the value of the options field. + pub fn options( + mut self, + options: CreditBankStatementsUploadsGetRequestOptions, + ) -> Self { + self.params.options = Some(options); + self + } +} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditBankStatementsUploadsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditBankStatementsUploadsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/bank_statements/uploads/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "user_token" : self.params.user_token })); + if let Some(ref unwrapped) = self.params.options { + r = r.json(serde_json::json!({ "options" : unwrapped })); + } + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve data for a user's uploaded bank statements + +`/credit/bank_statements/uploads/get` returns parsed data from bank statements uploaded by users as part of the Document Income flow. If your account is not enabled for Document Parsing, contact your account manager to request access. + +See endpoint docs at .*/ + pub fn credit_bank_statements_uploads_get( + &self, + user_token: &str, + ) -> FluentRequest<'_, CreditBankStatementsUploadsGetRequest> { + FluentRequest { + client: self, + params: CreditBankStatementsUploadsGetRequest { + options: None, + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_employment_get.rs b/src/request/credit_employment_get.rs index 307f884e..bddeabfb 100644 --- a/src/request/credit_employment_get.rs +++ b/src/request/credit_employment_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_employment_get`]. On request success, this will return a [`CreditEmploymentGetResponse`].*/ @@ -11,19 +8,36 @@ On request success, this will return a [`CreditEmploymentGetResponse`].*/ pub struct CreditEmploymentGetRequest { pub user_token: String, } -impl CreditEmploymentGetRequest {} impl FluentRequest<'_, CreditEmploymentGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditEmploymentGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/employment/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "user_token" : self.params.user_token })); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a summary of an individual's employment information + +`/credit/employment/get` returns a list of items with employment information from a user's payroll provider that was verified by an end user. + +See endpoint docs at .*/ + pub fn credit_employment_get( + &self, + user_token: &str, + ) -> FluentRequest<'_, CreditEmploymentGetRequest> { + FluentRequest { + client: self, + params: CreditEmploymentGetRequest { + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_freddie_mac_reports_get.rs b/src/request/credit_freddie_mac_reports_get.rs index a5f0cacc..d9274ad7 100644 --- a/src/request/credit_freddie_mac_reports_get.rs +++ b/src/request/credit_freddie_mac_reports_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_freddie_mac_reports_get`]. On request success, this will return a [`CreditFreddieMacReportsGetResponse`].*/ @@ -11,20 +8,44 @@ On request success, this will return a [`CreditFreddieMacReportsGetResponse`].*/ pub struct CreditFreddieMacReportsGetRequest { pub audit_copy_token: String, } -impl CreditFreddieMacReportsGetRequest {} impl FluentRequest<'_, CreditFreddieMacReportsGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditFreddieMacReportsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditFreddieMacReportsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/freddie_mac/reports/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "audit_copy_token" : self.params.audit_copy_token })); + r = r + .json( + serde_json::json!( + { "audit_copy_token" : self.params.audit_copy_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve an Asset Report with Freddie Mac format (aka VOA - Verification Of Assets), and a Verification Of Employment (VOE) report if this one is available. Only Freddie Mac can use this endpoint. + +The `credit/asset_report/freddie_mac/get` endpoint retrieves the Verification of Assets and Verification of Employment reports. + +See endpoint docs at .*/ + pub fn credit_freddie_mac_reports_get( + &self, + audit_copy_token: &str, + ) -> FluentRequest<'_, CreditFreddieMacReportsGetRequest> { + FluentRequest { + client: self, + params: CreditFreddieMacReportsGetRequest { + audit_copy_token: audit_copy_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_payroll_income_get.rs b/src/request/credit_payroll_income_get.rs index 401b7e08..4ce9340a 100644 --- a/src/request/credit_payroll_income_get.rs +++ b/src/request/credit_payroll_income_get.rs @@ -1,36 +1,63 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::CreditPayrollIncomeGetRequestOptions; /**You should use this struct via [`PlaidClient::credit_payroll_income_get`]. On request success, this will return a [`CreditPayrollIncomeGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditPayrollIncomeGetRequest { + pub options: Option, pub user_token: Option, } -impl CreditPayrollIncomeGetRequest {} impl FluentRequest<'_, CreditPayrollIncomeGetRequest> { + ///Set the value of the options field. + pub fn options(mut self, options: CreditPayrollIncomeGetRequestOptions) -> Self { + self.params.options = Some(options); + self + } + ///Set the value of the user_token field. pub fn user_token(mut self, user_token: &str) -> Self { self.params.user_token = Some(user_token.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditPayrollIncomeGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditPayrollIncomeGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/payroll_income/get"; let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.options { + r = r.json(serde_json::json!({ "options" : unwrapped })); + } if let Some(ref unwrapped) = self.params.user_token { - r = r.json(json!({ "user_token" : unwrapped })); + r = r.json(serde_json::json!({ "user_token" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a user's payroll information + +This endpoint gets payroll income information for a specific user, either as a result of the user connecting to their payroll provider or uploading a pay related document. + +See endpoint docs at .*/ + pub fn credit_payroll_income_get( + &self, + ) -> FluentRequest<'_, CreditPayrollIncomeGetRequest> { + FluentRequest { + client: self, + params: CreditPayrollIncomeGetRequest { + options: None, + user_token: None, + }, + } + } +} diff --git a/src/request/credit_payroll_income_parsing_config_update.rs b/src/request/credit_payroll_income_parsing_config_update.rs index 889aefb0..f9d06a61 100644 --- a/src/request/credit_payroll_income_parsing_config_update.rs +++ b/src/request/credit_payroll_income_parsing_config_update.rs @@ -1,20 +1,18 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::IncomeVerificationDocParsingConfig; /**You should use this struct via [`PlaidClient::credit_payroll_income_parsing_config_update`]. On request success, this will return a [`CreditPayrollIncomeParsingConfigUpdateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditPayrollIncomeParsingConfigUpdateRequest { pub item_id: Option, - pub parsing_config: Vec, + pub parsing_config: Vec, pub user_token: String, } -impl CreditPayrollIncomeParsingConfigUpdateRequest {} impl FluentRequest<'_, CreditPayrollIncomeParsingConfigUpdateRequest> { + ///Set the value of the item_id field. pub fn item_id(mut self, item_id: &str) -> Self { self.params.item_id = Some(item_id.to_owned()); self @@ -23,7 +21,7 @@ impl FluentRequest<'_, CreditPayrollIncomeParsingConfigUpdateRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditPayrollIncomeParsingConfigUpdateRequest> { type Output = httpclient::InMemoryResult< - CreditPayrollIncomeParsingConfigUpdateResponse, + crate::model::CreditPayrollIncomeParsingConfigUpdateResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -31,13 +29,37 @@ for FluentRequest<'a, CreditPayrollIncomeParsingConfigUpdateRequest> { let url = "/credit/payroll_income/parsing_config/update"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.item_id { - r = r.json(json!({ "item_id" : unwrapped })); + r = r.json(serde_json::json!({ "item_id" : unwrapped })); } - r = r.json(json!({ "parsing_config" : self.params.parsing_config })); - r = r.json(json!({ "user_token" : self.params.user_token })); + r = r + .json( + serde_json::json!({ "parsing_config" : self.params.parsing_config }), + ); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update the parsing configuration for a document income verification + +`/credit/payroll_income/parsing_config/update` updates the parsing configuration for a document income verification. + +See endpoint docs at .*/ + pub fn credit_payroll_income_parsing_config_update( + &self, + parsing_config: Vec, + user_token: &str, + ) -> FluentRequest<'_, CreditPayrollIncomeParsingConfigUpdateRequest> { + FluentRequest { + client: self, + params: CreditPayrollIncomeParsingConfigUpdateRequest { + item_id: None, + parsing_config, + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_payroll_income_precheck.rs b/src/request/credit_payroll_income_precheck.rs index f765268c..6a2f57bb 100644 --- a/src/request/credit_payroll_income_precheck.rs +++ b/src/request/credit_payroll_income_precheck.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + IncomeVerificationPrecheckEmployer, IncomeVerificationPrecheckPayrollInstitution, + IncomeVerificationPrecheckMilitaryInfo, +}; /**You should use this struct via [`PlaidClient::credit_payroll_income_precheck`]. On request success, this will return a [`CreditPayrollIncomePrecheckResponse`].*/ @@ -15,8 +16,8 @@ pub struct CreditPayrollIncomePrecheckRequest { pub us_military_info: Option, pub user_token: Option, } -impl CreditPayrollIncomePrecheckRequest {} impl FluentRequest<'_, CreditPayrollIncomePrecheckRequest> { + ///Set the value of the access_tokens field. pub fn access_tokens( mut self, access_tokens: impl IntoIterator>, @@ -28,10 +29,12 @@ impl FluentRequest<'_, CreditPayrollIncomePrecheckRequest> { ); self } + ///Set the value of the employer field. pub fn employer(mut self, employer: IncomeVerificationPrecheckEmployer) -> Self { self.params.employer = Some(employer); self } + ///Set the value of the payroll_institution field. pub fn payroll_institution( mut self, payroll_institution: IncomeVerificationPrecheckPayrollInstitution, @@ -39,6 +42,7 @@ impl FluentRequest<'_, CreditPayrollIncomePrecheckRequest> { self.params.payroll_institution = Some(payroll_institution); self } + ///Set the value of the us_military_info field. pub fn us_military_info( mut self, us_military_info: IncomeVerificationPrecheckMilitaryInfo, @@ -46,6 +50,7 @@ impl FluentRequest<'_, CreditPayrollIncomePrecheckRequest> { self.params.us_military_info = Some(us_military_info); self } + ///Set the value of the user_token field. pub fn user_token(mut self, user_token: &str) -> Self { self.params.user_token = Some(user_token.to_owned()); self @@ -53,30 +58,57 @@ impl FluentRequest<'_, CreditPayrollIncomePrecheckRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditPayrollIncomePrecheckRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditPayrollIncomePrecheckResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/payroll_income/precheck"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.access_tokens { - r = r.json(json!({ "access_tokens" : unwrapped })); + r = r.json(serde_json::json!({ "access_tokens" : unwrapped })); } if let Some(ref unwrapped) = self.params.employer { - r = r.json(json!({ "employer" : unwrapped })); + r = r.json(serde_json::json!({ "employer" : unwrapped })); } if let Some(ref unwrapped) = self.params.payroll_institution { - r = r.json(json!({ "payroll_institution" : unwrapped })); + r = r.json(serde_json::json!({ "payroll_institution" : unwrapped })); } if let Some(ref unwrapped) = self.params.us_military_info { - r = r.json(json!({ "us_military_info" : unwrapped })); + r = r.json(serde_json::json!({ "us_military_info" : unwrapped })); } if let Some(ref unwrapped) = self.params.user_token { - r = r.json(json!({ "user_token" : unwrapped })); + r = r.json(serde_json::json!({ "user_token" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Check income verification eligibility and optimize conversion + +`/credit/payroll_income/precheck` is an optional endpoint that can be called before initializing a Link session for income verification. It evaluates whether a given user is supportable by digital income verification. If the user is eligible for digital verification, that information will be associated with the user token, and in this way will generate a Link UI optimized for the end user and their specific employer. If the user cannot be confirmed as eligible, the user can still use the income verification flow, but they may be required to manually upload a paystub to verify their income. + +While all request fields are optional, providing `employer` data will increase the chance of receiving a useful result. + +When testing in Sandbox, you can control the results by providing special test values in the `employer` and `access_tokens` fields. `employer_good` and `employer_bad` will result in `HIGH` and `LOW` confidence values, respectively. `employer_multi` will result in a `HIGH` confidence with multiple payroll options. Likewise, `access_good` and `access_bad` will result in `HIGH` and `LOW` confidence values, respectively. Any other value for `employer` and `access_tokens` in Sandbox will result in `UNKNOWN` confidence. + +See endpoint docs at .*/ + pub fn credit_payroll_income_precheck( + &self, + ) -> FluentRequest<'_, CreditPayrollIncomePrecheckRequest> { + FluentRequest { + client: self, + params: CreditPayrollIncomePrecheckRequest { + access_tokens: None, + employer: None, + payroll_institution: None, + us_military_info: None, + user_token: None, + }, + } + } +} diff --git a/src/request/credit_payroll_income_refresh.rs b/src/request/credit_payroll_income_refresh.rs index e454823f..6611d6ae 100644 --- a/src/request/credit_payroll_income_refresh.rs +++ b/src/request/credit_payroll_income_refresh.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::CreditPayrollIncomeRefreshRequestOptions; /**You should use this struct via [`PlaidClient::credit_payroll_income_refresh`]. On request success, this will return a [`CreditPayrollIncomeRefreshResponse`].*/ @@ -12,8 +10,8 @@ pub struct CreditPayrollIncomeRefreshRequest { pub options: Option, pub user_token: String, } -impl CreditPayrollIncomeRefreshRequest {} impl FluentRequest<'_, CreditPayrollIncomeRefreshRequest> { + ///Set the value of the options field. pub fn options(mut self, options: CreditPayrollIncomeRefreshRequestOptions) -> Self { self.params.options = Some(options); self @@ -21,19 +19,40 @@ impl FluentRequest<'_, CreditPayrollIncomeRefreshRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditPayrollIncomeRefreshRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditPayrollIncomeRefreshResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/payroll_income/refresh"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "user_token" : self.params.user_token })); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Refresh a digital payroll income verification + +`/credit/payroll_income/refresh` refreshes a given digital payroll income verification. + +See endpoint docs at .*/ + pub fn credit_payroll_income_refresh( + &self, + user_token: &str, + ) -> FluentRequest<'_, CreditPayrollIncomeRefreshRequest> { + FluentRequest { + client: self, + params: CreditPayrollIncomeRefreshRequest { + options: None, + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_payroll_income_risk_signals_get.rs b/src/request/credit_payroll_income_risk_signals_get.rs index 150848d2..e94851ee 100644 --- a/src/request/credit_payroll_income_risk_signals_get.rs +++ b/src/request/credit_payroll_income_risk_signals_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_payroll_income_risk_signals_get`]. On request success, this will return a [`CreditPayrollIncomeRiskSignalsGetResponse`].*/ @@ -11,8 +8,8 @@ On request success, this will return a [`CreditPayrollIncomeRiskSignalsGetRespon pub struct CreditPayrollIncomeRiskSignalsGetRequest { pub user_token: Option, } -impl CreditPayrollIncomeRiskSignalsGetRequest {} impl FluentRequest<'_, CreditPayrollIncomeRiskSignalsGetRequest> { + ///Set the value of the user_token field. pub fn user_token(mut self, user_token: &str) -> Self { self.params.user_token = Some(user_token.to_owned()); self @@ -20,18 +17,41 @@ impl FluentRequest<'_, CreditPayrollIncomeRiskSignalsGetRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditPayrollIncomeRiskSignalsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditPayrollIncomeRiskSignalsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/payroll_income/risk_signals/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.user_token { - r = r.json(json!({ "user_token" : unwrapped })); + r = r.json(serde_json::json!({ "user_token" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve fraud insights for a user's manually uploaded document(s). + +`/credit/payroll_income/risk_signals/get` can be used as part of the Document Income flow to assess a user-uploaded document for signs of potential fraud or tampering. It returns a risk score for each uploaded document that indicates the likelihood of the document being fraudulent, in addition to details on the individual risk signals contributing to the score. + +To trigger risk signal generation for an Item, call `/link/token/create` with `parsing_config` set to include `risk_signals`, or call `/credit/payroll_income/parsing_config/update`. Once risk signal generation has been triggered, `/credit/payroll_income/risk_signals/get` can be called at any time after the `INCOME_VERIFICATION_RISK_SIGNALS` webhook has been fired. + +`/credit/payroll_income/risk_signals/get` is offered as an add-on to Document Income and is billed separately. To request access to this endpoint, submit a product access request or contact your Plaid account manager. + +See endpoint docs at .*/ + pub fn credit_payroll_income_risk_signals_get( + &self, + ) -> FluentRequest<'_, CreditPayrollIncomeRiskSignalsGetRequest> { + FluentRequest { + client: self, + params: CreditPayrollIncomeRiskSignalsGetRequest { + user_token: None, + }, + } + } +} diff --git a/src/request/credit_relay_create.rs b/src/request/credit_relay_create.rs index af786e54..5913164a 100644 --- a/src/request/credit_relay_create.rs +++ b/src/request/credit_relay_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_relay_create`]. On request success, this will return a [`CreditRelayCreateResponse`].*/ @@ -13,31 +10,59 @@ pub struct CreditRelayCreateRequest { pub secondary_client_id: String, pub webhook: Option, } -impl CreditRelayCreateRequest {} impl FluentRequest<'_, CreditRelayCreateRequest> { + ///Set the value of the webhook field. pub fn webhook(mut self, webhook: &str) -> Self { self.params.webhook = Some(webhook.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditRelayCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/relay/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "report_tokens" : self.params.report_tokens })); r = r .json( - json!({ "secondary_client_id" : self.params.secondary_client_id }), + serde_json::json!({ "report_tokens" : self.params.report_tokens }), + ); + r = r + .json( + serde_json::json!( + { "secondary_client_id" : self.params.secondary_client_id } + ), ); if let Some(ref unwrapped) = self.params.webhook { - r = r.json(json!({ "webhook" : unwrapped })); + r = r.json(serde_json::json!({ "webhook" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a relay token to share an Asset Report with a partner client + +Plaid can share an Asset Report directly with a participating third party on your behalf. The shared Asset Report is the exact same Asset Report originally created in `/asset_report/create`. + +To grant a third party access to an Asset Report, use the `/credit/relay/create` endpoint to create a `relay_token` and then pass that token to your third party. Each third party has its own `secondary_client_id`; for example, `ce5bd328dcd34123456`. You'll need to create a separate `relay_token` for each third party that needs access to the report on your behalf. + +See endpoint docs at .*/ + pub fn credit_relay_create( + &self, + report_tokens: &[&str], + secondary_client_id: &str, + ) -> FluentRequest<'_, CreditRelayCreateRequest> { + FluentRequest { + client: self, + params: CreditRelayCreateRequest { + report_tokens: report_tokens.iter().map(|&x| x.to_owned()).collect(), + secondary_client_id: secondary_client_id.to_owned(), + webhook: None, + }, + } + } +} diff --git a/src/request/credit_relay_get.rs b/src/request/credit_relay_get.rs index c3ca01db..1e05ac52 100644 --- a/src/request/credit_relay_get.rs +++ b/src/request/credit_relay_get.rs @@ -1,31 +1,59 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::ReportType; /**You should use this struct via [`PlaidClient::credit_relay_get`]. On request success, this will return a [`AssetReportGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditRelayGetRequest { + pub include_insights: Option, pub relay_token: String, - pub report_type: String, + pub report_type: ReportType, +} +impl FluentRequest<'_, CreditRelayGetRequest> { + ///Set the value of the include_insights field. + pub fn include_insights(mut self, include_insights: bool) -> Self { + self.params.include_insights = Some(include_insights); + self + } } -impl CreditRelayGetRequest {} -impl FluentRequest<'_, CreditRelayGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditRelayGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/relay/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "relay_token" : self.params.relay_token })); - r = r.json(json!({ "report_type" : self.params.report_type })); + if let Some(ref unwrapped) = self.params.include_insights { + r = r.json(serde_json::json!({ "include_insights" : unwrapped })); + } + r = r.json(serde_json::json!({ "relay_token" : self.params.relay_token })); + r = r.json(serde_json::json!({ "report_type" : self.params.report_type })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve the reports associated with a relay token that was shared with you + +`/credit/relay/get` allows third parties to receive a report that was shared with them, using a `relay_token` that was created by the report owner. + +See endpoint docs at .*/ + pub fn credit_relay_get( + &self, + relay_token: &str, + report_type: ReportType, + ) -> FluentRequest<'_, CreditRelayGetRequest> { + FluentRequest { + client: self, + params: CreditRelayGetRequest { + include_insights: None, + relay_token: relay_token.to_owned(), + report_type, + }, + } + } +} diff --git a/src/request/credit_relay_pdf_get.rs b/src/request/credit_relay_pdf_get.rs index 4b58216a..9080a46d 100644 --- a/src/request/credit_relay_pdf_get.rs +++ b/src/request/credit_relay_pdf_get.rs @@ -1,18 +1,15 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::ReportType; /**You should use this struct via [`PlaidClient::credit_relay_pdf_get`]. On request success, this will return a [`()`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditRelayPdfGetRequest { pub relay_token: String, - pub report_type: String, + pub report_type: ReportType, } -impl CreditRelayPdfGetRequest {} impl FluentRequest<'_, CreditRelayPdfGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditRelayPdfGetRequest> { type Output = httpclient::InMemoryResult<()>; @@ -21,11 +18,37 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditRelayPdfGetReques Box::pin(async move { let url = "/credit/relay/pdf/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "relay_token" : self.params.relay_token })); - r = r.json(json!({ "report_type" : self.params.report_type })); + r = r.json(serde_json::json!({ "relay_token" : self.params.relay_token })); + r = r.json(serde_json::json!({ "report_type" : self.params.report_type })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve the pdf reports associated with a relay token that was shared with you (beta) + +`/credit/relay/pdf/get` allows third parties to receive a pdf report that was shared with them, using a `relay_token` that was created by the report owner. + +The `/credit/relay/pdf/get` endpoint retrieves the Asset Report in PDF format. Before calling `/credit/relay/pdf/get`, you must first create the Asset Report using `/credit/relay/create` and then wait for the [`PRODUCT_READY`](https://plaid.com/docs/api/products/assets/#product_ready) webhook to fire, indicating that the Report is ready to be retrieved. + +The response to `/credit/relay/pdf/get` is the PDF binary data. The `request_id` is returned in the `Plaid-Request-ID` header. + +[View a sample PDF Asset Report](https://plaid.com/documents/sample-asset-report.pdf). + +See endpoint docs at .*/ + pub fn credit_relay_pdf_get( + &self, + relay_token: &str, + report_type: ReportType, + ) -> FluentRequest<'_, CreditRelayPdfGetRequest> { + FluentRequest { + client: self, + params: CreditRelayPdfGetRequest { + relay_token: relay_token.to_owned(), + report_type, + }, + } + } +} diff --git a/src/request/credit_relay_refresh.rs b/src/request/credit_relay_refresh.rs index b06276a9..3234c6de 100644 --- a/src/request/credit_relay_refresh.rs +++ b/src/request/credit_relay_refresh.rs @@ -1,40 +1,59 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::ReportType; /**You should use this struct via [`PlaidClient::credit_relay_refresh`]. On request success, this will return a [`CreditRelayRefreshResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CreditRelayRefreshRequest { pub relay_token: String, - pub report_type: String, + pub report_type: ReportType, pub webhook: Option, } -impl CreditRelayRefreshRequest {} impl FluentRequest<'_, CreditRelayRefreshRequest> { + ///Set the value of the webhook field. pub fn webhook(mut self, webhook: &str) -> Self { self.params.webhook = Some(webhook.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditRelayRefreshRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/relay/refresh"; let mut r = self.client.client.post(url); - r = r.json(json!({ "relay_token" : self.params.relay_token })); - r = r.json(json!({ "report_type" : self.params.report_type })); + r = r.json(serde_json::json!({ "relay_token" : self.params.relay_token })); + r = r.json(serde_json::json!({ "report_type" : self.params.report_type })); if let Some(ref unwrapped) = self.params.webhook { - r = r.json(json!({ "webhook" : unwrapped })); + r = r.json(serde_json::json!({ "webhook" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Refresh a report of a relay token + +The `/credit/relay/refresh` endpoint allows third parties to refresh a report that was relayed to them, using a `relay_token` that was created by the report owner. A new report will be created with the original report parameters, but with the most recent data available based on the `days_requested` value of the original report. + +See endpoint docs at .*/ + pub fn credit_relay_refresh( + &self, + relay_token: &str, + report_type: ReportType, + ) -> FluentRequest<'_, CreditRelayRefreshRequest> { + FluentRequest { + client: self, + params: CreditRelayRefreshRequest { + relay_token: relay_token.to_owned(), + report_type, + webhook: None, + }, + } + } +} diff --git a/src/request/credit_relay_remove.rs b/src/request/credit_relay_remove.rs index 2ba8743d..6141a90e 100644 --- a/src/request/credit_relay_remove.rs +++ b/src/request/credit_relay_remove.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_relay_remove`]. On request success, this will return a [`CreditRelayRemoveResponse`].*/ @@ -11,19 +8,36 @@ On request success, this will return a [`CreditRelayRemoveResponse`].*/ pub struct CreditRelayRemoveRequest { pub relay_token: String, } -impl CreditRelayRemoveRequest {} impl FluentRequest<'_, CreditRelayRemoveRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditRelayRemoveRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/relay/remove"; let mut r = self.client.client.post(url); - r = r.json(json!({ "relay_token" : self.params.relay_token })); + r = r.json(serde_json::json!({ "relay_token" : self.params.relay_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Remove relay token + +The `/credit/relay/remove` endpoint allows you to invalidate a `relay_token`. The third party holding the token will no longer be able to access or refresh the reports which the `relay_token` gives access to. The original report, associated Items, and other relay tokens that provide access to the same report are not affected and will remain accessible after removing the given `relay_token`. + +See endpoint docs at .*/ + pub fn credit_relay_remove( + &self, + relay_token: &str, + ) -> FluentRequest<'_, CreditRelayRemoveRequest> { + FluentRequest { + client: self, + params: CreditRelayRemoveRequest { + relay_token: relay_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_report_audit_copy_remove.rs b/src/request/credit_report_audit_copy_remove.rs index b56c1009..6c017d51 100644 --- a/src/request/credit_report_audit_copy_remove.rs +++ b/src/request/credit_report_audit_copy_remove.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_report_audit_copy_remove`]. On request success, this will return a [`CreditAuditCopyTokenRemoveResponse`].*/ @@ -11,20 +8,44 @@ On request success, this will return a [`CreditAuditCopyTokenRemoveResponse`].*/ pub struct CreditReportAuditCopyRemoveRequest { pub audit_copy_token: String, } -impl CreditReportAuditCopyRemoveRequest {} impl FluentRequest<'_, CreditReportAuditCopyRemoveRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditReportAuditCopyRemoveRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::CreditAuditCopyTokenRemoveResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/audit_copy_token/remove"; let mut r = self.client.client.post(url); - r = r.json(json!({ "audit_copy_token" : self.params.audit_copy_token })); + r = r + .json( + serde_json::json!( + { "audit_copy_token" : self.params.audit_copy_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Remove an Audit Copy token + +The `/credit/audit_copy_token/remove` endpoint allows you to remove an Audit Copy. Removing an Audit Copy invalidates the `audit_copy_token` associated with it, meaning both you and any third parties holding the token will no longer be able to use it to access Report data. Items associated with the Report data and other Audit Copies of it are not affected and will remain accessible after removing the given Audit Copy. + +See endpoint docs at .*/ + pub fn credit_report_audit_copy_remove( + &self, + audit_copy_token: &str, + ) -> FluentRequest<'_, CreditReportAuditCopyRemoveRequest> { + FluentRequest { + client: self, + params: CreditReportAuditCopyRemoveRequest { + audit_copy_token: audit_copy_token.to_owned(), + }, + } + } +} diff --git a/src/request/credit_sessions_get.rs b/src/request/credit_sessions_get.rs index fd087e0b..84c61c57 100644 --- a/src/request/credit_sessions_get.rs +++ b/src/request/credit_sessions_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::credit_sessions_get`]. On request success, this will return a [`CreditSessionsGetResponse`].*/ @@ -11,19 +8,38 @@ On request success, this will return a [`CreditSessionsGetResponse`].*/ pub struct CreditSessionsGetRequest { pub user_token: String, } -impl CreditSessionsGetRequest {} impl FluentRequest<'_, CreditSessionsGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, CreditSessionsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/credit/sessions/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "user_token" : self.params.user_token })); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve Link sessions for your user + +This endpoint can be used for your end users after they complete the Link flow. This endpoint returns a list of Link sessions that your user completed, where each session includes the results from the Link flow. + +These results include details about the Item that was created and some product related metadata (showing, for example, whether the user finished the bank income verification step). + +See endpoint docs at .*/ + pub fn credit_sessions_get( + &self, + user_token: &str, + ) -> FluentRequest<'_, CreditSessionsGetRequest> { + FluentRequest { + client: self, + params: CreditSessionsGetRequest { + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/dashboard_user_get.rs b/src/request/dashboard_user_get.rs index c9d635c0..cd4f9576 100644 --- a/src/request/dashboard_user_get.rs +++ b/src/request/dashboard_user_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::dashboard_user_get`]. On request success, this will return a [`DashboardUserGetResponse`].*/ @@ -11,19 +8,41 @@ On request success, this will return a [`DashboardUserGetResponse`].*/ pub struct DashboardUserGetRequest { pub dashboard_user_id: String, } -impl DashboardUserGetRequest {} impl FluentRequest<'_, DashboardUserGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, DashboardUserGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/dashboard_user/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "dashboard_user_id" : self.params.dashboard_user_id })); + r = r + .json( + serde_json::json!( + { "dashboard_user_id" : self.params.dashboard_user_id } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a dashboard user + +The `/dashboard_user/get` endpoint provides details (such as email address) about a specific Dashboard user based on the `dashboard_user_id` field, which is returned in the `audit_trail` object of certain Monitor and Beacon endpoints. This can be used to identify the specific reviewer who performed a Dashboard action. + +See endpoint docs at .*/ + pub fn dashboard_user_get( + &self, + dashboard_user_id: &str, + ) -> FluentRequest<'_, DashboardUserGetRequest> { + FluentRequest { + client: self, + params: DashboardUserGetRequest { + dashboard_user_id: dashboard_user_id.to_owned(), + }, + } + } +} diff --git a/src/request/dashboard_user_list.rs b/src/request/dashboard_user_list.rs index 0ac5ba85..ef933493 100644 --- a/src/request/dashboard_user_list.rs +++ b/src/request/dashboard_user_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::dashboard_user_list`]. On request success, this will return a [`DashboardUserListResponse`].*/ @@ -11,26 +8,41 @@ On request success, this will return a [`DashboardUserListResponse`].*/ pub struct DashboardUserListRequest { pub cursor: Option, } -impl DashboardUserListRequest {} impl FluentRequest<'_, DashboardUserListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, DashboardUserListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/dashboard_user/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List dashboard users + +The `/dashboard_user/list` endpoint provides details (such as email address) all Dashboard users associated with your account. This can use used to audit or track the list of reviewers for Monitor, Beacon, and Identity Verification products. + +See endpoint docs at .*/ + pub fn dashboard_user_list(&self) -> FluentRequest<'_, DashboardUserListRequest> { + FluentRequest { + client: self, + params: DashboardUserListRequest { + cursor: None, + }, + } + } +} diff --git a/src/request/deposit_switch_alt_create.rs b/src/request/deposit_switch_alt_create.rs index c540d0a8..8e6ce5a3 100644 --- a/src/request/deposit_switch_alt_create.rs +++ b/src/request/deposit_switch_alt_create.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + DepositSwitchCreateRequestOptions, DepositSwitchTargetAccount, + DepositSwitchTargetUser, +}; /**You should use this struct via [`PlaidClient::deposit_switch_alt_create`]. On request success, this will return a [`DepositSwitchAltCreateResponse`].*/ @@ -14,35 +15,63 @@ pub struct DepositSwitchAltCreateRequest { pub target_account: DepositSwitchTargetAccount, pub target_user: DepositSwitchTargetUser, } -impl DepositSwitchAltCreateRequest {} impl FluentRequest<'_, DepositSwitchAltCreateRequest> { + ///Set the value of the country_code field. pub fn country_code(mut self, country_code: &str) -> Self { self.params.country_code = Some(country_code.to_owned()); self } + ///Set the value of the options field. pub fn options(mut self, options: DepositSwitchCreateRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, DepositSwitchAltCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::DepositSwitchAltCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/deposit_switch/alt/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.country_code { - r = r.json(json!({ "country_code" : unwrapped })); + r = r.json(serde_json::json!({ "country_code" : unwrapped })); } if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "target_account" : self.params.target_account })); - r = r.json(json!({ "target_user" : self.params.target_user })); + r = r + .json( + serde_json::json!({ "target_account" : self.params.target_account }), + ); + r = r.json(serde_json::json!({ "target_user" : self.params.target_user })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Create a deposit switch without using Plaid Exchange + +This endpoint provides an alternative to `/deposit_switch/create` for customers who have not yet fully integrated with Plaid Exchange. Like `/deposit_switch/create`, it creates a deposit switch entity that will be persisted throughout the lifecycle of the switch. + +See endpoint docs at .*/ + pub fn deposit_switch_alt_create( + &self, + target_account: DepositSwitchTargetAccount, + target_user: DepositSwitchTargetUser, + ) -> FluentRequest<'_, DepositSwitchAltCreateRequest> { + FluentRequest { + client: self, + params: DepositSwitchAltCreateRequest { + country_code: None, + options: None, + target_account, + target_user, + }, + } + } +} diff --git a/src/request/deposit_switch_create.rs b/src/request/deposit_switch_create.rs index 702b08d9..22661d11 100644 --- a/src/request/deposit_switch_create.rs +++ b/src/request/deposit_switch_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::DepositSwitchCreateRequestOptions; /**You should use this struct via [`PlaidClient::deposit_switch_create`]. On request success, this will return a [`DepositSwitchCreateResponse`].*/ @@ -14,38 +12,68 @@ pub struct DepositSwitchCreateRequest { pub target_access_token: String, pub target_account_id: String, } -impl DepositSwitchCreateRequest {} impl FluentRequest<'_, DepositSwitchCreateRequest> { + ///Set the value of the country_code field. pub fn country_code(mut self, country_code: &str) -> Self { self.params.country_code = Some(country_code.to_owned()); self } + ///Set the value of the options field. pub fn options(mut self, options: DepositSwitchCreateRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, DepositSwitchCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/deposit_switch/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.country_code { - r = r.json(json!({ "country_code" : unwrapped })); + r = r.json(serde_json::json!({ "country_code" : unwrapped })); } if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = r .json( - json!({ "target_access_token" : self.params.target_access_token }), + serde_json::json!( + { "target_access_token" : self.params.target_access_token } + ), + ); + r = r + .json( + serde_json::json!( + { "target_account_id" : self.params.target_account_id } + ), ); - r = r.json(json!({ "target_account_id" : self.params.target_account_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Create a deposit switch + +This endpoint creates a deposit switch entity that will be persisted throughout the lifecycle of the switch. + +See endpoint docs at .*/ + pub fn deposit_switch_create( + &self, + target_access_token: &str, + target_account_id: &str, + ) -> FluentRequest<'_, DepositSwitchCreateRequest> { + FluentRequest { + client: self, + params: DepositSwitchCreateRequest { + country_code: None, + options: None, + target_access_token: target_access_token.to_owned(), + target_account_id: target_account_id.to_owned(), + }, + } + } +} diff --git a/src/request/deposit_switch_get.rs b/src/request/deposit_switch_get.rs index cae39a32..3e45dea9 100644 --- a/src/request/deposit_switch_get.rs +++ b/src/request/deposit_switch_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::deposit_switch_get`]. On request success, this will return a [`DepositSwitchGetResponse`].*/ @@ -11,19 +8,41 @@ On request success, this will return a [`DepositSwitchGetResponse`].*/ pub struct DepositSwitchGetRequest { pub deposit_switch_id: String, } -impl DepositSwitchGetRequest {} impl FluentRequest<'_, DepositSwitchGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, DepositSwitchGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/deposit_switch/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "deposit_switch_id" : self.params.deposit_switch_id })); + r = r + .json( + serde_json::json!( + { "deposit_switch_id" : self.params.deposit_switch_id } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Retrieve a deposit switch + +This endpoint returns information related to how the user has configured their payroll allocation and the state of the switch. You can use this information to build logic related to the user's direct deposit allocation preferences. + +See endpoint docs at .*/ + pub fn deposit_switch_get( + &self, + deposit_switch_id: &str, + ) -> FluentRequest<'_, DepositSwitchGetRequest> { + FluentRequest { + client: self, + params: DepositSwitchGetRequest { + deposit_switch_id: deposit_switch_id.to_owned(), + }, + } + } +} diff --git a/src/request/deposit_switch_token_create.rs b/src/request/deposit_switch_token_create.rs index 571e0f9d..3197bdea 100644 --- a/src/request/deposit_switch_token_create.rs +++ b/src/request/deposit_switch_token_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::deposit_switch_token_create`]. On request success, this will return a [`DepositSwitchTokenCreateResponse`].*/ @@ -11,20 +8,45 @@ On request success, this will return a [`DepositSwitchTokenCreateResponse`].*/ pub struct DepositSwitchTokenCreateRequest { pub deposit_switch_id: String, } -impl DepositSwitchTokenCreateRequest {} impl FluentRequest<'_, DepositSwitchTokenCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, DepositSwitchTokenCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::DepositSwitchTokenCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/deposit_switch/token/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "deposit_switch_id" : self.params.deposit_switch_id })); + r = r + .json( + serde_json::json!( + { "deposit_switch_id" : self.params.deposit_switch_id } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Create a deposit switch token + +In order for the end user to take action, you will need to create a public token representing the deposit switch. This token is used to initialize Link. It can be used one time and expires after 30 minutes. + + +See endpoint docs at .*/ + pub fn deposit_switch_token_create( + &self, + deposit_switch_id: &str, + ) -> FluentRequest<'_, DepositSwitchTokenCreateRequest> { + FluentRequest { + client: self, + params: DepositSwitchTokenCreateRequest { + deposit_switch_id: deposit_switch_id.to_owned(), + }, + } + } +} diff --git a/src/request/employers_search.rs b/src/request/employers_search.rs index 686b8135..62d5eb28 100644 --- a/src/request/employers_search.rs +++ b/src/request/employers_search.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::employers_search`]. On request success, this will return a [`EmployersSearchResponse`].*/ @@ -12,20 +9,41 @@ pub struct EmployersSearchRequest { pub products: Vec, pub query: String, } -impl EmployersSearchRequest {} impl FluentRequest<'_, EmployersSearchRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, EmployersSearchRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/employers/search"; let mut r = self.client.client.post(url); - r = r.json(json!({ "products" : self.params.products })); - r = r.json(json!({ "query" : self.params.query })); + r = r.json(serde_json::json!({ "products" : self.params.products })); + r = r.json(serde_json::json!({ "query" : self.params.query })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Search employer database + +`/employers/search` allows you the ability to search Plaid’s database of known employers, for use with Deposit Switch. You can use this endpoint to look up a user's employer in order to confirm that they are supported. Users with non-supported employers can then be routed out of the Deposit Switch flow. + +The data in the employer database is currently limited. As the Deposit Switch and Income products progress through their respective beta periods, more employers are being regularly added. Because the employer database is frequently updated, we recommend that you do not cache or store data from this endpoint for more than a day. + +See endpoint docs at .*/ + pub fn employers_search( + &self, + products: &[&str], + query: &str, + ) -> FluentRequest<'_, EmployersSearchRequest> { + FluentRequest { + client: self, + params: EmployersSearchRequest { + products: products.iter().map(|&x| x.to_owned()).collect(), + query: query.to_owned(), + }, + } + } +} diff --git a/src/request/employment_verification_get.rs b/src/request/employment_verification_get.rs index 21c78f13..87ca5306 100644 --- a/src/request/employment_verification_get.rs +++ b/src/request/employment_verification_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::employment_verification_get`]. On request success, this will return a [`EmploymentVerificationGetResponse`].*/ @@ -11,20 +8,41 @@ On request success, this will return a [`EmploymentVerificationGetResponse`].*/ pub struct EmploymentVerificationGetRequest { pub access_token: String, } -impl EmploymentVerificationGetRequest {} impl FluentRequest<'_, EmploymentVerificationGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, EmploymentVerificationGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::EmploymentVerificationGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/employment/verification/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Retrieve a summary of an individual's employment information + +`/employment/verification/get` returns a list of employments through a user payroll that was verified by an end user. + +This endpoint has been deprecated; new integrations should use `/credit/employment/get` instead. + +See endpoint docs at .*/ + pub fn employment_verification_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, EmploymentVerificationGetRequest> { + FluentRequest { + client: self, + params: EmploymentVerificationGetRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/fdx_notifications.rs b/src/request/fdx_notifications.rs index 5b886825..893698ad 100644 --- a/src/request/fdx_notifications.rs +++ b/src/request/fdx_notifications.rs @@ -1,51 +1,55 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + FDXNotificationCategory, FDXNotificationPayload, FDXNotificationPriority, FDXParty, + FDXNotificationSeverity, FDXNotificationType, FDXHateoasLink, +}; /**You should use this struct via [`PlaidClient::fdx_notifications`]. On request success, this will return a [`()`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct FdxNotificationsRequest { - pub category: String, + pub category: FdxNotificationCategory, pub notification_id: String, pub notification_payload: FdxNotificationPayload, - pub priority: Option, + pub priority: Option, pub publisher: Option, pub sent_on: chrono::DateTime, - pub severity: Option, + pub severity: Option, pub subscriber: Option, - pub type_: String, + pub type_: FdxNotificationType, pub url: Option, } -impl FdxNotificationsRequest {} pub struct FdxNotificationsRequired<'a> { - pub category: &'a str, + pub category: FdxNotificationCategory, pub notification_id: &'a str, pub notification_payload: FdxNotificationPayload, pub sent_on: chrono::DateTime, - pub type_: &'a str, + pub type_: FdxNotificationType, } -impl<'a> FdxNotificationsRequired<'a> {} impl FluentRequest<'_, FdxNotificationsRequest> { - pub fn priority(mut self, priority: &str) -> Self { - self.params.priority = Some(priority.to_owned()); + ///Set the value of the priority field. + pub fn priority(mut self, priority: FdxNotificationPriority) -> Self { + self.params.priority = Some(priority); self } + ///Set the value of the publisher field. pub fn publisher(mut self, publisher: FdxParty) -> Self { self.params.publisher = Some(publisher); self } - pub fn severity(mut self, severity: &str) -> Self { - self.params.severity = Some(severity.to_owned()); + ///Set the value of the severity field. + pub fn severity(mut self, severity: FdxNotificationSeverity) -> Self { + self.params.severity = Some(severity); self } + ///Set the value of the subscriber field. pub fn subscriber(mut self, subscriber: FdxParty) -> Self { self.params.subscriber = Some(subscriber); self } + ///Set the value of the url field. pub fn url(mut self, url: FdxHateoasLink) -> Self { self.params.url = Some(url); self @@ -58,32 +62,64 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, FdxNotificationsRequest Box::pin(async move { let url = "/fdx/notifications"; let mut r = self.client.client.post(url); - r = r.json(json!({ "category" : self.params.category })); - r = r.json(json!({ "notificationId" : self.params.notification_id })); + r = r.json(serde_json::json!({ "category" : self.params.category })); r = r .json( - json!({ "notificationPayload" : self.params.notification_payload }), + serde_json::json!({ "notificationId" : self.params.notification_id }), + ); + r = r + .json( + serde_json::json!( + { "notificationPayload" : self.params.notification_payload } + ), ); if let Some(ref unwrapped) = self.params.priority { - r = r.json(json!({ "priority" : unwrapped })); + r = r.json(serde_json::json!({ "priority" : unwrapped })); } if let Some(ref unwrapped) = self.params.publisher { - r = r.json(json!({ "publisher" : unwrapped })); + r = r.json(serde_json::json!({ "publisher" : unwrapped })); } - r = r.json(json!({ "sentOn" : self.params.sent_on })); + r = r.json(serde_json::json!({ "sentOn" : self.params.sent_on })); if let Some(ref unwrapped) = self.params.severity { - r = r.json(json!({ "severity" : unwrapped })); + r = r.json(serde_json::json!({ "severity" : unwrapped })); } if let Some(ref unwrapped) = self.params.subscriber { - r = r.json(json!({ "subscriber" : unwrapped })); + r = r.json(serde_json::json!({ "subscriber" : unwrapped })); } - r = r.json(json!({ "type" : self.params.type_ })); + r = r.json(serde_json::json!({ "type" : self.params.type_ })); if let Some(ref unwrapped) = self.params.url { - r = r.json(json!({ "url" : unwrapped })); + r = r.json(serde_json::json!({ "url" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Webhook receiver for fdx notifications + +A generic webhook receiver endpoint for FDX Event Notifications + +See endpoint docs at .*/ + pub fn fdx_notifications( + &self, + args: FdxNotificationsRequired, + ) -> FluentRequest<'_, FdxNotificationsRequest> { + FluentRequest { + client: self, + params: FdxNotificationsRequest { + category: args.category, + notification_id: args.notification_id.to_owned(), + notification_payload: args.notification_payload, + priority: None, + publisher: None, + sent_on: args.sent_on, + severity: None, + subscriber: None, + type_: args.type_, + url: None, + }, + } + } +} diff --git a/src/request/get_recipient.rs b/src/request/get_recipient.rs new file mode 100644 index 00000000..1ab5573c --- /dev/null +++ b/src/request/get_recipient.rs @@ -0,0 +1,53 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::get_recipient`]. + +On request success, this will return a [`GetRecipientResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct GetRecipientRequest { + pub oauth_state_id: Option, + pub recipient_id: String, +} +impl FluentRequest<'_, GetRecipientRequest> { + ///Set the value of the oauth_state_id field. + pub fn oauth_state_id(mut self, oauth_state_id: &str) -> Self { + self.params.oauth_state_id = Some(oauth_state_id.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, GetRecipientRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = &format!( + "/fdx/recipient/{recipient_id}", recipient_id = self.params.recipient_id + ); + let mut r = self.client.client.get(url); + if let Some(ref unwrapped) = self.params.oauth_state_id { + r = r.header("OAUTH-STATE-ID", &unwrapped.to_string()); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Get Recipient + +Get a specific recipient*/ + pub fn get_recipient( + &self, + recipient_id: &str, + ) -> FluentRequest<'_, GetRecipientRequest> { + FluentRequest { + client: self, + params: GetRecipientRequest { + oauth_state_id: None, + recipient_id: recipient_id.to_owned(), + }, + } + } +} diff --git a/src/request/get_recipients.rs b/src/request/get_recipients.rs new file mode 100644 index 00000000..06afcd0b --- /dev/null +++ b/src/request/get_recipients.rs @@ -0,0 +1,34 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::get_recipients`]. + +On request success, this will return a [`GetRecipientsResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct GetRecipientsRequest {} +impl FluentRequest<'_, GetRecipientsRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, GetRecipientsRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/fdx/recipients"; + let mut r = self.client.client.get(url); + r = r.set_query(self.params); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Get Recipients + +Returns a list of Recipients*/ + pub fn get_recipients(&self) -> FluentRequest<'_, GetRecipientsRequest> { + FluentRequest { + client: self, + params: GetRecipientsRequest {}, + } + } +} diff --git a/src/request/identity_documents_uploads_get.rs b/src/request/identity_documents_uploads_get.rs new file mode 100644 index 00000000..88b9f77b --- /dev/null +++ b/src/request/identity_documents_uploads_get.rs @@ -0,0 +1,81 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::IdentityDocumentsUploadsGetRequestOptions; +/**You should use this struct via [`PlaidClient::identity_documents_uploads_get`]. + +On request success, this will return a [`IdentityDocumentsUploadsGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct IdentityDocumentsUploadsGetRequest { + pub access_token: String, + pub client_id: Option, + pub options: Option, + pub secret: Option, +} +impl FluentRequest<'_, IdentityDocumentsUploadsGetRequest> { + ///Set the value of the client_id field. + pub fn client_id(mut self, client_id: &str) -> Self { + self.params.client_id = Some(client_id.to_owned()); + self + } + ///Set the value of the options field. + pub fn options( + mut self, + options: IdentityDocumentsUploadsGetRequestOptions, + ) -> Self { + self.params.options = Some(options); + self + } + ///Set the value of the secret field. + pub fn secret(mut self, secret: &str) -> Self { + self.params.secret = Some(secret.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, IdentityDocumentsUploadsGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::IdentityDocumentsUploadsGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/identity/documents/uploads/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + if let Some(ref unwrapped) = self.params.client_id { + r = r.json(serde_json::json!({ "client_id" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.options { + r = r.json(serde_json::json!({ "options" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.secret { + r = r.json(serde_json::json!({ "secret" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Returns uploaded document identity + +Use `/identity/documents/uploads/get` to retrieve identity details when using [Identity Document Upload](https://plaid.com/docs/identity/identity-document-upload/). + +See endpoint docs at .*/ + pub fn identity_documents_uploads_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, IdentityDocumentsUploadsGetRequest> { + FluentRequest { + client: self, + params: IdentityDocumentsUploadsGetRequest { + access_token: access_token.to_owned(), + client_id: None, + options: None, + secret: None, + }, + } + } +} diff --git a/src/request/identity_get.rs b/src/request/identity_get.rs index 23d36ca9..560a88c3 100644 --- a/src/request/identity_get.rs +++ b/src/request/identity_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::IdentityGetRequestOptions; /**You should use this struct via [`PlaidClient::identity_get`]. On request success, this will return a [`IdentityGetResponse`].*/ @@ -12,27 +10,48 @@ pub struct IdentityGetRequest { pub access_token: String, pub options: Option, } -impl IdentityGetRequest {} impl FluentRequest<'_, IdentityGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: IdentityGetRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IdentityGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/identity/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve identity data + +The `/identity/get` endpoint allows you to retrieve various account holder information on file with the financial institution, including names, emails, phone numbers, and addresses. Only name data is guaranteed to be returned; other fields will be empty arrays if not provided by the institution. + +Note: In API versions 2018-05-22 and earlier, the `owners` object is not returned, and instead identity information is returned in the top level `identity` object. For more details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2019-05-29). + +See endpoint docs at .*/ + pub fn identity_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, IdentityGetRequest> { + FluentRequest { + client: self, + params: IdentityGetRequest { + access_token: access_token.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/identity_match.rs b/src/request/identity_match.rs index b2e9dc58..fd0edd8a 100644 --- a/src/request/identity_match.rs +++ b/src/request/identity_match.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{IdentityMatchRequestOptions, IdentityMatchUser}; /**You should use this struct via [`PlaidClient::identity_match`]. On request success, this will return a [`IdentityMatchResponse`].*/ @@ -13,34 +11,57 @@ pub struct IdentityMatchRequest { pub options: Option, pub user: Option, } -impl IdentityMatchRequest {} impl FluentRequest<'_, IdentityMatchRequest> { + ///Set the value of the options field. pub fn options(mut self, options: IdentityMatchRequestOptions) -> Self { self.params.options = Some(options); self } + ///Set the value of the user field. pub fn user(mut self, user: IdentityMatchUser) -> Self { self.params.user = Some(user); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IdentityMatchRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/identity/match"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } if let Some(ref unwrapped) = self.params.user { - r = r.json(json!({ "user" : unwrapped })); + r = r.json(serde_json::json!({ "user" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve identity match score + +The `/identity/match` endpoint generates a match score, which indicates how well the provided identity data matches the identity information on file with the account holder's financial institution. + +Fields within the `balances` object will always be null when retrieved by `/identity/match`. Instead, use the free `/accounts/get` endpoint to request balance cached data, or `/accounts/balance/get` for real-time data. + +See endpoint docs at .*/ + pub fn identity_match( + &self, + access_token: &str, + ) -> FluentRequest<'_, IdentityMatchRequest> { + FluentRequest { + client: self, + params: IdentityMatchRequest { + access_token: access_token.to_owned(), + options: None, + user: None, + }, + } + } +} diff --git a/src/request/identity_refresh.rs b/src/request/identity_refresh.rs index 2269f05a..32ff78b4 100644 --- a/src/request/identity_refresh.rs +++ b/src/request/identity_refresh.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::identity_refresh`]. On request success, this will return a [`IdentityRefreshResponse`].*/ @@ -11,19 +8,40 @@ On request success, this will return a [`IdentityRefreshResponse`].*/ pub struct IdentityRefreshRequest { pub access_token: String, } -impl IdentityRefreshRequest {} impl FluentRequest<'_, IdentityRefreshRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IdentityRefreshRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/identity/refresh"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Refresh identity data + +`/identity/refresh` is an optional endpoint for users of the Identity product. It initiates an on-demand extraction to fetch the most up to date Identity information from the Financial Institution. This on-demand extraction takes place in addition to the periodic extractions that automatically occur for any Identity-enabled Item. If changes to Identity are discovered after calling `/identity/refresh`, Plaid will fire a webhook [`DEFAULT_UPDATE`](https://plaid.com/docs/api/products/identity/#default_update). + +As this endpoint triggers a synchronous request for fresh data, latency may be higher than for other Plaid endpoints (typically less than 10 seconds, but occasionally up to 30 seconds or more); if you encounter errors, you may find it necessary to adjust your timeout period when making requests. + +`/identity/refresh` is offered as an add-on to Identity and has a separate [fee model](/docs/account/billing/#per-request-flat-fee). To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. + +See endpoint docs at .*/ + pub fn identity_refresh( + &self, + access_token: &str, + ) -> FluentRequest<'_, IdentityRefreshRequest> { + FluentRequest { + client: self, + params: IdentityRefreshRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/identity_verification_autofill_create.rs b/src/request/identity_verification_autofill_create.rs index cf03d3ba..4bdaab84 100644 --- a/src/request/identity_verification_autofill_create.rs +++ b/src/request/identity_verification_autofill_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::identity_verification_autofill_create`]. On request success, this will return a [`IdentityVerificationAutofillCreateResponse`].*/ @@ -11,11 +8,12 @@ On request success, this will return a [`IdentityVerificationAutofillCreateRespo pub struct IdentityVerificationAutofillCreateRequest { pub identity_verification_id: String, } -impl IdentityVerificationAutofillCreateRequest {} impl FluentRequest<'_, IdentityVerificationAutofillCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IdentityVerificationAutofillCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::IdentityVerificationAutofillCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,7 +21,7 @@ for FluentRequest<'a, IdentityVerificationAutofillCreateRequest> { let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "identity_verification_id" : self.params .identity_verification_id } ), @@ -33,4 +31,22 @@ for FluentRequest<'a, IdentityVerificationAutofillCreateRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create autofill for an Identity Verification + +Try to autofill an Identity Verification based of the provided phone number, date of birth and country of residence. + +See endpoint docs at .*/ + pub fn identity_verification_autofill_create( + &self, + identity_verification_id: &str, + ) -> FluentRequest<'_, IdentityVerificationAutofillCreateRequest> { + FluentRequest { + client: self, + params: IdentityVerificationAutofillCreateRequest { + identity_verification_id: identity_verification_id.to_owned(), + }, + } + } +} diff --git a/src/request/identity_verification_create.rs b/src/request/identity_verification_create.rs index 887becc9..5d0f458c 100644 --- a/src/request/identity_verification_create.rs +++ b/src/request/identity_verification_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::IdentityVerificationCreateRequestUser; /**You should use this struct via [`PlaidClient::identity_verification_create`]. On request success, this will return a [`IdentityVerificationCreateResponse`].*/ @@ -16,16 +14,18 @@ pub struct IdentityVerificationCreateRequest { pub template_id: String, pub user: Option, } -impl IdentityVerificationCreateRequest {} impl FluentRequest<'_, IdentityVerificationCreateRequest> { + ///Set the value of the client_user_id field. pub fn client_user_id(mut self, client_user_id: &str) -> Self { self.params.client_user_id = Some(client_user_id.to_owned()); self } + ///Set the value of the is_idempotent field. pub fn is_idempotent(mut self, is_idempotent: bool) -> Self { self.params.is_idempotent = Some(is_idempotent); self } + ///Set the value of the user field. pub fn user(mut self, user: IdentityVerificationCreateRequestUser) -> Self { self.params.user = Some(user); self @@ -33,27 +33,58 @@ impl FluentRequest<'_, IdentityVerificationCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IdentityVerificationCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::IdentityVerificationCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/identity_verification/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.client_user_id { - r = r.json(json!({ "client_user_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); } - r = r.json(json!({ "gave_consent" : self.params.gave_consent })); + r = r.json(serde_json::json!({ "gave_consent" : self.params.gave_consent })); if let Some(ref unwrapped) = self.params.is_idempotent { - r = r.json(json!({ "is_idempotent" : unwrapped })); + r = r.json(serde_json::json!({ "is_idempotent" : unwrapped })); } - r = r.json(json!({ "is_shareable" : self.params.is_shareable })); - r = r.json(json!({ "template_id" : self.params.template_id })); + r = r.json(serde_json::json!({ "is_shareable" : self.params.is_shareable })); + r = r.json(serde_json::json!({ "template_id" : self.params.template_id })); if let Some(ref unwrapped) = self.params.user { - r = r.json(json!({ "user" : unwrapped })); + r = r.json(serde_json::json!({ "user" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a new Identity Verification + +Create a new Identity Verification for the user specified by the `client_user_id` field. The requirements and behavior of the verification are determined by the `template_id` provided. +If you don't know whether the associated user already has an active Identity Verification, you can specify `"is_idempotent": true` in the request body. With idempotency enabled, a new Identity Verification will only be created if one does not already exist for the associated `client_user_id` and `template_id`. If an Identity Verification is found, it will be returned unmodified with an `200 OK` HTTP status code. + +You can also use this endpoint to supply information you already have collected about the user; if any of these fields are specified, the screens prompting the user to enter them will be skipped during the Link flow. + + +See endpoint docs at .*/ + pub fn identity_verification_create( + &self, + gave_consent: bool, + is_shareable: bool, + template_id: &str, + ) -> FluentRequest<'_, IdentityVerificationCreateRequest> { + FluentRequest { + client: self, + params: IdentityVerificationCreateRequest { + client_user_id: None, + gave_consent, + is_idempotent: None, + is_shareable, + template_id: template_id.to_owned(), + user: None, + }, + } + } +} diff --git a/src/request/identity_verification_get.rs b/src/request/identity_verification_get.rs index 662657d5..6e991e37 100644 --- a/src/request/identity_verification_get.rs +++ b/src/request/identity_verification_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::identity_verification_get`]. On request success, this will return a [`IdentityVerificationGetResponse`].*/ @@ -11,11 +8,12 @@ On request success, this will return a [`IdentityVerificationGetResponse`].*/ pub struct IdentityVerificationGetRequest { pub identity_verification_id: String, } -impl IdentityVerificationGetRequest {} impl FluentRequest<'_, IdentityVerificationGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IdentityVerificationGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::IdentityVerificationGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,7 +21,7 @@ for FluentRequest<'a, IdentityVerificationGetRequest> { let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "identity_verification_id" : self.params .identity_verification_id } ), @@ -33,4 +31,22 @@ for FluentRequest<'a, IdentityVerificationGetRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve Identity Verification + +Retrieve a previously created Identity Verification. + +See endpoint docs at .*/ + pub fn identity_verification_get( + &self, + identity_verification_id: &str, + ) -> FluentRequest<'_, IdentityVerificationGetRequest> { + FluentRequest { + client: self, + params: IdentityVerificationGetRequest { + identity_verification_id: identity_verification_id.to_owned(), + }, + } + } +} diff --git a/src/request/identity_verification_list.rs b/src/request/identity_verification_list.rs index cae96e11..0ec94582 100644 --- a/src/request/identity_verification_list.rs +++ b/src/request/identity_verification_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::identity_verification_list`]. On request success, this will return a [`IdentityVerificationListResponse`].*/ @@ -13,8 +10,8 @@ pub struct IdentityVerificationListRequest { pub cursor: Option, pub template_id: String, } -impl IdentityVerificationListRequest {} impl FluentRequest<'_, IdentityVerificationListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -22,20 +19,46 @@ impl FluentRequest<'_, IdentityVerificationListRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IdentityVerificationListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::IdentityVerificationListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/identity_verification/list"; let mut r = self.client.client.post(url); - r = r.json(json!({ "client_user_id" : self.params.client_user_id })); + r = r + .json( + serde_json::json!({ "client_user_id" : self.params.client_user_id }), + ); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } - r = r.json(json!({ "template_id" : self.params.template_id })); + r = r.json(serde_json::json!({ "template_id" : self.params.template_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List Identity Verifications + +Filter and list Identity Verifications created by your account + +See endpoint docs at .*/ + pub fn identity_verification_list( + &self, + client_user_id: &str, + template_id: &str, + ) -> FluentRequest<'_, IdentityVerificationListRequest> { + FluentRequest { + client: self, + params: IdentityVerificationListRequest { + client_user_id: client_user_id.to_owned(), + cursor: None, + template_id: template_id.to_owned(), + }, + } + } +} diff --git a/src/request/identity_verification_retry.rs b/src/request/identity_verification_retry.rs index a86dbe9b..5ec50188 100644 --- a/src/request/identity_verification_retry.rs +++ b/src/request/identity_verification_retry.rs @@ -1,26 +1,34 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + IdentityVerificationRetryRequestStepsObject, Strategy, + IdentityVerificationRequestUser, +}; /**You should use this struct via [`PlaidClient::identity_verification_retry`]. On request success, this will return a [`IdentityVerificationRetryResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct IdentityVerificationRetryRequest { pub client_user_id: String, + pub is_shareable: Option, pub steps: Option, - pub strategy: String, + pub strategy: Strategy, pub template_id: String, pub user: Option, } -impl IdentityVerificationRetryRequest {} impl FluentRequest<'_, IdentityVerificationRetryRequest> { + ///Set the value of the is_shareable field. + pub fn is_shareable(mut self, is_shareable: bool) -> Self { + self.params.is_shareable = Some(is_shareable); + self + } + ///Set the value of the steps field. pub fn steps(mut self, steps: IdentityVerificationRetryRequestStepsObject) -> Self { self.params.steps = Some(steps); self } + ///Set the value of the user field. pub fn user(mut self, user: IdentityVerificationRequestUser) -> Self { self.params.user = Some(user); self @@ -28,24 +36,57 @@ impl FluentRequest<'_, IdentityVerificationRetryRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IdentityVerificationRetryRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::IdentityVerificationRetryResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/identity_verification/retry"; let mut r = self.client.client.post(url); - r = r.json(json!({ "client_user_id" : self.params.client_user_id })); + r = r + .json( + serde_json::json!({ "client_user_id" : self.params.client_user_id }), + ); + if let Some(ref unwrapped) = self.params.is_shareable { + r = r.json(serde_json::json!({ "is_shareable" : unwrapped })); + } if let Some(ref unwrapped) = self.params.steps { - r = r.json(json!({ "steps" : unwrapped })); + r = r.json(serde_json::json!({ "steps" : unwrapped })); } - r = r.json(json!({ "strategy" : self.params.strategy })); - r = r.json(json!({ "template_id" : self.params.template_id })); + r = r.json(serde_json::json!({ "strategy" : self.params.strategy })); + r = r.json(serde_json::json!({ "template_id" : self.params.template_id })); if let Some(ref unwrapped) = self.params.user { - r = r.json(json!({ "user" : unwrapped })); + r = r.json(serde_json::json!({ "user" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retry an Identity Verification + +Allow a customer to retry their Identity Verification + +See endpoint docs at .*/ + pub fn identity_verification_retry( + &self, + client_user_id: &str, + strategy: Strategy, + template_id: &str, + ) -> FluentRequest<'_, IdentityVerificationRetryRequest> { + FluentRequest { + client: self, + params: IdentityVerificationRetryRequest { + client_user_id: client_user_id.to_owned(), + is_shareable: None, + steps: None, + strategy, + template_id: template_id.to_owned(), + user: None, + }, + } + } +} diff --git a/src/request/income_verification_create.rs b/src/request/income_verification_create.rs index 78cae342..6aa85745 100644 --- a/src/request/income_verification_create.rs +++ b/src/request/income_verification_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::IncomeVerificationCreateRequestOptions; /**You should use this struct via [`PlaidClient::income_verification_create`]. On request success, this will return a [`IncomeVerificationCreateResponse`].*/ @@ -13,12 +11,13 @@ pub struct IncomeVerificationCreateRequest { pub precheck_id: Option, pub webhook: String, } -impl IncomeVerificationCreateRequest {} impl FluentRequest<'_, IncomeVerificationCreateRequest> { + ///Set the value of the options field. pub fn options(mut self, options: IncomeVerificationCreateRequestOptions) -> Self { self.params.options = Some(options); self } + ///Set the value of the precheck_id field. pub fn precheck_id(mut self, precheck_id: &str) -> Self { self.params.precheck_id = Some(precheck_id.to_owned()); self @@ -26,22 +25,44 @@ impl FluentRequest<'_, IncomeVerificationCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IncomeVerificationCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::IncomeVerificationCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/income/verification/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } if let Some(ref unwrapped) = self.params.precheck_id { - r = r.json(json!({ "precheck_id" : unwrapped })); + r = r.json(serde_json::json!({ "precheck_id" : unwrapped })); } - r = r.json(json!({ "webhook" : self.params.webhook })); + r = r.json(serde_json::json!({ "webhook" : self.params.webhook })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Create an income verification instance + +`/income/verification/create` begins the income verification process by returning an `income_verification_id`. You can then provide the `income_verification_id` to `/link/token/create` under the `income_verification` parameter in order to create a Link instance that will prompt the user to go through the income verification flow. Plaid will fire an `INCOME` webhook once the user completes the Payroll Income flow, or when the uploaded documents in the Document Income flow have finished processing. + +See endpoint docs at .*/ + pub fn income_verification_create( + &self, + webhook: &str, + ) -> FluentRequest<'_, IncomeVerificationCreateRequest> { + FluentRequest { + client: self, + params: IncomeVerificationCreateRequest { + options: None, + precheck_id: None, + webhook: webhook.to_owned(), + }, + } + } +} diff --git a/src/request/income_verification_documents_download.rs b/src/request/income_verification_documents_download.rs index 4bb3348b..545a3f78 100644 --- a/src/request/income_verification_documents_download.rs +++ b/src/request/income_verification_documents_download.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::income_verification_documents_download`]. On request success, this will return a [`()`].*/ @@ -13,16 +10,18 @@ pub struct IncomeVerificationDocumentsDownloadRequest { pub document_id: Option, pub income_verification_id: Option, } -impl IncomeVerificationDocumentsDownloadRequest {} impl FluentRequest<'_, IncomeVerificationDocumentsDownloadRequest> { + ///Set the value of the access_token field. pub fn access_token(mut self, access_token: &str) -> Self { self.params.access_token = Some(access_token.to_owned()); self } + ///Set the value of the document_id field. pub fn document_id(mut self, document_id: &str) -> Self { self.params.document_id = Some(document_id.to_owned()); self } + ///Set the value of the income_verification_id field. pub fn income_verification_id(mut self, income_verification_id: &str) -> Self { self.params.income_verification_id = Some(income_verification_id.to_owned()); self @@ -37,17 +36,44 @@ for FluentRequest<'a, IncomeVerificationDocumentsDownloadRequest> { let url = "/income/verification/documents/download"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.access_token { - r = r.json(json!({ "access_token" : unwrapped })); + r = r.json(serde_json::json!({ "access_token" : unwrapped })); } if let Some(ref unwrapped) = self.params.document_id { - r = r.json(json!({ "document_id" : unwrapped })); + r = r.json(serde_json::json!({ "document_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.income_verification_id { - r = r.json(json!({ "income_verification_id" : unwrapped })); + r = r.json(serde_json::json!({ "income_verification_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Download the original documents used for income verification + +`/income/verification/documents/download` provides the ability to download the source documents associated with the verification. + +If Document Income was used, the documents will be those the user provided in Link. For Payroll Income, the most recent files available +for download from the payroll provider will be available from this endpoint. + +The response to `/income/verification/documents/download` is a ZIP file in binary data. If a `document_id` is passed, a single document will be contained in this file. +If not, the response will contain all documents associated with the verification. + +The `request_id` is returned in the `Plaid-Request-ID` header. + +See endpoint docs at .*/ + pub fn income_verification_documents_download( + &self, + ) -> FluentRequest<'_, IncomeVerificationDocumentsDownloadRequest> { + FluentRequest { + client: self, + params: IncomeVerificationDocumentsDownloadRequest { + access_token: None, + document_id: None, + income_verification_id: None, + }, + } + } +} diff --git a/src/request/income_verification_paystubs_get.rs b/src/request/income_verification_paystubs_get.rs index 96f010aa..274fbb8f 100644 --- a/src/request/income_verification_paystubs_get.rs +++ b/src/request/income_verification_paystubs_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::income_verification_paystubs_get`]. On request success, this will return a [`IncomeVerificationPaystubsGetResponse`].*/ @@ -12,12 +9,13 @@ pub struct IncomeVerificationPaystubsGetRequest { pub access_token: Option, pub income_verification_id: Option, } -impl IncomeVerificationPaystubsGetRequest {} impl FluentRequest<'_, IncomeVerificationPaystubsGetRequest> { + ///Set the value of the access_token field. pub fn access_token(mut self, access_token: &str) -> Self { self.params.access_token = Some(access_token.to_owned()); self } + ///Set the value of the income_verification_id field. pub fn income_verification_id(mut self, income_verification_id: &str) -> Self { self.params.income_verification_id = Some(income_verification_id.to_owned()); self @@ -25,21 +23,43 @@ impl FluentRequest<'_, IncomeVerificationPaystubsGetRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IncomeVerificationPaystubsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::IncomeVerificationPaystubsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/income/verification/paystubs/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.access_token { - r = r.json(json!({ "access_token" : unwrapped })); + r = r.json(serde_json::json!({ "access_token" : unwrapped })); } if let Some(ref unwrapped) = self.params.income_verification_id { - r = r.json(json!({ "income_verification_id" : unwrapped })); + r = r.json(serde_json::json!({ "income_verification_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Retrieve information from the paystubs used for income verification + +`/income/verification/paystubs/get` returns the information collected from the paystubs that were used to verify an end user's income. It can be called once the status of the verification has been set to `VERIFICATION_STATUS_PROCESSING_COMPLETE`, as reported by the `INCOME: verification_status` webhook. Attempting to call the endpoint before verification has been completed will result in an error. + +This endpoint has been deprecated; new integrations should use `/credit/payroll_income/get` instead. + +See endpoint docs at .*/ + pub fn income_verification_paystubs_get( + &self, + ) -> FluentRequest<'_, IncomeVerificationPaystubsGetRequest> { + FluentRequest { + client: self, + params: IncomeVerificationPaystubsGetRequest { + access_token: None, + income_verification_id: None, + }, + } + } +} diff --git a/src/request/income_verification_precheck.rs b/src/request/income_verification_precheck.rs index 1d660d92..6ceb7dc1 100644 --- a/src/request/income_verification_precheck.rs +++ b/src/request/income_verification_precheck.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + IncomeVerificationPrecheckEmployer, IncomeVerificationPrecheckPayrollInstitution, + IncomeVerificationPrecheckMilitaryInfo, IncomeVerificationPrecheckUser, +}; /**You should use this struct via [`PlaidClient::income_verification_precheck`]. On request success, this will return a [`IncomeVerificationPrecheckResponse`].*/ @@ -16,12 +17,13 @@ pub struct IncomeVerificationPrecheckRequest { pub us_military_info: Option, pub user: Option, } -impl IncomeVerificationPrecheckRequest {} impl FluentRequest<'_, IncomeVerificationPrecheckRequest> { + ///Set the value of the employer field. pub fn employer(mut self, employer: IncomeVerificationPrecheckEmployer) -> Self { self.params.employer = Some(employer); self } + ///Set the value of the payroll_institution field. pub fn payroll_institution( mut self, payroll_institution: IncomeVerificationPrecheckPayrollInstitution, @@ -29,12 +31,14 @@ impl FluentRequest<'_, IncomeVerificationPrecheckRequest> { self.params.payroll_institution = Some(payroll_institution); self } + ///Set the value of the transactions_access_token field. pub fn transactions_access_token(mut self, transactions_access_token: &str) -> Self { self .params .transactions_access_token = Some(transactions_access_token.to_owned()); self } + ///Set the value of the transactions_access_tokens field. pub fn transactions_access_tokens( mut self, transactions_access_tokens: impl IntoIterator>, @@ -49,6 +53,7 @@ impl FluentRequest<'_, IncomeVerificationPrecheckRequest> { ); self } + ///Set the value of the us_military_info field. pub fn us_military_info( mut self, us_military_info: IncomeVerificationPrecheckMilitaryInfo, @@ -56,6 +61,7 @@ impl FluentRequest<'_, IncomeVerificationPrecheckRequest> { self.params.us_military_info = Some(us_military_info); self } + ///Set the value of the user field. pub fn user(mut self, user: IncomeVerificationPrecheckUser) -> Self { self.params.user = Some(user); self @@ -63,33 +69,67 @@ impl FluentRequest<'_, IncomeVerificationPrecheckRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IncomeVerificationPrecheckRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::IncomeVerificationPrecheckResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/income/verification/precheck"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.employer { - r = r.json(json!({ "employer" : unwrapped })); + r = r.json(serde_json::json!({ "employer" : unwrapped })); } if let Some(ref unwrapped) = self.params.payroll_institution { - r = r.json(json!({ "payroll_institution" : unwrapped })); + r = r.json(serde_json::json!({ "payroll_institution" : unwrapped })); } if let Some(ref unwrapped) = self.params.transactions_access_token { - r = r.json(json!({ "transactions_access_token" : unwrapped })); + r = r + .json( + serde_json::json!({ "transactions_access_token" : unwrapped }), + ); } if let Some(ref unwrapped) = self.params.transactions_access_tokens { - r = r.json(json!({ "transactions_access_tokens" : unwrapped })); + r = r + .json( + serde_json::json!({ "transactions_access_tokens" : unwrapped }), + ); } if let Some(ref unwrapped) = self.params.us_military_info { - r = r.json(json!({ "us_military_info" : unwrapped })); + r = r.json(serde_json::json!({ "us_military_info" : unwrapped })); } if let Some(ref unwrapped) = self.params.user { - r = r.json(json!({ "user" : unwrapped })); + r = r.json(serde_json::json!({ "user" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Check digital income verification eligibility and optimize conversion + +`/income/verification/precheck` is an optional endpoint that can be called before initializing a Link session for income verification. It evaluates whether a given user is supportable by digital income verification and returns a `precheck_id` that can be provided to `/link/token/create`. If the user is eligible for digital verification, providing the `precheck_id` in this way will generate a Link UI optimized for the end user and their specific employer. If the user cannot be confirmed as eligible, the `precheck_id` can still be provided to `/link/token/create` and the user can still use the income verification flow, but they may be required to manually upload a paystub to verify their income. + +While all request fields are optional, providing either `employer` or `transactions_access_tokens` data will increase the chance of receiving a useful result. + +This endpoint has been deprecated; new integrations should use `/credit/payroll_income/precheck` instead. + +See endpoint docs at .*/ + pub fn income_verification_precheck( + &self, + ) -> FluentRequest<'_, IncomeVerificationPrecheckRequest> { + FluentRequest { + client: self, + params: IncomeVerificationPrecheckRequest { + employer: None, + payroll_institution: None, + transactions_access_token: None, + transactions_access_tokens: None, + us_military_info: None, + user: None, + }, + } + } +} diff --git a/src/request/income_verification_taxforms_get.rs b/src/request/income_verification_taxforms_get.rs index a9fea321..16608c9e 100644 --- a/src/request/income_verification_taxforms_get.rs +++ b/src/request/income_verification_taxforms_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::income_verification_taxforms_get`]. On request success, this will return a [`IncomeVerificationTaxformsGetResponse`].*/ @@ -12,12 +9,13 @@ pub struct IncomeVerificationTaxformsGetRequest { pub access_token: Option, pub income_verification_id: Option, } -impl IncomeVerificationTaxformsGetRequest {} impl FluentRequest<'_, IncomeVerificationTaxformsGetRequest> { + ///Set the value of the access_token field. pub fn access_token(mut self, access_token: &str) -> Self { self.params.access_token = Some(access_token.to_owned()); self } + ///Set the value of the income_verification_id field. pub fn income_verification_id(mut self, income_verification_id: &str) -> Self { self.params.income_verification_id = Some(income_verification_id.to_owned()); self @@ -25,21 +23,43 @@ impl FluentRequest<'_, IncomeVerificationTaxformsGetRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IncomeVerificationTaxformsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::IncomeVerificationTaxformsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/income/verification/taxforms/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.access_token { - r = r.json(json!({ "access_token" : unwrapped })); + r = r.json(serde_json::json!({ "access_token" : unwrapped })); } if let Some(ref unwrapped) = self.params.income_verification_id { - r = r.json(json!({ "income_verification_id" : unwrapped })); + r = r.json(serde_json::json!({ "income_verification_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Retrieve information from the tax documents used for income verification + +`/income/verification/taxforms/get` returns the information collected from forms that were used to verify an end user''s income. It can be called once the status of the verification has been set to `VERIFICATION_STATUS_PROCESSING_COMPLETE`, as reported by the `INCOME: verification_status` webhook. Attempting to call the endpoint before verification has been completed will result in an error. + +This endpoint has been deprecated; new integrations should use `/credit/payroll_income/get` instead. + +See endpoint docs at .*/ + pub fn income_verification_taxforms_get( + &self, + ) -> FluentRequest<'_, IncomeVerificationTaxformsGetRequest> { + FluentRequest { + client: self, + params: IncomeVerificationTaxformsGetRequest { + access_token: None, + income_verification_id: None, + }, + } + } +} diff --git a/src/request/institutions_get.rs b/src/request/institutions_get.rs index 97dd81d6..710f6171 100644 --- a/src/request/institutions_get.rs +++ b/src/request/institutions_get.rs @@ -1,42 +1,68 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{CountryCode, InstitutionsGetRequestOptions}; /**You should use this struct via [`PlaidClient::institutions_get`]. On request success, this will return a [`InstitutionsGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct InstitutionsGetRequest { pub count: i64, - pub country_codes: Vec, + pub country_codes: Vec, pub offset: i64, pub options: Option, } -impl InstitutionsGetRequest {} impl FluentRequest<'_, InstitutionsGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: InstitutionsGetRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, InstitutionsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/institutions/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "count" : self.params.count })); - r = r.json(json!({ "country_codes" : self.params.country_codes })); - r = r.json(json!({ "offset" : self.params.offset })); + r = r.json(serde_json::json!({ "count" : self.params.count })); + r = r + .json( + serde_json::json!({ "country_codes" : self.params.country_codes }), + ); + r = r.json(serde_json::json!({ "offset" : self.params.offset })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get details of all supported institutions + +Returns a JSON response containing details on all financial institutions currently supported by Plaid. Because Plaid supports thousands of institutions, results are paginated. + +If there is no overlap between an institution’s enabled products and a client’s enabled products, then the institution will be filtered out from the response. As a result, the number of institutions returned may not match the count specified in the call. + +See endpoint docs at .*/ + pub fn institutions_get( + &self, + count: i64, + country_codes: Vec, + offset: i64, + ) -> FluentRequest<'_, InstitutionsGetRequest> { + FluentRequest { + client: self, + params: InstitutionsGetRequest { + count, + country_codes, + offset, + options: None, + }, + } + } +} diff --git a/src/request/institutions_get_by_id.rs b/src/request/institutions_get_by_id.rs index 0dba0b83..86c407aa 100644 --- a/src/request/institutions_get_by_id.rs +++ b/src/request/institutions_get_by_id.rs @@ -1,40 +1,68 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{CountryCode, InstitutionsGetByIdRequestOptions}; /**You should use this struct via [`PlaidClient::institutions_get_by_id`]. On request success, this will return a [`InstitutionsGetByIdResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct InstitutionsGetByIdRequest { - pub country_codes: Vec, + pub country_codes: Vec, pub institution_id: String, pub options: Option, } -impl InstitutionsGetByIdRequest {} impl FluentRequest<'_, InstitutionsGetByIdRequest> { + ///Set the value of the options field. pub fn options(mut self, options: InstitutionsGetByIdRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, InstitutionsGetByIdRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/institutions/get_by_id"; let mut r = self.client.client.post(url); - r = r.json(json!({ "country_codes" : self.params.country_codes })); - r = r.json(json!({ "institution_id" : self.params.institution_id })); + r = r + .json( + serde_json::json!({ "country_codes" : self.params.country_codes }), + ); + r = r + .json( + serde_json::json!({ "institution_id" : self.params.institution_id }), + ); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get details of an institution + +Returns a JSON response containing details on a specified financial institution currently supported by Plaid. + +Versioning note: API versions 2019-05-29 and earlier allow use of the `public_key` parameter instead of the `client_id` and `secret` to authenticate to this endpoint. The `public_key` has been deprecated; all customers are encouraged to use `client_id` and `secret` instead. + + +See endpoint docs at .*/ + pub fn institutions_get_by_id( + &self, + country_codes: Vec, + institution_id: &str, + ) -> FluentRequest<'_, InstitutionsGetByIdRequest> { + FluentRequest { + client: self, + params: InstitutionsGetByIdRequest { + country_codes, + institution_id: institution_id.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/institutions_search.rs b/src/request/institutions_search.rs index c44e7562..f53a6a3a 100644 --- a/src/request/institutions_search.rs +++ b/src/request/institutions_search.rs @@ -1,55 +1,75 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{CountryCode, InstitutionsSearchRequestOptions, Products}; /**You should use this struct via [`PlaidClient::institutions_search`]. On request success, this will return a [`InstitutionsSearchResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct InstitutionsSearchRequest { - pub country_codes: Vec, + pub country_codes: Vec, pub options: Option, - pub products: Option>, + pub products: Option>, pub query: String, } -impl InstitutionsSearchRequest {} impl FluentRequest<'_, InstitutionsSearchRequest> { + ///Set the value of the options field. pub fn options(mut self, options: InstitutionsSearchRequestOptions) -> Self { self.params.options = Some(options); self } - pub fn products( - mut self, - products: impl IntoIterator>, - ) -> Self { - self - .params - .products = Some( - products.into_iter().map(|s| s.as_ref().to_owned()).collect(), - ); + ///Set the value of the products field. + pub fn products(mut self, products: Vec) -> Self { + self.params.products = Some(products); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, InstitutionsSearchRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/institutions/search"; let mut r = self.client.client.post(url); - r = r.json(json!({ "country_codes" : self.params.country_codes })); + r = r + .json( + serde_json::json!({ "country_codes" : self.params.country_codes }), + ); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } if let Some(ref unwrapped) = self.params.products { - r = r.json(json!({ "products" : unwrapped })); + r = r.json(serde_json::json!({ "products" : unwrapped })); } - r = r.json(json!({ "query" : self.params.query })); + r = r.json(serde_json::json!({ "query" : self.params.query })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Search institutions + +Returns a JSON response containing details for institutions that match the query parameters, up to a maximum of ten institutions per query. + +Versioning note: API versions 2019-05-29 and earlier allow use of the `public_key` parameter instead of the `client_id` and `secret` parameters to authenticate to this endpoint. The `public_key` parameter has since been deprecated; all customers are encouraged to use `client_id` and `secret` instead. + + +See endpoint docs at .*/ + pub fn institutions_search( + &self, + country_codes: Vec, + query: &str, + ) -> FluentRequest<'_, InstitutionsSearchRequest> { + FluentRequest { + client: self, + params: InstitutionsSearchRequest { + country_codes, + options: None, + products: None, + query: query.to_owned(), + }, + } + } +} diff --git a/src/request/investments_auth_get.rs b/src/request/investments_auth_get.rs index 82f1a1f6..0432e61e 100644 --- a/src/request/investments_auth_get.rs +++ b/src/request/investments_auth_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::InvestmentsAuthGetRequestOptions; /**You should use this struct via [`PlaidClient::investments_auth_get`]. On request success, this will return a [`InvestmentsAuthGetResponse`].*/ @@ -12,27 +10,46 @@ pub struct InvestmentsAuthGetRequest { pub access_token: String, pub options: Option, } -impl InvestmentsAuthGetRequest {} impl FluentRequest<'_, InvestmentsAuthGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: InvestmentsAuthGetRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, InvestmentsAuthGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/investments/auth/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get data needed to authorize an investments transfer + +The `/investments/auth/get` endpoint allows developers to receive user-authorized data to facilitate the transfer of holdings + +See endpoint docs at .*/ + pub fn investments_auth_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, InvestmentsAuthGetRequest> { + FluentRequest { + client: self, + params: InvestmentsAuthGetRequest { + access_token: access_token.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/investments_holdings_get.rs b/src/request/investments_holdings_get.rs index 906b4a04..3277670e 100644 --- a/src/request/investments_holdings_get.rs +++ b/src/request/investments_holdings_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::InvestmentHoldingsGetRequestOptions; /**You should use this struct via [`PlaidClient::investments_holdings_get`]. On request success, this will return a [`InvestmentsHoldingsGetResponse`].*/ @@ -12,27 +10,48 @@ pub struct InvestmentsHoldingsGetRequest { pub access_token: String, pub options: Option, } -impl InvestmentsHoldingsGetRequest {} impl FluentRequest<'_, InvestmentsHoldingsGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: InvestmentHoldingsGetRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, InvestmentsHoldingsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::InvestmentsHoldingsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/investments/holdings/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get Investment holdings + +The `/investments/holdings/get` endpoint allows developers to receive user-authorized stock position data for `investment`-type accounts. + +See endpoint docs at .*/ + pub fn investments_holdings_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, InvestmentsHoldingsGetRequest> { + FluentRequest { + client: self, + params: InvestmentsHoldingsGetRequest { + access_token: access_token.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/investments_refresh.rs b/src/request/investments_refresh.rs index eeede8fb..01408283 100644 --- a/src/request/investments_refresh.rs +++ b/src/request/investments_refresh.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::investments_refresh`]. On request success, this will return a [`InvestmentsRefreshResponse`].*/ @@ -11,19 +8,40 @@ On request success, this will return a [`InvestmentsRefreshResponse`].*/ pub struct InvestmentsRefreshRequest { pub access_token: String, } -impl InvestmentsRefreshRequest {} impl FluentRequest<'_, InvestmentsRefreshRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, InvestmentsRefreshRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/investments/refresh"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Refresh investment data + +`/investments/refresh` is an optional endpoint for users of the Investments product. It initiates an on-demand extraction to fetch the newest investment holdings and transactions for an Item. This on-demand extraction takes place in addition to the periodic extractions that automatically occur one or more times per day for any Investments-enabled Item. If changes to investments are discovered after calling `/investments/refresh`, Plaid will fire webhooks: [`HOLDINGS: DEFAULT_UPDATE`](https://plaid.com/docs/api/products/investments/#holdings-default_update) if any new holdings are detected, and [`INVESTMENTS_TRANSACTIONS: DEFAULT_UPDATE`](https://plaid.com/docs/api/products/investments/#investments_transactions-default_update) if any new investment transactions are detected. Updated holdings and investment transactions can be fetched by calling `/investments/holdings/get` and `/investments/transactions/get`. Note that the `/investments/refresh` endpoint is not supported by all institutions. If called on an Item from an institution that does not support this functionality, it will return a `PRODUCT_NOT_SUPPORTED` error. + +As this endpoint triggers a synchronous request for fresh data, latency may be higher than for other Plaid endpoints (typically less than 10 seconds, but occasionally up to 30 seconds or more); if you encounter errors, you may find it necessary to adjust your timeout period when making requests. + +`/investments/refresh` is offered as an add-on to Investments and has a separate [fee model](/docs/account/billing/#per-request-flat-fee). To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. + +See endpoint docs at .*/ + pub fn investments_refresh( + &self, + access_token: &str, + ) -> FluentRequest<'_, InvestmentsRefreshRequest> { + FluentRequest { + client: self, + params: InvestmentsRefreshRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/investments_transactions_get.rs b/src/request/investments_transactions_get.rs index 1afd5711..78b1afe4 100644 --- a/src/request/investments_transactions_get.rs +++ b/src/request/investments_transactions_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::InvestmentsTransactionsGetRequestOptions; /**You should use this struct via [`PlaidClient::investments_transactions_get`]. On request success, this will return a [`InvestmentsTransactionsGetResponse`].*/ @@ -14,8 +12,8 @@ pub struct InvestmentsTransactionsGetRequest { pub options: Option, pub start_date: chrono::NaiveDate, } -impl InvestmentsTransactionsGetRequest {} impl FluentRequest<'_, InvestmentsTransactionsGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: InvestmentsTransactionsGetRequestOptions) -> Self { self.params.options = Some(options); self @@ -23,21 +21,54 @@ impl FluentRequest<'_, InvestmentsTransactionsGetRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, InvestmentsTransactionsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::InvestmentsTransactionsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/investments/transactions/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "end_date" : self.params.end_date })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "end_date" : self.params.end_date })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "start_date" : self.params.start_date })); + r = r.json(serde_json::json!({ "start_date" : self.params.start_date })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get investment transactions + +The `/investments/transactions/get` endpoint allows developers to retrieve up to 24 months of user-authorized transaction data for investment accounts. + +Transactions are returned in reverse-chronological order, and the sequence of transaction ordering is stable and will not shift. + +Due to the potentially large number of investment transactions associated with an Item, results are paginated. Manipulate the count and offset parameters in conjunction with the `total_investment_transactions` response body field to fetch all available investment transactions. + +Note that Investments does not have a webhook to indicate when initial transaction data has loaded (unless you use the `async_update` option). Instead, if transactions data is not ready when `/investments/transactions/get` is first called, Plaid will wait for the data. For this reason, calling `/investments/transactions/get` immediately after Link may take up to one to two minutes to return. + +Data returned by the asynchronous investments extraction flow (when `async_update` is set to true) may not be immediately available to `/investments/transactions/get`. To be alerted when the data is ready to be fetched, listen for the `HISTORICAL_UPDATE` webhook. If no investments history is ready when `/investments/transactions/get` is called, it will return a `PRODUCT_NOT_READY` error. + +See endpoint docs at .*/ + pub fn investments_transactions_get( + &self, + access_token: &str, + end_date: chrono::NaiveDate, + start_date: chrono::NaiveDate, + ) -> FluentRequest<'_, InvestmentsTransactionsGetRequest> { + FluentRequest { + client: self, + params: InvestmentsTransactionsGetRequest { + access_token: access_token.to_owned(), + end_date, + options: None, + start_date, + }, + } + } +} diff --git a/src/request/issues_get.rs b/src/request/issues_get.rs new file mode 100644 index 00000000..1f3f41be --- /dev/null +++ b/src/request/issues_get.rs @@ -0,0 +1,40 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::issues_get`]. + +On request success, this will return a [`IssuesGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct IssuesGetRequest { + pub issue_id: String, +} +impl FluentRequest<'_, IssuesGetRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IssuesGetRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/issues/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "issue_id" : self.params.issue_id })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Get an Issue + +Retrieve detailed information about a specific `Issue`. This endpoint returns a single `Issue` object. + +See endpoint docs at .*/ + pub fn issues_get(&self, issue_id: &str) -> FluentRequest<'_, IssuesGetRequest> { + FluentRequest { + client: self, + params: IssuesGetRequest { + issue_id: issue_id.to_owned(), + }, + } + } +} diff --git a/src/request/issues_search.rs b/src/request/issues_search.rs new file mode 100644 index 00000000..2749bf38 --- /dev/null +++ b/src/request/issues_search.rs @@ -0,0 +1,70 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::issues_search`]. + +On request success, this will return a [`IssuesSearchResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct IssuesSearchRequest { + pub item_id: Option, + pub link_session_id: Option, + pub link_session_request_id: Option, +} +impl FluentRequest<'_, IssuesSearchRequest> { + ///Set the value of the item_id field. + pub fn item_id(mut self, item_id: &str) -> Self { + self.params.item_id = Some(item_id.to_owned()); + self + } + ///Set the value of the link_session_id field. + pub fn link_session_id(mut self, link_session_id: &str) -> Self { + self.params.link_session_id = Some(link_session_id.to_owned()); + self + } + ///Set the value of the link_session_request_id field. + pub fn link_session_request_id(mut self, link_session_request_id: &str) -> Self { + self.params.link_session_request_id = Some(link_session_request_id.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IssuesSearchRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/issues/search"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.item_id { + r = r.json(serde_json::json!({ "item_id" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.link_session_id { + r = r.json(serde_json::json!({ "link_session_id" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.link_session_request_id { + r = r.json(serde_json::json!({ "link_session_request_id" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Search for an Issue + +Search for an issue associated with one of the following identifiers: `item_id`, `link_session_id` or Link session `request_id`. +This endpoint returns a list of `Issue` objects, with an empty list indicating that no issues are associated with the +provided identifier. At least one of the identifiers must be provided to perform the search. + +See endpoint docs at .*/ + pub fn issues_search(&self) -> FluentRequest<'_, IssuesSearchRequest> { + FluentRequest { + client: self, + params: IssuesSearchRequest { + item_id: None, + link_session_id: None, + link_session_request_id: None, + }, + } + } +} diff --git a/src/request/issues_subscribe.rs b/src/request/issues_subscribe.rs new file mode 100644 index 00000000..e390a892 --- /dev/null +++ b/src/request/issues_subscribe.rs @@ -0,0 +1,54 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::issues_subscribe`]. + +On request success, this will return a [`IssuesSubscribeResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct IssuesSubscribeRequest { + pub issue_id: String, + pub webhook: Option, +} +impl FluentRequest<'_, IssuesSubscribeRequest> { + ///Set the value of the webhook field. + pub fn webhook(mut self, webhook: &str) -> Self { + self.params.webhook = Some(webhook.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, IssuesSubscribeRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/issues/subscribe"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "issue_id" : self.params.issue_id })); + if let Some(ref unwrapped) = self.params.webhook { + r = r.json(serde_json::json!({ "webhook" : unwrapped })); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Subscribe to an Issue + +Allows a user to subscribe to updates on a specific `Issue` using a POST method. Subscribers will receive webhook notifications when the issue status changes, particularly when resolved. + +See endpoint docs at .*/ + pub fn issues_subscribe( + &self, + issue_id: &str, + ) -> FluentRequest<'_, IssuesSubscribeRequest> { + FluentRequest { + client: self, + params: IssuesSubscribeRequest { + issue_id: issue_id.to_owned(), + webhook: None, + }, + } + } +} diff --git a/src/request/item_access_token_invalidate.rs b/src/request/item_access_token_invalidate.rs index fe8fe91c..86f46975 100644 --- a/src/request/item_access_token_invalidate.rs +++ b/src/request/item_access_token_invalidate.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::item_access_token_invalidate`]. On request success, this will return a [`ItemAccessTokenInvalidateResponse`].*/ @@ -11,20 +8,42 @@ On request success, this will return a [`ItemAccessTokenInvalidateResponse`].*/ pub struct ItemAccessTokenInvalidateRequest { pub access_token: String, } -impl ItemAccessTokenInvalidateRequest {} impl FluentRequest<'_, ItemAccessTokenInvalidateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemAccessTokenInvalidateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ItemAccessTokenInvalidateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/access_token/invalidate"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Invalidate access_token + +By default, the `access_token` associated with an Item does not expire and should be stored in a persistent, secure manner. + +You can use the `/item/access_token/invalidate` endpoint to rotate the `access_token` associated with an Item. The endpoint returns a new `access_token` and immediately invalidates the previous `access_token`. + + +See endpoint docs at .*/ + pub fn item_access_token_invalidate( + &self, + access_token: &str, + ) -> FluentRequest<'_, ItemAccessTokenInvalidateRequest> { + FluentRequest { + client: self, + params: ItemAccessTokenInvalidateRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/item_activity_list.rs b/src/request/item_activity_list.rs index ba200fdf..04442939 100644 --- a/src/request/item_activity_list.rs +++ b/src/request/item_activity_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::item_activity_list`]. On request success, this will return a [`ItemActivityListResponse`].*/ @@ -13,40 +10,55 @@ pub struct ItemActivityListRequest { pub count: Option, pub cursor: Option, } -impl ItemActivityListRequest {} impl FluentRequest<'_, ItemActivityListRequest> { + ///Set the value of the access_token field. pub fn access_token(mut self, access_token: &str) -> Self { self.params.access_token = Some(access_token.to_owned()); self } + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemActivityListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/activity/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.access_token { - r = r.json(json!({ "access_token" : unwrapped })); + r = r.json(serde_json::json!({ "access_token" : unwrapped })); } if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + ///List a historical log of user consent events + pub fn item_activity_list(&self) -> FluentRequest<'_, ItemActivityListRequest> { + FluentRequest { + client: self, + params: ItemActivityListRequest { + access_token: None, + count: None, + cursor: None, + }, + } + } +} diff --git a/src/request/item_application_list.rs b/src/request/item_application_list.rs index 61302c7a..1065567a 100644 --- a/src/request/item_application_list.rs +++ b/src/request/item_application_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::item_application_list`]. On request success, this will return a [`ItemApplicationListResponse`].*/ @@ -11,26 +8,39 @@ On request success, this will return a [`ItemApplicationListResponse`].*/ pub struct ItemApplicationListRequest { pub access_token: Option, } -impl ItemApplicationListRequest {} impl FluentRequest<'_, ItemApplicationListRequest> { + ///Set the value of the access_token field. pub fn access_token(mut self, access_token: &str) -> Self { self.params.access_token = Some(access_token.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemApplicationListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/application/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.access_token { - r = r.json(json!({ "access_token" : unwrapped })); + r = r.json(serde_json::json!({ "access_token" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + ///List a user’s connected applications + pub fn item_application_list( + &self, + ) -> FluentRequest<'_, ItemApplicationListRequest> { + FluentRequest { + client: self, + params: ItemApplicationListRequest { + access_token: None, + }, + } + } +} diff --git a/src/request/item_application_scopes_update.rs b/src/request/item_application_scopes_update.rs index 5845de51..ef27fceb 100644 --- a/src/request/item_application_scopes_update.rs +++ b/src/request/item_application_scopes_update.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ScopesContext, Scopes}; /**You should use this struct via [`PlaidClient::item_application_scopes_update`]. On request success, this will return a [`ItemApplicationScopesUpdateResponse`].*/ @@ -11,19 +9,18 @@ On request success, this will return a [`ItemApplicationScopesUpdateResponse`].* pub struct ItemApplicationScopesUpdateRequest { pub access_token: String, pub application_id: String, - pub context: String, + pub context: ScopesContext, pub scopes: Scopes, pub state: Option, } -impl ItemApplicationScopesUpdateRequest {} pub struct ItemApplicationScopesUpdateRequired<'a> { pub access_token: &'a str, pub application_id: &'a str, - pub context: &'a str, + pub context: ScopesContext, pub scopes: Scopes, } -impl<'a> ItemApplicationScopesUpdateRequired<'a> {} impl FluentRequest<'_, ItemApplicationScopesUpdateRequest> { + ///Set the value of the state field. pub fn state(mut self, state: &str) -> Self { self.params.state = Some(state.to_owned()); self @@ -31,22 +28,47 @@ impl FluentRequest<'_, ItemApplicationScopesUpdateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemApplicationScopesUpdateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ItemApplicationScopesUpdateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/application/scopes/update"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "application_id" : self.params.application_id })); - r = r.json(json!({ "context" : self.params.context })); - r = r.json(json!({ "scopes" : self.params.scopes })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r + .json( + serde_json::json!({ "application_id" : self.params.application_id }), + ); + r = r.json(serde_json::json!({ "context" : self.params.context })); + r = r.json(serde_json::json!({ "scopes" : self.params.scopes })); if let Some(ref unwrapped) = self.params.state { - r = r.json(json!({ "state" : unwrapped })); + r = r.json(serde_json::json!({ "state" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update the scopes of access for a particular application + +Enable consumers to update product access on selected accounts for an application.*/ + pub fn item_application_scopes_update( + &self, + args: ItemApplicationScopesUpdateRequired, + ) -> FluentRequest<'_, ItemApplicationScopesUpdateRequest> { + FluentRequest { + client: self, + params: ItemApplicationScopesUpdateRequest { + access_token: args.access_token.to_owned(), + application_id: args.application_id.to_owned(), + context: args.context, + scopes: args.scopes, + state: None, + }, + } + } +} diff --git a/src/request/item_application_unlink.rs b/src/request/item_application_unlink.rs index 5a1a5cf3..7c013ff5 100644 --- a/src/request/item_application_unlink.rs +++ b/src/request/item_application_unlink.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::item_application_unlink`]. On request success, this will return a [`ItemApplicationUnlinkResponse`].*/ @@ -12,20 +9,48 @@ pub struct ItemApplicationUnlinkRequest { pub access_token: String, pub application_id: String, } -impl ItemApplicationUnlinkRequest {} impl FluentRequest<'_, ItemApplicationUnlinkRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemApplicationUnlinkRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ItemApplicationUnlinkResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/application/unlink"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "application_id" : self.params.application_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r + .json( + serde_json::json!({ "application_id" : self.params.application_id }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Unlink a user’s connected application + +Unlink a user’s connected application. On an unlink request, Plaid will immediately revoke the Application’s access to the User’s data. The User will have to redo the OAuth authentication process in order to restore functionality. + +This endpoint only removes ongoing data access permissions, therefore the User will need to reach out to the Application itself in order to disable and delete their account and delete any data that the Application already received (if the Application does not do so by default). + +This endpoint should be called in real time as the User is unlinking an Application, and should not be batched in order to ensure that the change is reflected as soon as possible. + +See endpoint docs at .*/ + pub fn item_application_unlink( + &self, + access_token: &str, + application_id: &str, + ) -> FluentRequest<'_, ItemApplicationUnlinkRequest> { + FluentRequest { + client: self, + params: ItemApplicationUnlinkRequest { + access_token: access_token.to_owned(), + application_id: application_id.to_owned(), + }, + } + } +} diff --git a/src/request/item_create_public_token.rs b/src/request/item_create_public_token.rs index b2d64044..6eb2b21c 100644 --- a/src/request/item_create_public_token.rs +++ b/src/request/item_create_public_token.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::item_create_public_token`]. On request success, this will return a [`ItemPublicTokenCreateResponse`].*/ @@ -11,19 +8,44 @@ On request success, this will return a [`ItemPublicTokenCreateResponse`].*/ pub struct ItemCreatePublicTokenRequest { pub access_token: String, } -impl ItemCreatePublicTokenRequest {} impl FluentRequest<'_, ItemCreatePublicTokenRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemCreatePublicTokenRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ItemPublicTokenCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/public_token/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create public token + +Note: As of July 2020, the `/item/public_token/create` endpoint is deprecated. Instead, use `/link/token/create` with an `access_token` to create a Link token for use with [update mode](https://plaid.com/docs/link/update-mode). + +If you need your user to take action to restore or resolve an error associated with an Item, generate a public token with the `/item/public_token/create` endpoint and then initialize Link with that `public_token`. + +A `public_token` is one-time use and expires after 30 minutes. You use a `public_token` to initialize Link in [update mode](https://plaid.com/docs/link/update-mode) for a particular Item. You can generate a `public_token` for an Item even if you did not use Link to create the Item originally. + +The `/item/public_token/create` endpoint is **not** used to create your initial `public_token`. If you have not already received an `access_token` for a specific Item, use Link to obtain your `public_token` instead. See the [Quickstart](https://plaid.com/docs/quickstart) for more information. + +See endpoint docs at .*/ + pub fn item_create_public_token( + &self, + access_token: &str, + ) -> FluentRequest<'_, ItemCreatePublicTokenRequest> { + FluentRequest { + client: self, + params: ItemCreatePublicTokenRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/item_get.rs b/src/request/item_get.rs index 961d72c9..bf6f26c6 100644 --- a/src/request/item_get.rs +++ b/src/request/item_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::item_get`]. On request success, this will return a [`ItemGetResponse`].*/ @@ -11,19 +8,33 @@ On request success, this will return a [`ItemGetResponse`].*/ pub struct ItemGetRequest { pub access_token: String, } -impl ItemGetRequest {} impl FluentRequest<'_, ItemGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve an Item + +Returns information about the status of an Item. + +See endpoint docs at .*/ + pub fn item_get(&self, access_token: &str) -> FluentRequest<'_, ItemGetRequest> { + FluentRequest { + client: self, + params: ItemGetRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/item_import.rs b/src/request/item_import.rs index 3802dd28..ace9a18e 100644 --- a/src/request/item_import.rs +++ b/src/request/item_import.rs @@ -1,40 +1,59 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ItemImportRequestOptions, Products, ItemImportRequestUserAuth}; /**You should use this struct via [`PlaidClient::item_import`]. On request success, this will return a [`ItemImportResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ItemImportRequest { pub options: Option, - pub products: Vec, + pub products: Vec, pub user_auth: ItemImportRequestUserAuth, } -impl ItemImportRequest {} impl FluentRequest<'_, ItemImportRequest> { + ///Set the value of the options field. pub fn options(mut self, options: ItemImportRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemImportRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/import"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "products" : self.params.products })); - r = r.json(json!({ "user_auth" : self.params.user_auth })); + r = r.json(serde_json::json!({ "products" : self.params.products })); + r = r.json(serde_json::json!({ "user_auth" : self.params.user_auth })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Import Item + +`/item/import` creates an Item via your Plaid Exchange Integration and returns an `access_token`. As part of an `/item/import` request, you will include a User ID (`user_auth.user_id`) and Authentication Token (`user_auth.auth_token`) that enable data aggregation through your Plaid Exchange API endpoints. These authentication principals are to be chosen by you. + +Upon creating an Item via `/item/import`, Plaid will automatically begin an extraction of that Item through the Plaid Exchange infrastructure you have already integrated.*/ + pub fn item_import( + &self, + products: Vec, + user_auth: ItemImportRequestUserAuth, + ) -> FluentRequest<'_, ItemImportRequest> { + FluentRequest { + client: self, + params: ItemImportRequest { + options: None, + products, + user_auth, + }, + } + } +} diff --git a/src/request/item_public_token_exchange.rs b/src/request/item_public_token_exchange.rs index e0d945d0..e3b1030d 100644 --- a/src/request/item_public_token_exchange.rs +++ b/src/request/item_public_token_exchange.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::item_public_token_exchange`]. On request success, this will return a [`ItemPublicTokenExchangeResponse`].*/ @@ -11,20 +8,41 @@ On request success, this will return a [`ItemPublicTokenExchangeResponse`].*/ pub struct ItemPublicTokenExchangeRequest { pub public_token: String, } -impl ItemPublicTokenExchangeRequest {} impl FluentRequest<'_, ItemPublicTokenExchangeRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemPublicTokenExchangeRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ItemPublicTokenExchangeResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/public_token/exchange"; let mut r = self.client.client.post(url); - r = r.json(json!({ "public_token" : self.params.public_token })); + r = r.json(serde_json::json!({ "public_token" : self.params.public_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Exchange public token for an access token + +Exchange a Link `public_token` for an API `access_token`. Link hands off the `public_token` client-side via the `onSuccess` callback once a user has successfully created an Item. The `public_token` is ephemeral and expires after 30 minutes. An `access_token` does not expire, but can be revoked by calling `/item/remove`. + +The response also includes an `item_id` that should be stored with the `access_token`. The `item_id` is used to identify an Item in a webhook. The `item_id` can also be retrieved by making an `/item/get` request. + +See endpoint docs at .*/ + pub fn item_public_token_exchange( + &self, + public_token: &str, + ) -> FluentRequest<'_, ItemPublicTokenExchangeRequest> { + FluentRequest { + client: self, + params: ItemPublicTokenExchangeRequest { + public_token: public_token.to_owned(), + }, + } + } +} diff --git a/src/request/item_remove.rs b/src/request/item_remove.rs index 3a797093..cabfa06a 100644 --- a/src/request/item_remove.rs +++ b/src/request/item_remove.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::item_remove`]. On request success, this will return a [`ItemRemoveResponse`].*/ @@ -11,19 +8,46 @@ On request success, this will return a [`ItemRemoveResponse`].*/ pub struct ItemRemoveRequest { pub access_token: String, } -impl ItemRemoveRequest {} impl FluentRequest<'_, ItemRemoveRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemRemoveRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/remove"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Remove an Item + +The `/item/remove` endpoint allows you to remove an Item. Once removed, the `access_token`, as well as any processor tokens or bank account tokens associated with the Item, is no longer valid and cannot be used to access any data that was associated with the Item. + +Calling `/item/remove` is a recommended best practice when offboarding users or if a user chooses to disconnect an account linked via Plaid. For subscription products, such as Transactions, Liabilities, and Investments, calling `/item/remove` is required to end subscription billing for the Item. + +In Limited Production, calling `/item/remove` does not impact the number of remaining Limited Production Items you have available. + +Removing an Item does not affect any Asset Reports or Audit Copies you have already created, which will remain accessible until you remove access to them specifically using the `/asset_report/remove` endpoint. + +Also note that for certain OAuth-based institutions, an Item removed via `/item/remove` may still show as an active connection in the institution's OAuth permission manager. + +API versions 2019-05-29 and earlier return a `removed` boolean as part of the response. + +See endpoint docs at .*/ + pub fn item_remove( + &self, + access_token: &str, + ) -> FluentRequest<'_, ItemRemoveRequest> { + FluentRequest { + client: self, + params: ItemRemoveRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/item_webhook_update.rs b/src/request/item_webhook_update.rs index fb86ddec..a627554e 100644 --- a/src/request/item_webhook_update.rs +++ b/src/request/item_webhook_update.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::item_webhook_update`]. On request success, this will return a [`ItemWebhookUpdateResponse`].*/ @@ -12,27 +9,46 @@ pub struct ItemWebhookUpdateRequest { pub access_token: String, pub webhook: Option, } -impl ItemWebhookUpdateRequest {} impl FluentRequest<'_, ItemWebhookUpdateRequest> { + ///Set the value of the webhook field. pub fn webhook(mut self, webhook: &str) -> Self { self.params.webhook = Some(webhook.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ItemWebhookUpdateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/item/webhook/update"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.webhook { - r = r.json(json!({ "webhook" : unwrapped })); + r = r.json(serde_json::json!({ "webhook" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update Webhook URL + +The POST `/item/webhook/update` allows you to update the webhook URL associated with an Item. This request triggers a [`WEBHOOK_UPDATE_ACKNOWLEDGED`](https://plaid.com/docs/api/items/#webhook_update_acknowledged) webhook to the newly specified webhook URL. + +See endpoint docs at .*/ + pub fn item_webhook_update( + &self, + access_token: &str, + ) -> FluentRequest<'_, ItemWebhookUpdateRequest> { + FluentRequest { + client: self, + params: ItemWebhookUpdateRequest { + access_token: access_token.to_owned(), + webhook: None, + }, + } + } +} diff --git a/src/request/liabilities_get.rs b/src/request/liabilities_get.rs index d309acc2..25425851 100644 --- a/src/request/liabilities_get.rs +++ b/src/request/liabilities_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::LiabilitiesGetRequestOptions; /**You should use this struct via [`PlaidClient::liabilities_get`]. On request success, this will return a [`LiabilitiesGetResponse`].*/ @@ -12,27 +10,48 @@ pub struct LiabilitiesGetRequest { pub access_token: String, pub options: Option, } -impl LiabilitiesGetRequest {} impl FluentRequest<'_, LiabilitiesGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: LiabilitiesGetRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, LiabilitiesGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/liabilities/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve Liabilities data + +The `/liabilities/get` endpoint returns various details about an Item with loan or credit accounts. Liabilities data is available primarily for US financial institutions, with some limited coverage of Canadian institutions. Currently supported account types are account type `credit` with account subtype `credit card` or `paypal`, and account type `loan` with account subtype `student` or `mortgage`. To limit accounts listed in Link to types and subtypes supported by Liabilities, you can use the `account_filters` parameter when [creating a Link token](https://plaid.com/docs/api/link/#linktokencreate). + +The types of information returned by Liabilities can include balances and due dates, loan terms, and account details such as original loan amount and guarantor. Data is refreshed approximately once per day; the latest data can be retrieved by calling `/liabilities/get`. + +See endpoint docs at .*/ + pub fn liabilities_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, LiabilitiesGetRequest> { + FluentRequest { + client: self, + params: LiabilitiesGetRequest { + access_token: access_token.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/link_delivery_create.rs b/src/request/link_delivery_create.rs index e5adb808..18f6a6ee 100644 --- a/src/request/link_delivery_create.rs +++ b/src/request/link_delivery_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::LinkDeliveryOptions; /**You should use this struct via [`PlaidClient::link_delivery_create`]. On request success, this will return a [`LinkDeliveryCreateResponse`].*/ @@ -12,27 +10,46 @@ pub struct LinkDeliveryCreateRequest { pub link_token: String, pub options: Option, } -impl LinkDeliveryCreateRequest {} impl FluentRequest<'_, LinkDeliveryCreateRequest> { + ///Set the value of the options field. pub fn options(mut self, options: LinkDeliveryOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, LinkDeliveryCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/link_delivery/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "link_token" : self.params.link_token })); + r = r.json(serde_json::json!({ "link_token" : self.params.link_token })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create Hosted Link session + +Use the `/link_delivery/create` endpoint to create a Hosted Link session. + +See endpoint docs at .*/ + pub fn link_delivery_create( + &self, + link_token: &str, + ) -> FluentRequest<'_, LinkDeliveryCreateRequest> { + FluentRequest { + client: self, + params: LinkDeliveryCreateRequest { + link_token: link_token.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/link_delivery_get.rs b/src/request/link_delivery_get.rs index 5133dc33..169f0b79 100644 --- a/src/request/link_delivery_get.rs +++ b/src/request/link_delivery_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::link_delivery_get`]. On request success, this will return a [`LinkDeliveryGetResponse`].*/ @@ -11,10 +8,9 @@ On request success, this will return a [`LinkDeliveryGetResponse`].*/ pub struct LinkDeliveryGetRequest { pub link_delivery_session_id: String, } -impl LinkDeliveryGetRequest {} impl FluentRequest<'_, LinkDeliveryGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, LinkDeliveryGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -22,7 +18,7 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, LinkDeliveryGetRequest> let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "link_delivery_session_id" : self.params .link_delivery_session_id } ), @@ -32,4 +28,22 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, LinkDeliveryGetRequest> res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get Hosted Link session + +Use the `/link_delivery/get` endpoint to get the status of a Hosted Link session. + +See endpoint docs at .*/ + pub fn link_delivery_get( + &self, + link_delivery_session_id: &str, + ) -> FluentRequest<'_, LinkDeliveryGetRequest> { + FluentRequest { + client: self, + params: LinkDeliveryGetRequest { + link_delivery_session_id: link_delivery_session_id.to_owned(), + }, + } + } +} diff --git a/src/request/link_oauth_correlation_id_exchange.rs b/src/request/link_oauth_correlation_id_exchange.rs index d8fb5d8f..cdddae4f 100644 --- a/src/request/link_oauth_correlation_id_exchange.rs +++ b/src/request/link_oauth_correlation_id_exchange.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::link_oauth_correlation_id_exchange`]. On request success, this will return a [`LinkOAuthCorrelationIdExchangeResponse`].*/ @@ -11,11 +8,12 @@ On request success, this will return a [`LinkOAuthCorrelationIdExchangeResponse` pub struct LinkOauthCorrelationIdExchangeRequest { pub link_correlation_id: String, } -impl LinkOauthCorrelationIdExchangeRequest {} impl FluentRequest<'_, LinkOauthCorrelationIdExchangeRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, LinkOauthCorrelationIdExchangeRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::LinkOAuthCorrelationIdExchangeResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,11 +21,32 @@ for FluentRequest<'a, LinkOauthCorrelationIdExchangeRequest> { let mut r = self.client.client.post(url); r = r .json( - json!({ "link_correlation_id" : self.params.link_correlation_id }), + serde_json::json!( + { "link_correlation_id" : self.params.link_correlation_id } + ), ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Exchange the Link Correlation Id for a Link Token + +Exchange an OAuth `link_correlation_id` for the corresponding `link_token`. The `link_correlation_id` is only available for 'payment_initiation' products and is provided to the client via the OAuth `redirect_uri` as a query parameter. +The `link_correlation_id` is ephemeral and expires in a brief period, after which it can no longer be exchanged for the 'link_token'. + +See endpoint docs at .*/ + pub fn link_oauth_correlation_id_exchange( + &self, + link_correlation_id: &str, + ) -> FluentRequest<'_, LinkOauthCorrelationIdExchangeRequest> { + FluentRequest { + client: self, + params: LinkOauthCorrelationIdExchangeRequest { + link_correlation_id: link_correlation_id.to_owned(), + }, + } + } +} diff --git a/src/request/link_profile_eligibility_check.rs b/src/request/link_profile_eligibility_check.rs new file mode 100644 index 00000000..782299de --- /dev/null +++ b/src/request/link_profile_eligibility_check.rs @@ -0,0 +1,58 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::LinkProfileEligibilityCheckUser; +/**You should use this struct via [`PlaidClient::link_profile_eligibility_check`]. + +On request success, this will return a [`LinkProfileEligibilityCheckResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct LinkProfileEligibilityCheckRequest { + pub link_session_id: String, + pub user: LinkProfileEligibilityCheckUser, +} +impl FluentRequest<'_, LinkProfileEligibilityCheckRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, LinkProfileEligibilityCheckRequest> { + type Output = httpclient::InMemoryResult< + crate::model::LinkProfileEligibilityCheckResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/link/profile/eligibility/check"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!( + { "link_session_id" : self.params.link_session_id } + ), + ); + r = r.json(serde_json::json!({ "user" : self.params.user })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Check profile eligibility + +The `/link/profile/eligibility/check` endpoint can be used to check whether a user with the +supplied phone number has a saved profile that satisfies customer-defined eligibility +requirements. + +See endpoint docs at .*/ + pub fn link_profile_eligibility_check( + &self, + link_session_id: &str, + user: LinkProfileEligibilityCheckUser, + ) -> FluentRequest<'_, LinkProfileEligibilityCheckRequest> { + FluentRequest { + client: self, + params: LinkProfileEligibilityCheckRequest { + link_session_id: link_session_id.to_owned(), + user, + }, + } + } +} diff --git a/src/request/link_token_create.rs b/src/request/link_token_create.rs index 26217b3f..1939ab40 100644 --- a/src/request/link_token_create.rs +++ b/src/request/link_token_create.rs @@ -1,9 +1,19 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + LinkTokenAccountFilters, Products, LinkTokenCreateRequestAuth, + LinkTokenCreateRequestBaseReport, LinkTokenCreateCardSwitch, CountryCode, + LinkTokenCreateRequestCraOptions, LinkTokenCreateRequestCreditPartnerInsights, + LinkTokenCreateRequestDepositSwitch, LinkTokenCreateRequestEmployment, + LinkTokenEUConfig, LinkTokenCreateHostedLink, LinkTokenCreateIdentity, + LinkTokenCreateRequestIdentityVerification, LinkTokenCreateRequestIncomeVerification, + LinkTokenCreateInstitutionData, LinkTokenInvestments, LinkTokenInvestmentsAuth, + LinkTokenCreateRequestPaymentConfiguration, LinkTokenCreateRequestPaymentInitiation, + LinkTokenCreateRequestStatements, LinkTokenTransactions, + LinkTokenCreateRequestTransfer, LinkTokenCreateRequestUpdate, + LinkTokenCreateRequestUser, +}; /**You should use this struct via [`PlaidClient::link_token_create`]. On request success, this will return a [`LinkTokenCreateResponse`].*/ @@ -12,19 +22,24 @@ pub struct LinkTokenCreateRequest { pub access_token: Option, pub access_tokens: Option>, pub account_filters: Option, - pub additional_consented_products: Option>, + pub additional_consented_products: Option>, pub android_package_name: Option, pub auth: Option, pub base_report: Option, pub card_switch: Option, pub client_name: String, - pub consumer_report_permissible_purpose: Option, - pub country_codes: Vec, + pub consumer_report_permissible_purpose: Option, + pub country_codes: Vec, pub cra_enabled: Option, + pub cra_options: Option, + pub credit_partner_insights: Option, pub deposit_switch: Option, pub employment: Option, + pub enable_multi_item_link: Option, pub eu_config: Option, + pub financekit_supported: Option, pub hosted_link: Option, + pub identity: Option, pub identity_verification: Option, pub income_verification: Option, pub institution_data: Option, @@ -33,11 +48,12 @@ pub struct LinkTokenCreateRequest { pub investments_auth: Option, pub language: String, pub link_customization_name: Option, - pub optional_products: Option>, + pub optional_products: Option>, + pub payment_configuration: Option, pub payment_initiation: Option, - pub products: Option>, + pub products: Option>, pub redirect_uri: Option, - pub required_if_supported_products: Option>, + pub required_if_supported_products: Option>, pub statements: Option, pub transactions: Option, pub transfer: Option, @@ -46,19 +62,19 @@ pub struct LinkTokenCreateRequest { pub user_token: Option, pub webhook: Option, } -impl LinkTokenCreateRequest {} pub struct LinkTokenCreateRequired<'a> { pub client_name: &'a str, - pub country_codes: &'a [&'a str], + pub country_codes: Vec, pub language: &'a str, pub user: LinkTokenCreateRequestUser, } -impl<'a> LinkTokenCreateRequired<'a> {} impl FluentRequest<'_, LinkTokenCreateRequest> { + ///Set the value of the access_token field. pub fn access_token(mut self, access_token: &str) -> Self { self.params.access_token = Some(access_token.to_owned()); self } + ///Set the value of the access_tokens field. pub fn access_tokens( mut self, access_tokens: impl IntoIterator>, @@ -70,55 +86,70 @@ impl FluentRequest<'_, LinkTokenCreateRequest> { ); self } + ///Set the value of the account_filters field. pub fn account_filters(mut self, account_filters: LinkTokenAccountFilters) -> Self { self.params.account_filters = Some(account_filters); self } + ///Set the value of the additional_consented_products field. pub fn additional_consented_products( mut self, - additional_consented_products: impl IntoIterator>, + additional_consented_products: Vec, ) -> Self { - self - .params - .additional_consented_products = Some( - additional_consented_products - .into_iter() - .map(|s| s.as_ref().to_owned()) - .collect(), - ); + self.params.additional_consented_products = Some(additional_consented_products); self } + ///Set the value of the android_package_name field. pub fn android_package_name(mut self, android_package_name: &str) -> Self { self.params.android_package_name = Some(android_package_name.to_owned()); self } + ///Set the value of the auth field. pub fn auth(mut self, auth: LinkTokenCreateRequestAuth) -> Self { self.params.auth = Some(auth); self } + ///Set the value of the base_report field. pub fn base_report(mut self, base_report: LinkTokenCreateRequestBaseReport) -> Self { self.params.base_report = Some(base_report); self } + ///Set the value of the card_switch field. pub fn card_switch(mut self, card_switch: LinkTokenCreateCardSwitch) -> Self { self.params.card_switch = Some(card_switch); self } + ///Set the value of the consumer_report_permissible_purpose field. pub fn consumer_report_permissible_purpose( mut self, - consumer_report_permissible_purpose: &str, + consumer_report_permissible_purpose: serde_json::Value, ) -> Self { self .params .consumer_report_permissible_purpose = Some( - consumer_report_permissible_purpose.to_owned(), + consumer_report_permissible_purpose, ); self } + ///Set the value of the cra_enabled field. pub fn cra_enabled(mut self, cra_enabled: bool) -> Self { self.params.cra_enabled = Some(cra_enabled); self } + ///Set the value of the cra_options field. + pub fn cra_options(mut self, cra_options: LinkTokenCreateRequestCraOptions) -> Self { + self.params.cra_options = Some(cra_options); + self + } + ///Set the value of the credit_partner_insights field. + pub fn credit_partner_insights( + mut self, + credit_partner_insights: LinkTokenCreateRequestCreditPartnerInsights, + ) -> Self { + self.params.credit_partner_insights = Some(credit_partner_insights); + self + } + ///Set the value of the deposit_switch field. pub fn deposit_switch( mut self, deposit_switch: LinkTokenCreateRequestDepositSwitch, @@ -126,18 +157,37 @@ impl FluentRequest<'_, LinkTokenCreateRequest> { self.params.deposit_switch = Some(deposit_switch); self } + ///Set the value of the employment field. pub fn employment(mut self, employment: LinkTokenCreateRequestEmployment) -> Self { self.params.employment = Some(employment); self } + ///Set the value of the enable_multi_item_link field. + pub fn enable_multi_item_link(mut self, enable_multi_item_link: bool) -> Self { + self.params.enable_multi_item_link = Some(enable_multi_item_link); + self + } + ///Set the value of the eu_config field. pub fn eu_config(mut self, eu_config: LinkTokenEuConfig) -> Self { self.params.eu_config = Some(eu_config); self } + ///Set the value of the financekit_supported field. + pub fn financekit_supported(mut self, financekit_supported: bool) -> Self { + self.params.financekit_supported = Some(financekit_supported); + self + } + ///Set the value of the hosted_link field. pub fn hosted_link(mut self, hosted_link: LinkTokenCreateHostedLink) -> Self { self.params.hosted_link = Some(hosted_link); self } + ///Set the value of the identity field. + pub fn identity(mut self, identity: LinkTokenCreateIdentity) -> Self { + self.params.identity = Some(identity); + self + } + ///Set the value of the identity_verification field. pub fn identity_verification( mut self, identity_verification: LinkTokenCreateRequestIdentityVerification, @@ -145,6 +195,7 @@ impl FluentRequest<'_, LinkTokenCreateRequest> { self.params.identity_verification = Some(identity_verification); self } + ///Set the value of the income_verification field. pub fn income_verification( mut self, income_verification: LinkTokenCreateRequestIncomeVerification, @@ -152,6 +203,7 @@ impl FluentRequest<'_, LinkTokenCreateRequest> { self.params.income_verification = Some(income_verification); self } + ///Set the value of the institution_data field. pub fn institution_data( mut self, institution_data: LinkTokenCreateInstitutionData, @@ -159,14 +211,17 @@ impl FluentRequest<'_, LinkTokenCreateRequest> { self.params.institution_data = Some(institution_data); self } + ///Set the value of the institution_id field. pub fn institution_id(mut self, institution_id: &str) -> Self { self.params.institution_id = Some(institution_id.to_owned()); self } + ///Set the value of the investments field. pub fn investments(mut self, investments: LinkTokenInvestments) -> Self { self.params.investments = Some(investments); self } + ///Set the value of the investments_auth field. pub fn investments_auth( mut self, investments_auth: LinkTokenInvestmentsAuth, @@ -174,21 +229,25 @@ impl FluentRequest<'_, LinkTokenCreateRequest> { self.params.investments_auth = Some(investments_auth); self } + ///Set the value of the link_customization_name field. pub fn link_customization_name(mut self, link_customization_name: &str) -> Self { self.params.link_customization_name = Some(link_customization_name.to_owned()); self } - pub fn optional_products( + ///Set the value of the optional_products field. + pub fn optional_products(mut self, optional_products: Vec) -> Self { + self.params.optional_products = Some(optional_products); + self + } + ///Set the value of the payment_configuration field. + pub fn payment_configuration( mut self, - optional_products: impl IntoIterator>, + payment_configuration: LinkTokenCreateRequestPaymentConfiguration, ) -> Self { - self - .params - .optional_products = Some( - optional_products.into_iter().map(|s| s.as_ref().to_owned()).collect(), - ); + self.params.payment_configuration = Some(payment_configuration); self } + ///Set the value of the payment_initiation field. pub fn payment_initiation( mut self, payment_initiation: LinkTokenCreateRequestPaymentInitiation, @@ -196,171 +255,265 @@ impl FluentRequest<'_, LinkTokenCreateRequest> { self.params.payment_initiation = Some(payment_initiation); self } - pub fn products( - mut self, - products: impl IntoIterator>, - ) -> Self { - self - .params - .products = Some( - products.into_iter().map(|s| s.as_ref().to_owned()).collect(), - ); + ///Set the value of the products field. + pub fn products(mut self, products: Vec) -> Self { + self.params.products = Some(products); self } + ///Set the value of the redirect_uri field. pub fn redirect_uri(mut self, redirect_uri: &str) -> Self { self.params.redirect_uri = Some(redirect_uri.to_owned()); self } + ///Set the value of the required_if_supported_products field. pub fn required_if_supported_products( mut self, - required_if_supported_products: impl IntoIterator>, + required_if_supported_products: Vec, ) -> Self { self .params - .required_if_supported_products = Some( - required_if_supported_products - .into_iter() - .map(|s| s.as_ref().to_owned()) - .collect(), - ); + .required_if_supported_products = Some(required_if_supported_products); self } + ///Set the value of the statements field. pub fn statements(mut self, statements: LinkTokenCreateRequestStatements) -> Self { self.params.statements = Some(statements); self } + ///Set the value of the transactions field. pub fn transactions(mut self, transactions: LinkTokenTransactions) -> Self { self.params.transactions = Some(transactions); self } + ///Set the value of the transfer field. pub fn transfer(mut self, transfer: LinkTokenCreateRequestTransfer) -> Self { self.params.transfer = Some(transfer); self } + ///Set the value of the update field. pub fn update(mut self, update: LinkTokenCreateRequestUpdate) -> Self { self.params.update = Some(update); self } + ///Set the value of the user_token field. pub fn user_token(mut self, user_token: &str) -> Self { self.params.user_token = Some(user_token.to_owned()); self } + ///Set the value of the webhook field. pub fn webhook(mut self, webhook: &str) -> Self { self.params.webhook = Some(webhook.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, LinkTokenCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/link/token/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.access_token { - r = r.json(json!({ "access_token" : unwrapped })); + r = r.json(serde_json::json!({ "access_token" : unwrapped })); } if let Some(ref unwrapped) = self.params.access_tokens { - r = r.json(json!({ "access_tokens" : unwrapped })); + r = r.json(serde_json::json!({ "access_tokens" : unwrapped })); } if let Some(ref unwrapped) = self.params.account_filters { - r = r.json(json!({ "account_filters" : unwrapped })); + r = r.json(serde_json::json!({ "account_filters" : unwrapped })); } if let Some(ref unwrapped) = self.params.additional_consented_products { - r = r.json(json!({ "additional_consented_products" : unwrapped })); + r = r + .json( + serde_json::json!( + { "additional_consented_products" : unwrapped } + ), + ); } if let Some(ref unwrapped) = self.params.android_package_name { - r = r.json(json!({ "android_package_name" : unwrapped })); + r = r.json(serde_json::json!({ "android_package_name" : unwrapped })); } if let Some(ref unwrapped) = self.params.auth { - r = r.json(json!({ "auth" : unwrapped })); + r = r.json(serde_json::json!({ "auth" : unwrapped })); } if let Some(ref unwrapped) = self.params.base_report { - r = r.json(json!({ "base_report" : unwrapped })); + r = r.json(serde_json::json!({ "base_report" : unwrapped })); } if let Some(ref unwrapped) = self.params.card_switch { - r = r.json(json!({ "card_switch" : unwrapped })); + r = r.json(serde_json::json!({ "card_switch" : unwrapped })); } - r = r.json(json!({ "client_name" : self.params.client_name })); + r = r.json(serde_json::json!({ "client_name" : self.params.client_name })); if let Some(ref unwrapped) = self.params.consumer_report_permissible_purpose { - r = r.json(json!({ "consumer_report_permissible_purpose" : unwrapped })); - } - r = r.json(json!({ "country_codes" : self.params.country_codes })); + r = r + .json( + serde_json::json!( + { "consumer_report_permissible_purpose" : unwrapped } + ), + ); + } + r = r + .json( + serde_json::json!({ "country_codes" : self.params.country_codes }), + ); if let Some(ref unwrapped) = self.params.cra_enabled { - r = r.json(json!({ "cra_enabled" : unwrapped })); + r = r.json(serde_json::json!({ "cra_enabled" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.cra_options { + r = r.json(serde_json::json!({ "cra_options" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.credit_partner_insights { + r = r.json(serde_json::json!({ "credit_partner_insights" : unwrapped })); } if let Some(ref unwrapped) = self.params.deposit_switch { - r = r.json(json!({ "deposit_switch" : unwrapped })); + r = r.json(serde_json::json!({ "deposit_switch" : unwrapped })); } if let Some(ref unwrapped) = self.params.employment { - r = r.json(json!({ "employment" : unwrapped })); + r = r.json(serde_json::json!({ "employment" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.enable_multi_item_link { + r = r.json(serde_json::json!({ "enable_multi_item_link" : unwrapped })); } if let Some(ref unwrapped) = self.params.eu_config { - r = r.json(json!({ "eu_config" : unwrapped })); + r = r.json(serde_json::json!({ "eu_config" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.financekit_supported { + r = r.json(serde_json::json!({ "financekit_supported" : unwrapped })); } if let Some(ref unwrapped) = self.params.hosted_link { - r = r.json(json!({ "hosted_link" : unwrapped })); + r = r.json(serde_json::json!({ "hosted_link" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.identity { + r = r.json(serde_json::json!({ "identity" : unwrapped })); } if let Some(ref unwrapped) = self.params.identity_verification { - r = r.json(json!({ "identity_verification" : unwrapped })); + r = r.json(serde_json::json!({ "identity_verification" : unwrapped })); } if let Some(ref unwrapped) = self.params.income_verification { - r = r.json(json!({ "income_verification" : unwrapped })); + r = r.json(serde_json::json!({ "income_verification" : unwrapped })); } if let Some(ref unwrapped) = self.params.institution_data { - r = r.json(json!({ "institution_data" : unwrapped })); + r = r.json(serde_json::json!({ "institution_data" : unwrapped })); } if let Some(ref unwrapped) = self.params.institution_id { - r = r.json(json!({ "institution_id" : unwrapped })); + r = r.json(serde_json::json!({ "institution_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.investments { - r = r.json(json!({ "investments" : unwrapped })); + r = r.json(serde_json::json!({ "investments" : unwrapped })); } if let Some(ref unwrapped) = self.params.investments_auth { - r = r.json(json!({ "investments_auth" : unwrapped })); + r = r.json(serde_json::json!({ "investments_auth" : unwrapped })); } - r = r.json(json!({ "language" : self.params.language })); + r = r.json(serde_json::json!({ "language" : self.params.language })); if let Some(ref unwrapped) = self.params.link_customization_name { - r = r.json(json!({ "link_customization_name" : unwrapped })); + r = r.json(serde_json::json!({ "link_customization_name" : unwrapped })); } if let Some(ref unwrapped) = self.params.optional_products { - r = r.json(json!({ "optional_products" : unwrapped })); + r = r.json(serde_json::json!({ "optional_products" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.payment_configuration { + r = r.json(serde_json::json!({ "payment_configuration" : unwrapped })); } if let Some(ref unwrapped) = self.params.payment_initiation { - r = r.json(json!({ "payment_initiation" : unwrapped })); + r = r.json(serde_json::json!({ "payment_initiation" : unwrapped })); } if let Some(ref unwrapped) = self.params.products { - r = r.json(json!({ "products" : unwrapped })); + r = r.json(serde_json::json!({ "products" : unwrapped })); } if let Some(ref unwrapped) = self.params.redirect_uri { - r = r.json(json!({ "redirect_uri" : unwrapped })); + r = r.json(serde_json::json!({ "redirect_uri" : unwrapped })); } if let Some(ref unwrapped) = self.params.required_if_supported_products { - r = r.json(json!({ "required_if_supported_products" : unwrapped })); + r = r + .json( + serde_json::json!( + { "required_if_supported_products" : unwrapped } + ), + ); } if let Some(ref unwrapped) = self.params.statements { - r = r.json(json!({ "statements" : unwrapped })); + r = r.json(serde_json::json!({ "statements" : unwrapped })); } if let Some(ref unwrapped) = self.params.transactions { - r = r.json(json!({ "transactions" : unwrapped })); + r = r.json(serde_json::json!({ "transactions" : unwrapped })); } if let Some(ref unwrapped) = self.params.transfer { - r = r.json(json!({ "transfer" : unwrapped })); + r = r.json(serde_json::json!({ "transfer" : unwrapped })); } if let Some(ref unwrapped) = self.params.update { - r = r.json(json!({ "update" : unwrapped })); + r = r.json(serde_json::json!({ "update" : unwrapped })); } - r = r.json(json!({ "user" : self.params.user })); + r = r.json(serde_json::json!({ "user" : self.params.user })); if let Some(ref unwrapped) = self.params.user_token { - r = r.json(json!({ "user_token" : unwrapped })); + r = r.json(serde_json::json!({ "user_token" : unwrapped })); } if let Some(ref unwrapped) = self.params.webhook { - r = r.json(json!({ "webhook" : unwrapped })); + r = r.json(serde_json::json!({ "webhook" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create Link Token + +The `/link/token/create` endpoint creates a `link_token`, which is required as a parameter when initializing Link. Once Link has been initialized, it returns a `public_token`. For most Plaid products, the `public_token` is saved and exchanged for an `access_token` via `/item/public_token/exchange` as part of the main Link flow. For more details, see the [Link flow overview](https://plaid.com/docs/link/#link-flow-overview). + +A `link_token` generated by `/link/token/create` is also used to initialize other Link flows, such as the [update mode](https://plaid.com/docs/link/update-mode) flow for tokens with expired credentials, or the Identity Verification flow. + +See endpoint docs at .*/ + pub fn link_token_create( + &self, + args: LinkTokenCreateRequired, + ) -> FluentRequest<'_, LinkTokenCreateRequest> { + FluentRequest { + client: self, + params: LinkTokenCreateRequest { + access_token: None, + access_tokens: None, + account_filters: None, + additional_consented_products: None, + android_package_name: None, + auth: None, + base_report: None, + card_switch: None, + client_name: args.client_name.to_owned(), + consumer_report_permissible_purpose: None, + country_codes: args.country_codes, + cra_enabled: None, + cra_options: None, + credit_partner_insights: None, + deposit_switch: None, + employment: None, + enable_multi_item_link: None, + eu_config: None, + financekit_supported: None, + hosted_link: None, + identity: None, + identity_verification: None, + income_verification: None, + institution_data: None, + institution_id: None, + investments: None, + investments_auth: None, + language: args.language.to_owned(), + link_customization_name: None, + optional_products: None, + payment_configuration: None, + payment_initiation: None, + products: None, + redirect_uri: None, + required_if_supported_products: None, + statements: None, + transactions: None, + transfer: None, + update: None, + user: args.user, + user_token: None, + webhook: None, + }, + } + } +} diff --git a/src/request/link_token_get.rs b/src/request/link_token_get.rs index ffe885fb..43252b26 100644 --- a/src/request/link_token_get.rs +++ b/src/request/link_token_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::link_token_get`]. On request success, this will return a [`LinkTokenGetResponse`].*/ @@ -11,19 +8,36 @@ On request success, this will return a [`LinkTokenGetResponse`].*/ pub struct LinkTokenGetRequest { pub link_token: String, } -impl LinkTokenGetRequest {} impl FluentRequest<'_, LinkTokenGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, LinkTokenGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/link/token/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "link_token" : self.params.link_token })); + r = r.json(serde_json::json!({ "link_token" : self.params.link_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get Link Token + +The `/link/token/get` endpoint gets information about a Link session, including all callbacks fired during the session along with their metadata, including the public token. This endpoint is used with Link flows that don't provide a public token via frontend callbacks, such as the [Hosted Link flow](https://plaid.com/docs/link/hosted-link/) and the [Multi-Item Link flow](https://plaid.com/docs/link/multi-item-link/). It also can be useful for debugging purposes. + +See endpoint docs at .*/ + pub fn link_token_get( + &self, + link_token: &str, + ) -> FluentRequest<'_, LinkTokenGetRequest> { + FluentRequest { + client: self, + params: LinkTokenGetRequest { + link_token: link_token.to_owned(), + }, + } + } +} diff --git a/src/request.rs b/src/request/mod.rs similarity index 82% rename from src/request.rs rename to src/request/mod.rs index b6498615..f85fcbe7 100644 --- a/src/request.rs +++ b/src/request/mod.rs @@ -1,520 +1,584 @@ pub mod asset_report_create; +pub use asset_report_create::AssetReportCreateRequest; pub mod asset_report_get; +pub use asset_report_get::AssetReportGetRequest; pub mod asset_report_pdf_get; +pub use asset_report_pdf_get::AssetReportPdfGetRequest; pub mod asset_report_refresh; +pub use asset_report_refresh::AssetReportRefreshRequest; pub mod asset_report_filter; +pub use asset_report_filter::AssetReportFilterRequest; pub mod asset_report_remove; +pub use asset_report_remove::AssetReportRemoveRequest; pub mod asset_report_audit_copy_create; +pub use asset_report_audit_copy_create::AssetReportAuditCopyCreateRequest; pub mod asset_report_audit_copy_get; +pub use asset_report_audit_copy_get::AssetReportAuditCopyGetRequest; pub mod asset_report_audit_copy_remove; -pub mod base_report_get; +pub use asset_report_audit_copy_remove::AssetReportAuditCopyRemoveRequest; +pub mod cra_base_report_get; +pub use cra_base_report_get::CraBaseReportGetRequest; +pub mod cra_base_report_create; +pub use cra_base_report_create::CraBaseReportCreateRequest; +pub mod cra_monitoring_insights_subscribe; +pub use cra_monitoring_insights_subscribe::CraMonitoringInsightsSubscribeRequest; +pub mod cra_monitoring_insights_unsubscribe; +pub use cra_monitoring_insights_unsubscribe::CraMonitoringInsightsUnsubscribeRequest; +pub mod cra_monitoring_insights_get; +pub use cra_monitoring_insights_get::CraMonitoringInsightsGetRequest; pub mod credit_audit_copy_token_update; +pub use credit_audit_copy_token_update::CreditAuditCopyTokenUpdateRequest; pub mod cra_bank_income_get; +pub use cra_bank_income_get::CraBankIncomeGetRequest; +pub mod cra_bank_income_create; +pub use cra_bank_income_create::CraBankIncomeCreateRequest; +pub mod cra_partner_insights_get; +pub use cra_partner_insights_get::CraPartnerInsightsGetRequest; +pub mod cra_check_report_income_insights_get; +pub use cra_check_report_income_insights_get::CraCheckReportIncomeInsightsGetRequest; +pub mod cra_check_report_base_report_get; +pub use cra_check_report_base_report_get::CraCheckReportBaseReportGetRequest; +pub mod cra_check_report_pdf_get; +pub use cra_check_report_pdf_get::CraCheckReportPdfGetRequest; +pub mod cra_check_report_create; +pub use cra_check_report_create::CraCheckReportCreateRequest; +pub mod cra_check_report_partner_insights_get; +pub use cra_check_report_partner_insights_get::CraCheckReportPartnerInsightsGetRequest; +pub mod cra_check_report_network_insights_get; +pub use cra_check_report_network_insights_get::CraCheckReportNetworkInsightsGetRequest; +pub mod cra_loans_applications_register; +pub use cra_loans_applications_register::CraLoansApplicationsRegisterRequest; +pub mod cra_loans_register; +pub use cra_loans_register::CraLoansRegisterRequest; +pub mod cra_loans_update; +pub use cra_loans_update::CraLoansUpdateRequest; +pub mod cra_loans_unregister; +pub use cra_loans_unregister::CraLoansUnregisterRequest; +pub mod consumer_report_pdf_get; +pub use consumer_report_pdf_get::ConsumerReportPdfGetRequest; pub mod statements_list; +pub use statements_list::StatementsListRequest; pub mod statements_download; +pub use statements_download::StatementsDownloadRequest; pub mod statements_refresh; +pub use statements_refresh::StatementsRefreshRequest; +pub mod consent_events_get; +pub use consent_events_get::ConsentEventsGetRequest; pub mod item_activity_list; +pub use item_activity_list::ItemActivityListRequest; pub mod item_application_list; +pub use item_application_list::ItemApplicationListRequest; pub mod item_application_unlink; +pub use item_application_unlink::ItemApplicationUnlinkRequest; pub mod item_application_scopes_update; +pub use item_application_scopes_update::ItemApplicationScopesUpdateRequest; pub mod application_get; +pub use application_get::ApplicationGetRequest; pub mod item_get; +pub use item_get::ItemGetRequest; +pub mod user_account_session_get; +pub use user_account_session_get::UserAccountSessionGetRequest; +pub mod profile_get; +pub use profile_get::ProfileGetRequest; +pub mod profile_network_status_get; +pub use profile_network_status_get::ProfileNetworkStatusGetRequest; pub mod auth_get; +pub use auth_get::AuthGetRequest; pub mod transactions_get; +pub use transactions_get::TransactionsGetRequest; pub mod transactions_refresh; +pub use transactions_refresh::TransactionsRefreshRequest; pub mod transactions_recurring_get; +pub use transactions_recurring_get::TransactionsRecurringGetRequest; pub mod transactions_sync; +pub use transactions_sync::TransactionsSyncRequest; pub mod transactions_enrich; +pub use transactions_enrich::TransactionsEnrichRequest; pub mod institutions_get; +pub use institutions_get::InstitutionsGetRequest; pub mod institutions_search; +pub use institutions_search::InstitutionsSearchRequest; pub mod institutions_get_by_id; +pub use institutions_get_by_id::InstitutionsGetByIdRequest; pub mod item_remove; +pub use item_remove::ItemRemoveRequest; pub mod accounts_get; +pub use accounts_get::AccountsGetRequest; pub mod categories_get; +pub use categories_get::CategoriesGetRequest; pub mod sandbox_processor_token_create; +pub use sandbox_processor_token_create::SandboxProcessorTokenCreateRequest; pub mod sandbox_public_token_create; +pub use sandbox_public_token_create::SandboxPublicTokenCreateRequest; pub mod sandbox_item_fire_webhook; +pub use sandbox_item_fire_webhook::SandboxItemFireWebhookRequest; pub mod accounts_balance_get; +pub use accounts_balance_get::AccountsBalanceGetRequest; pub mod identity_get; +pub use identity_get::IdentityGetRequest; +pub mod identity_documents_uploads_get; +pub use identity_documents_uploads_get::IdentityDocumentsUploadsGetRequest; pub mod identity_match; +pub use identity_match::IdentityMatchRequest; pub mod identity_refresh; +pub use identity_refresh::IdentityRefreshRequest; pub mod dashboard_user_get; +pub use dashboard_user_get::DashboardUserGetRequest; pub mod dashboard_user_list; +pub use dashboard_user_list::DashboardUserListRequest; pub mod identity_verification_create; +pub use identity_verification_create::IdentityVerificationCreateRequest; pub mod identity_verification_get; +pub use identity_verification_get::IdentityVerificationGetRequest; pub mod identity_verification_list; +pub use identity_verification_list::IdentityVerificationListRequest; pub mod identity_verification_retry; +pub use identity_verification_retry::IdentityVerificationRetryRequest; pub mod watchlist_screening_entity_create; +pub use watchlist_screening_entity_create::WatchlistScreeningEntityCreateRequest; pub mod watchlist_screening_entity_get; +pub use watchlist_screening_entity_get::WatchlistScreeningEntityGetRequest; pub mod watchlist_screening_entity_history_list; +pub use watchlist_screening_entity_history_list::WatchlistScreeningEntityHistoryListRequest; pub mod watchlist_screening_entity_hit_list; +pub use watchlist_screening_entity_hit_list::WatchlistScreeningEntityHitListRequest; pub mod watchlist_screening_entity_list; +pub use watchlist_screening_entity_list::WatchlistScreeningEntityListRequest; pub mod watchlist_screening_entity_program_get; +pub use watchlist_screening_entity_program_get::WatchlistScreeningEntityProgramGetRequest; pub mod watchlist_screening_entity_program_list; +pub use watchlist_screening_entity_program_list::WatchlistScreeningEntityProgramListRequest; pub mod watchlist_screening_entity_review_create; +pub use watchlist_screening_entity_review_create::WatchlistScreeningEntityReviewCreateRequest; pub mod watchlist_screening_entity_review_list; +pub use watchlist_screening_entity_review_list::WatchlistScreeningEntityReviewListRequest; pub mod watchlist_screening_entity_update; +pub use watchlist_screening_entity_update::WatchlistScreeningEntityUpdateRequest; pub mod watchlist_screening_individual_create; +pub use watchlist_screening_individual_create::WatchlistScreeningIndividualCreateRequest; pub mod watchlist_screening_individual_get; +pub use watchlist_screening_individual_get::WatchlistScreeningIndividualGetRequest; pub mod watchlist_screening_individual_history_list; +pub use watchlist_screening_individual_history_list::WatchlistScreeningIndividualHistoryListRequest; pub mod watchlist_screening_individual_hit_list; +pub use watchlist_screening_individual_hit_list::WatchlistScreeningIndividualHitListRequest; pub mod watchlist_screening_individual_list; +pub use watchlist_screening_individual_list::WatchlistScreeningIndividualListRequest; pub mod watchlist_screening_individual_program_get; +pub use watchlist_screening_individual_program_get::WatchlistScreeningIndividualProgramGetRequest; pub mod watchlist_screening_individual_program_list; +pub use watchlist_screening_individual_program_list::WatchlistScreeningIndividualProgramListRequest; pub mod watchlist_screening_individual_review_create; +pub use watchlist_screening_individual_review_create::WatchlistScreeningIndividualReviewCreateRequest; pub mod watchlist_screening_individual_review_list; +pub use watchlist_screening_individual_review_list::WatchlistScreeningIndividualReviewListRequest; pub mod watchlist_screening_individual_update; +pub use watchlist_screening_individual_update::WatchlistScreeningIndividualUpdateRequest; +pub mod beacon_account_risk_evaluate; +pub use beacon_account_risk_evaluate::BeaconAccountRiskEvaluateRequest; pub mod beacon_user_create; +pub use beacon_user_create::BeaconUserCreateRequest; pub mod beacon_user_get; +pub use beacon_user_get::BeaconUserGetRequest; pub mod beacon_user_review; +pub use beacon_user_review::BeaconUserReviewRequest; pub mod beacon_report_create; +pub use beacon_report_create::BeaconReportCreateRequest; pub mod beacon_report_list; +pub use beacon_report_list::BeaconReportListRequest; pub mod beacon_report_syndication_list; +pub use beacon_report_syndication_list::BeaconReportSyndicationListRequest; pub mod beacon_report_get; +pub use beacon_report_get::BeaconReportGetRequest; pub mod beacon_report_syndication_get; +pub use beacon_report_syndication_get::BeaconReportSyndicationGetRequest; pub mod beacon_user_update; +pub use beacon_user_update::BeaconUserUpdateRequest; pub mod beacon_duplicate_get; +pub use beacon_duplicate_get::BeaconDuplicateGetRequest; pub mod identity_verification_autofill_create; +pub use identity_verification_autofill_create::IdentityVerificationAutofillCreateRequest; +pub mod beacon_user_history_list; +pub use beacon_user_history_list::BeaconUserHistoryListRequest; +pub mod beacon_user_account_insights_get; +pub use beacon_user_account_insights_get::BeaconUserAccountInsightsGetRequest; pub mod processor_auth_get; +pub use processor_auth_get::ProcessorAuthGetRequest; pub mod processor_account_get; +pub use processor_account_get::ProcessorAccountGetRequest; pub mod processor_transactions_get; +pub use processor_transactions_get::ProcessorTransactionsGetRequest; pub mod processor_transactions_sync; +pub use processor_transactions_sync::ProcessorTransactionsSyncRequest; pub mod processor_transactions_refresh; +pub use processor_transactions_refresh::ProcessorTransactionsRefreshRequest; pub mod processor_transactions_recurring_get; +pub use processor_transactions_recurring_get::ProcessorTransactionsRecurringGetRequest; pub mod processor_signal_evaluate; +pub use processor_signal_evaluate::ProcessorSignalEvaluateRequest; pub mod processor_signal_decision_report; +pub use processor_signal_decision_report::ProcessorSignalDecisionReportRequest; pub mod processor_signal_return_report; +pub use processor_signal_return_report::ProcessorSignalReturnReportRequest; pub mod processor_signal_prepare; +pub use processor_signal_prepare::ProcessorSignalPrepareRequest; pub mod processor_bank_transfer_create; +pub use processor_bank_transfer_create::ProcessorBankTransferCreateRequest; pub mod processor_liabilities_get; +pub use processor_liabilities_get::ProcessorLiabilitiesGetRequest; pub mod processor_identity_get; +pub use processor_identity_get::ProcessorIdentityGetRequest; pub mod processor_identity_match; +pub use processor_identity_match::ProcessorIdentityMatchRequest; pub mod processor_balance_get; +pub use processor_balance_get::ProcessorBalanceGetRequest; pub mod item_webhook_update; +pub use item_webhook_update::ItemWebhookUpdateRequest; pub mod item_access_token_invalidate; +pub use item_access_token_invalidate::ItemAccessTokenInvalidateRequest; pub mod webhook_verification_key_get; +pub use webhook_verification_key_get::WebhookVerificationKeyGetRequest; pub mod liabilities_get; +pub use liabilities_get::LiabilitiesGetRequest; pub mod payment_initiation_recipient_create; +pub use payment_initiation_recipient_create::PaymentInitiationRecipientCreateRequest; pub mod payment_initiation_payment_reverse; +pub use payment_initiation_payment_reverse::PaymentInitiationPaymentReverseRequest; pub mod payment_initiation_recipient_get; +pub use payment_initiation_recipient_get::PaymentInitiationRecipientGetRequest; pub mod payment_initiation_recipient_list; +pub use payment_initiation_recipient_list::PaymentInitiationRecipientListRequest; pub mod payment_initiation_payment_create; +pub use payment_initiation_payment_create::PaymentInitiationPaymentCreateRequest; pub mod create_payment_token; +pub use create_payment_token::CreatePaymentTokenRequest; pub mod payment_initiation_consent_create; +pub use payment_initiation_consent_create::PaymentInitiationConsentCreateRequest; pub mod payment_initiation_consent_get; +pub use payment_initiation_consent_get::PaymentInitiationConsentGetRequest; pub mod payment_initiation_consent_revoke; +pub use payment_initiation_consent_revoke::PaymentInitiationConsentRevokeRequest; pub mod payment_initiation_consent_payment_execute; +pub use payment_initiation_consent_payment_execute::PaymentInitiationConsentPaymentExecuteRequest; pub mod sandbox_item_reset_login; +pub use sandbox_item_reset_login::SandboxItemResetLoginRequest; pub mod sandbox_item_set_verification_status; +pub use sandbox_item_set_verification_status::SandboxItemSetVerificationStatusRequest; +pub mod sandbox_user_reset_login; +pub use sandbox_user_reset_login::SandboxUserResetLoginRequest; pub mod item_public_token_exchange; +pub use item_public_token_exchange::ItemPublicTokenExchangeRequest; pub mod item_create_public_token; +pub use item_create_public_token::ItemCreatePublicTokenRequest; pub mod user_create; +pub use user_create::UserCreateRequest; pub mod user_update; +pub use user_update::UserUpdateRequest; +pub mod user_remove; +pub use user_remove::UserRemoveRequest; +pub mod user_items_get; +pub use user_items_get::UserItemsGetRequest; +pub mod user_third_party_token_create; +pub use user_third_party_token_create::UserThirdPartyTokenCreateRequest; +pub mod user_third_party_token_remove; +pub use user_third_party_token_remove::UserThirdPartyTokenRemoveRequest; pub mod credit_sessions_get; +pub use credit_sessions_get::CreditSessionsGetRequest; pub mod payment_initiation_payment_get; +pub use payment_initiation_payment_get::PaymentInitiationPaymentGetRequest; pub mod payment_initiation_payment_list; +pub use payment_initiation_payment_list::PaymentInitiationPaymentListRequest; pub mod investments_holdings_get; +pub use investments_holdings_get::InvestmentsHoldingsGetRequest; pub mod investments_transactions_get; +pub use investments_transactions_get::InvestmentsTransactionsGetRequest; pub mod investments_refresh; +pub use investments_refresh::InvestmentsRefreshRequest; pub mod investments_auth_get; +pub use investments_auth_get::InvestmentsAuthGetRequest; pub mod processor_token_create; +pub use processor_token_create::ProcessorTokenCreateRequest; pub mod processor_token_permissions_set; +pub use processor_token_permissions_set::ProcessorTokenPermissionsSetRequest; pub mod processor_token_permissions_get; +pub use processor_token_permissions_get::ProcessorTokenPermissionsGetRequest; pub mod processor_token_webhook_update; +pub use processor_token_webhook_update::ProcessorTokenWebhookUpdateRequest; pub mod processor_stripe_bank_account_token_create; +pub use processor_stripe_bank_account_token_create::ProcessorStripeBankAccountTokenCreateRequest; pub mod processor_apex_processor_token_create; +pub use processor_apex_processor_token_create::ProcessorApexProcessorTokenCreateRequest; pub mod deposit_switch_create; +pub use deposit_switch_create::DepositSwitchCreateRequest; pub mod item_import; +pub use item_import::ItemImportRequest; pub mod deposit_switch_token_create; +pub use deposit_switch_token_create::DepositSwitchTokenCreateRequest; +pub mod link_profile_eligibility_check; +pub use link_profile_eligibility_check::LinkProfileEligibilityCheckRequest; pub mod link_token_create; +pub use link_token_create::LinkTokenCreateRequest; pub mod link_token_get; +pub use link_token_get::LinkTokenGetRequest; pub mod link_oauth_correlation_id_exchange; +pub use link_oauth_correlation_id_exchange::LinkOauthCorrelationIdExchangeRequest; pub mod deposit_switch_get; +pub use deposit_switch_get::DepositSwitchGetRequest; pub mod transfer_get; +pub use transfer_get::TransferGetRequest; pub mod transfer_recurring_get; +pub use transfer_recurring_get::TransferRecurringGetRequest; pub mod bank_transfer_get; +pub use bank_transfer_get::BankTransferGetRequest; pub mod transfer_authorization_create; +pub use transfer_authorization_create::TransferAuthorizationCreateRequest; +pub mod transfer_authorization_cancel; +pub use transfer_authorization_cancel::TransferAuthorizationCancelRequest; pub mod transfer_balance_get; +pub use transfer_balance_get::TransferBalanceGetRequest; pub mod transfer_capabilities_get; +pub use transfer_capabilities_get::TransferCapabilitiesGetRequest; pub mod transfer_configuration_get; +pub use transfer_configuration_get::TransferConfigurationGetRequest; pub mod transfer_ledger_get; +pub use transfer_ledger_get::TransferLedgerGetRequest; pub mod transfer_ledger_distribute; +pub use transfer_ledger_distribute::TransferLedgerDistributeRequest; pub mod transfer_ledger_deposit; +pub use transfer_ledger_deposit::TransferLedgerDepositRequest; pub mod transfer_ledger_withdraw; +pub use transfer_ledger_withdraw::TransferLedgerWithdrawRequest; pub mod transfer_originator_funding_account_update; +pub use transfer_originator_funding_account_update::TransferOriginatorFundingAccountUpdateRequest; pub mod transfer_metrics_get; +pub use transfer_metrics_get::TransferMetricsGetRequest; pub mod transfer_create; +pub use transfer_create::TransferCreateRequest; pub mod transfer_recurring_create; +pub use transfer_recurring_create::TransferRecurringCreateRequest; pub mod bank_transfer_create; +pub use bank_transfer_create::BankTransferCreateRequest; pub mod transfer_list; +pub use transfer_list::TransferListRequest; pub mod transfer_recurring_list; +pub use transfer_recurring_list::TransferRecurringListRequest; pub mod bank_transfer_list; +pub use bank_transfer_list::BankTransferListRequest; pub mod transfer_cancel; +pub use transfer_cancel::TransferCancelRequest; pub mod transfer_recurring_cancel; +pub use transfer_recurring_cancel::TransferRecurringCancelRequest; pub mod bank_transfer_cancel; +pub use bank_transfer_cancel::BankTransferCancelRequest; pub mod transfer_event_list; +pub use transfer_event_list::TransferEventListRequest; pub mod bank_transfer_event_list; +pub use bank_transfer_event_list::BankTransferEventListRequest; pub mod transfer_event_sync; +pub use transfer_event_sync::TransferEventSyncRequest; pub mod bank_transfer_event_sync; +pub use bank_transfer_event_sync::BankTransferEventSyncRequest; pub mod transfer_sweep_get; +pub use transfer_sweep_get::TransferSweepGetRequest; pub mod bank_transfer_sweep_get; +pub use bank_transfer_sweep_get::BankTransferSweepGetRequest; pub mod transfer_sweep_list; +pub use transfer_sweep_list::TransferSweepListRequest; pub mod bank_transfer_sweep_list; +pub use bank_transfer_sweep_list::BankTransferSweepListRequest; pub mod bank_transfer_balance_get; +pub use bank_transfer_balance_get::BankTransferBalanceGetRequest; pub mod bank_transfer_migrate_account; +pub use bank_transfer_migrate_account::BankTransferMigrateAccountRequest; pub mod transfer_migrate_account; +pub use transfer_migrate_account::TransferMigrateAccountRequest; pub mod transfer_intent_create; +pub use transfer_intent_create::TransferIntentCreateRequest; pub mod transfer_intent_get; +pub use transfer_intent_get::TransferIntentGetRequest; pub mod transfer_repayment_list; +pub use transfer_repayment_list::TransferRepaymentListRequest; pub mod transfer_repayment_return_list; +pub use transfer_repayment_return_list::TransferRepaymentReturnListRequest; +pub mod transfer_platform_requirement_submit; +pub use transfer_platform_requirement_submit::TransferPlatformRequirementSubmitRequest; pub mod transfer_originator_create; +pub use transfer_originator_create::TransferOriginatorCreateRequest; pub mod transfer_questionnaire_create; +pub use transfer_questionnaire_create::TransferQuestionnaireCreateRequest; pub mod transfer_diligence_submit; +pub use transfer_diligence_submit::TransferDiligenceSubmitRequest; pub mod transfer_diligence_document_upload; +pub use transfer_diligence_document_upload::TransferDiligenceDocumentUploadRequest; pub mod transfer_originator_get; +pub use transfer_originator_get::TransferOriginatorGetRequest; pub mod transfer_originator_list; +pub use transfer_originator_list::TransferOriginatorListRequest; pub mod transfer_refund_create; +pub use transfer_refund_create::TransferRefundCreateRequest; pub mod transfer_refund_get; +pub use transfer_refund_get::TransferRefundGetRequest; pub mod transfer_refund_cancel; +pub use transfer_refund_cancel::TransferRefundCancelRequest; +pub mod transfer_platform_originator_create; +pub use transfer_platform_originator_create::TransferPlatformOriginatorCreateRequest; +pub mod transfer_platform_person_create; +pub use transfer_platform_person_create::TransferPlatformPersonCreateRequest; pub mod sandbox_bank_transfer_simulate; +pub use sandbox_bank_transfer_simulate::SandboxBankTransferSimulateRequest; pub mod sandbox_transfer_sweep_simulate; +pub use sandbox_transfer_sweep_simulate::SandboxTransferSweepSimulateRequest; pub mod sandbox_transfer_simulate; +pub use sandbox_transfer_simulate::SandboxTransferSimulateRequest; pub mod sandbox_transfer_refund_simulate; +pub use sandbox_transfer_refund_simulate::SandboxTransferRefundSimulateRequest; pub mod sandbox_transfer_ledger_simulate_available; +pub use sandbox_transfer_ledger_simulate_available::SandboxTransferLedgerSimulateAvailableRequest; pub mod sandbox_transfer_ledger_deposit_simulate; +pub use sandbox_transfer_ledger_deposit_simulate::SandboxTransferLedgerDepositSimulateRequest; pub mod sandbox_transfer_ledger_withdraw_simulate; +pub use sandbox_transfer_ledger_withdraw_simulate::SandboxTransferLedgerWithdrawSimulateRequest; pub mod sandbox_transfer_repayment_simulate; +pub use sandbox_transfer_repayment_simulate::SandboxTransferRepaymentSimulateRequest; pub mod sandbox_transfer_fire_webhook; +pub use sandbox_transfer_fire_webhook::SandboxTransferFireWebhookRequest; pub mod sandbox_transfer_test_clock_create; +pub use sandbox_transfer_test_clock_create::SandboxTransferTestClockCreateRequest; pub mod sandbox_transfer_test_clock_advance; +pub use sandbox_transfer_test_clock_advance::SandboxTransferTestClockAdvanceRequest; pub mod sandbox_transfer_test_clock_get; +pub use sandbox_transfer_test_clock_get::SandboxTransferTestClockGetRequest; pub mod sandbox_transfer_test_clock_list; +pub use sandbox_transfer_test_clock_list::SandboxTransferTestClockListRequest; pub mod sandbox_payment_profile_reset_login; +pub use sandbox_payment_profile_reset_login::SandboxPaymentProfileResetLoginRequest; pub mod employers_search; +pub use employers_search::EmployersSearchRequest; pub mod income_verification_create; +pub use income_verification_create::IncomeVerificationCreateRequest; pub mod income_verification_paystubs_get; +pub use income_verification_paystubs_get::IncomeVerificationPaystubsGetRequest; pub mod income_verification_documents_download; +pub use income_verification_documents_download::IncomeVerificationDocumentsDownloadRequest; pub mod income_verification_taxforms_get; +pub use income_verification_taxforms_get::IncomeVerificationTaxformsGetRequest; pub mod income_verification_precheck; +pub use income_verification_precheck::IncomeVerificationPrecheckRequest; pub mod employment_verification_get; +pub use employment_verification_get::EmploymentVerificationGetRequest; pub mod deposit_switch_alt_create; +pub use deposit_switch_alt_create::DepositSwitchAltCreateRequest; pub mod credit_audit_copy_token_create; +pub use credit_audit_copy_token_create::CreditAuditCopyTokenCreateRequest; pub mod credit_report_audit_copy_remove; +pub use credit_report_audit_copy_remove::CreditReportAuditCopyRemoveRequest; pub mod credit_asset_report_freddie_mac_get; +pub use credit_asset_report_freddie_mac_get::CreditAssetReportFreddieMacGetRequest; pub mod credit_freddie_mac_reports_get; +pub use credit_freddie_mac_reports_get::CreditFreddieMacReportsGetRequest; pub mod credit_bank_employment_get; +pub use credit_bank_employment_get::CreditBankEmploymentGetRequest; pub mod credit_bank_income_get; +pub use credit_bank_income_get::CreditBankIncomeGetRequest; pub mod credit_bank_income_pdf_get; +pub use credit_bank_income_pdf_get::CreditBankIncomePdfGetRequest; pub mod credit_bank_income_refresh; +pub use credit_bank_income_refresh::CreditBankIncomeRefreshRequest; pub mod credit_bank_income_webhook_update; +pub use credit_bank_income_webhook_update::CreditBankIncomeWebhookUpdateRequest; pub mod credit_payroll_income_parsing_config_update; +pub use credit_payroll_income_parsing_config_update::CreditPayrollIncomeParsingConfigUpdateRequest; pub mod credit_bank_statements_uploads_get; +pub use credit_bank_statements_uploads_get::CreditBankStatementsUploadsGetRequest; pub mod credit_payroll_income_get; +pub use credit_payroll_income_get::CreditPayrollIncomeGetRequest; pub mod credit_payroll_income_risk_signals_get; +pub use credit_payroll_income_risk_signals_get::CreditPayrollIncomeRiskSignalsGetRequest; pub mod credit_payroll_income_precheck; +pub use credit_payroll_income_precheck::CreditPayrollIncomePrecheckRequest; pub mod credit_employment_get; +pub use credit_employment_get::CreditEmploymentGetRequest; pub mod credit_payroll_income_refresh; +pub use credit_payroll_income_refresh::CreditPayrollIncomeRefreshRequest; pub mod credit_relay_create; +pub use credit_relay_create::CreditRelayCreateRequest; pub mod credit_relay_get; +pub use credit_relay_get::CreditRelayGetRequest; pub mod credit_relay_pdf_get; +pub use credit_relay_pdf_get::CreditRelayPdfGetRequest; pub mod credit_relay_refresh; +pub use credit_relay_refresh::CreditRelayRefreshRequest; pub mod credit_relay_remove; +pub use credit_relay_remove::CreditRelayRemoveRequest; pub mod sandbox_bank_transfer_fire_webhook; +pub use sandbox_bank_transfer_fire_webhook::SandboxBankTransferFireWebhookRequest; pub mod sandbox_income_fire_webhook; +pub use sandbox_income_fire_webhook::SandboxIncomeFireWebhookRequest; pub mod sandbox_bank_income_fire_webhook; +pub use sandbox_bank_income_fire_webhook::SandboxBankIncomeFireWebhookRequest; pub mod sandbox_oauth_select_accounts; +pub use sandbox_oauth_select_accounts::SandboxOauthSelectAccountsRequest; pub mod signal_evaluate; +pub use signal_evaluate::SignalEvaluateRequest; pub mod signal_decision_report; +pub use signal_decision_report::SignalDecisionReportRequest; pub mod signal_return_report; +pub use signal_return_report::SignalReturnReportRequest; pub mod signal_prepare; +pub use signal_prepare::SignalPrepareRequest; pub mod wallet_create; +pub use wallet_create::WalletCreateRequest; pub mod wallet_get; +pub use wallet_get::WalletGetRequest; pub mod wallet_list; +pub use wallet_list::WalletListRequest; pub mod wallet_transaction_execute; +pub use wallet_transaction_execute::WalletTransactionExecuteRequest; pub mod wallet_transaction_get; +pub use wallet_transaction_get::WalletTransactionGetRequest; pub mod wallet_transaction_list; +pub use wallet_transaction_list::WalletTransactionListRequest; pub mod transactions_enhance; +pub use transactions_enhance::TransactionsEnhanceRequest; pub mod transactions_rules_create; +pub use transactions_rules_create::TransactionsRulesCreateRequest; pub mod transactions_rules_list; +pub use transactions_rules_list::TransactionsRulesListRequest; pub mod transactions_rules_remove; +pub use transactions_rules_remove::TransactionsRulesRemoveRequest; pub mod transactions_user_insights_get; +pub use transactions_user_insights_get::TransactionsUserInsightsGetRequest; +pub mod issues_search; +pub use issues_search::IssuesSearchRequest; +pub mod issues_get; +pub use issues_get::IssuesGetRequest; +pub mod issues_subscribe; +pub use issues_subscribe::IssuesSubscribeRequest; pub mod payment_profile_create; +pub use payment_profile_create::PaymentProfileCreateRequest; pub mod payment_profile_get; +pub use payment_profile_get::PaymentProfileGetRequest; pub mod payment_profile_remove; +pub use payment_profile_remove::PaymentProfileRemoveRequest; pub mod partner_customer_create; +pub use partner_customer_create::PartnerCustomerCreateRequest; pub mod partner_customer_get; -pub mod partner_customer_enable; -pub mod partner_customer_remove; -pub mod partner_customer_oauth_institutions_get; -pub mod link_delivery_create; -pub mod link_delivery_get; -pub mod fdx_notifications; -pub use asset_report_create::AssetReportCreateRequest; -pub use asset_report_get::AssetReportGetRequest; -pub use asset_report_pdf_get::AssetReportPdfGetRequest; -pub use asset_report_refresh::AssetReportRefreshRequest; -pub use asset_report_filter::AssetReportFilterRequest; -pub use asset_report_remove::AssetReportRemoveRequest; -pub use asset_report_audit_copy_create::AssetReportAuditCopyCreateRequest; -pub use asset_report_audit_copy_get::AssetReportAuditCopyGetRequest; -pub use asset_report_audit_copy_remove::AssetReportAuditCopyRemoveRequest; -pub use base_report_get::BaseReportGetRequest; -pub use credit_audit_copy_token_update::CreditAuditCopyTokenUpdateRequest; -pub use cra_bank_income_get::CraBankIncomeGetRequest; -pub use statements_list::StatementsListRequest; -pub use statements_download::StatementsDownloadRequest; -pub use statements_refresh::StatementsRefreshRequest; -pub use item_activity_list::ItemActivityListRequest; -pub use item_application_list::ItemApplicationListRequest; -pub use item_application_unlink::ItemApplicationUnlinkRequest; -pub use item_application_scopes_update::{ - ItemApplicationScopesUpdateRequest, ItemApplicationScopesUpdateRequired, -}; -pub use application_get::ApplicationGetRequest; -pub use item_get::ItemGetRequest; -pub use auth_get::AuthGetRequest; -pub use transactions_get::TransactionsGetRequest; -pub use transactions_refresh::TransactionsRefreshRequest; -pub use transactions_recurring_get::TransactionsRecurringGetRequest; -pub use transactions_sync::TransactionsSyncRequest; -pub use transactions_enrich::TransactionsEnrichRequest; -pub use institutions_get::InstitutionsGetRequest; -pub use institutions_search::InstitutionsSearchRequest; -pub use institutions_get_by_id::InstitutionsGetByIdRequest; -pub use item_remove::ItemRemoveRequest; -pub use accounts_get::AccountsGetRequest; -pub use categories_get::CategoriesGetRequest; -pub use sandbox_processor_token_create::SandboxProcessorTokenCreateRequest; -pub use sandbox_public_token_create::SandboxPublicTokenCreateRequest; -pub use sandbox_item_fire_webhook::SandboxItemFireWebhookRequest; -pub use accounts_balance_get::AccountsBalanceGetRequest; -pub use identity_get::IdentityGetRequest; -pub use identity_match::IdentityMatchRequest; -pub use identity_refresh::IdentityRefreshRequest; -pub use dashboard_user_get::DashboardUserGetRequest; -pub use dashboard_user_list::DashboardUserListRequest; -pub use identity_verification_create::IdentityVerificationCreateRequest; -pub use identity_verification_get::IdentityVerificationGetRequest; -pub use identity_verification_list::IdentityVerificationListRequest; -pub use identity_verification_retry::IdentityVerificationRetryRequest; -pub use watchlist_screening_entity_create::WatchlistScreeningEntityCreateRequest; -pub use watchlist_screening_entity_get::WatchlistScreeningEntityGetRequest; -pub use watchlist_screening_entity_history_list::WatchlistScreeningEntityHistoryListRequest; -pub use watchlist_screening_entity_hit_list::WatchlistScreeningEntityHitListRequest; -pub use watchlist_screening_entity_list::WatchlistScreeningEntityListRequest; -pub use watchlist_screening_entity_program_get::WatchlistScreeningEntityProgramGetRequest; -pub use watchlist_screening_entity_program_list::WatchlistScreeningEntityProgramListRequest; -pub use watchlist_screening_entity_review_create::WatchlistScreeningEntityReviewCreateRequest; -pub use watchlist_screening_entity_review_list::WatchlistScreeningEntityReviewListRequest; -pub use watchlist_screening_entity_update::WatchlistScreeningEntityUpdateRequest; -pub use watchlist_screening_individual_create::WatchlistScreeningIndividualCreateRequest; -pub use watchlist_screening_individual_get::WatchlistScreeningIndividualGetRequest; -pub use watchlist_screening_individual_history_list::WatchlistScreeningIndividualHistoryListRequest; -pub use watchlist_screening_individual_hit_list::WatchlistScreeningIndividualHitListRequest; -pub use watchlist_screening_individual_list::WatchlistScreeningIndividualListRequest; -pub use watchlist_screening_individual_program_get::WatchlistScreeningIndividualProgramGetRequest; -pub use watchlist_screening_individual_program_list::WatchlistScreeningIndividualProgramListRequest; -pub use watchlist_screening_individual_review_create::WatchlistScreeningIndividualReviewCreateRequest; -pub use watchlist_screening_individual_review_list::WatchlistScreeningIndividualReviewListRequest; -pub use watchlist_screening_individual_update::WatchlistScreeningIndividualUpdateRequest; -pub use beacon_user_create::BeaconUserCreateRequest; -pub use beacon_user_get::BeaconUserGetRequest; -pub use beacon_user_review::BeaconUserReviewRequest; -pub use beacon_report_create::BeaconReportCreateRequest; -pub use beacon_report_list::BeaconReportListRequest; -pub use beacon_report_syndication_list::BeaconReportSyndicationListRequest; -pub use beacon_report_get::BeaconReportGetRequest; -pub use beacon_report_syndication_get::BeaconReportSyndicationGetRequest; -pub use beacon_user_update::BeaconUserUpdateRequest; -pub use beacon_duplicate_get::BeaconDuplicateGetRequest; -pub use identity_verification_autofill_create::IdentityVerificationAutofillCreateRequest; -pub use processor_auth_get::ProcessorAuthGetRequest; -pub use processor_account_get::ProcessorAccountGetRequest; -pub use processor_transactions_get::ProcessorTransactionsGetRequest; -pub use processor_transactions_sync::ProcessorTransactionsSyncRequest; -pub use processor_transactions_refresh::ProcessorTransactionsRefreshRequest; -pub use processor_transactions_recurring_get::ProcessorTransactionsRecurringGetRequest; -pub use processor_signal_evaluate::ProcessorSignalEvaluateRequest; -pub use processor_signal_decision_report::ProcessorSignalDecisionReportRequest; -pub use processor_signal_return_report::ProcessorSignalReturnReportRequest; -pub use processor_signal_prepare::ProcessorSignalPrepareRequest; -pub use processor_bank_transfer_create::{ - ProcessorBankTransferCreateRequest, ProcessorBankTransferCreateRequired, -}; -pub use processor_liabilities_get::ProcessorLiabilitiesGetRequest; -pub use processor_identity_get::ProcessorIdentityGetRequest; -pub use processor_identity_match::ProcessorIdentityMatchRequest; -pub use processor_balance_get::ProcessorBalanceGetRequest; -pub use item_webhook_update::ItemWebhookUpdateRequest; -pub use item_access_token_invalidate::ItemAccessTokenInvalidateRequest; -pub use webhook_verification_key_get::WebhookVerificationKeyGetRequest; -pub use liabilities_get::LiabilitiesGetRequest; -pub use payment_initiation_recipient_create::PaymentInitiationRecipientCreateRequest; -pub use payment_initiation_payment_reverse::PaymentInitiationPaymentReverseRequest; -pub use payment_initiation_recipient_get::PaymentInitiationRecipientGetRequest; -pub use payment_initiation_recipient_list::PaymentInitiationRecipientListRequest; -pub use payment_initiation_payment_create::PaymentInitiationPaymentCreateRequest; -pub use create_payment_token::CreatePaymentTokenRequest; -pub use payment_initiation_consent_create::{ - PaymentInitiationConsentCreateRequest, PaymentInitiationConsentCreateRequired, -}; -pub use payment_initiation_consent_get::PaymentInitiationConsentGetRequest; -pub use payment_initiation_consent_revoke::PaymentInitiationConsentRevokeRequest; -pub use payment_initiation_consent_payment_execute::PaymentInitiationConsentPaymentExecuteRequest; -pub use sandbox_item_reset_login::SandboxItemResetLoginRequest; -pub use sandbox_item_set_verification_status::SandboxItemSetVerificationStatusRequest; -pub use item_public_token_exchange::ItemPublicTokenExchangeRequest; -pub use item_create_public_token::ItemCreatePublicTokenRequest; -pub use user_create::UserCreateRequest; -pub use user_update::UserUpdateRequest; -pub use credit_sessions_get::CreditSessionsGetRequest; -pub use payment_initiation_payment_get::PaymentInitiationPaymentGetRequest; -pub use payment_initiation_payment_list::PaymentInitiationPaymentListRequest; -pub use investments_holdings_get::InvestmentsHoldingsGetRequest; -pub use investments_transactions_get::InvestmentsTransactionsGetRequest; -pub use investments_refresh::InvestmentsRefreshRequest; -pub use investments_auth_get::InvestmentsAuthGetRequest; -pub use processor_token_create::ProcessorTokenCreateRequest; -pub use processor_token_permissions_set::ProcessorTokenPermissionsSetRequest; -pub use processor_token_permissions_get::ProcessorTokenPermissionsGetRequest; -pub use processor_token_webhook_update::ProcessorTokenWebhookUpdateRequest; -pub use processor_stripe_bank_account_token_create::ProcessorStripeBankAccountTokenCreateRequest; -pub use processor_apex_processor_token_create::ProcessorApexProcessorTokenCreateRequest; -pub use deposit_switch_create::DepositSwitchCreateRequest; -pub use item_import::ItemImportRequest; -pub use deposit_switch_token_create::DepositSwitchTokenCreateRequest; -pub use link_token_create::{LinkTokenCreateRequest, LinkTokenCreateRequired}; -pub use link_token_get::LinkTokenGetRequest; -pub use link_oauth_correlation_id_exchange::LinkOauthCorrelationIdExchangeRequest; -pub use deposit_switch_get::DepositSwitchGetRequest; -pub use transfer_get::TransferGetRequest; -pub use transfer_recurring_get::TransferRecurringGetRequest; -pub use bank_transfer_get::BankTransferGetRequest; -pub use transfer_authorization_create::{ - TransferAuthorizationCreateRequest, TransferAuthorizationCreateRequired, -}; -pub use transfer_balance_get::TransferBalanceGetRequest; -pub use transfer_capabilities_get::TransferCapabilitiesGetRequest; -pub use transfer_configuration_get::TransferConfigurationGetRequest; -pub use transfer_ledger_get::TransferLedgerGetRequest; -pub use transfer_ledger_distribute::{ - TransferLedgerDistributeRequest, TransferLedgerDistributeRequired, -}; -pub use transfer_ledger_deposit::TransferLedgerDepositRequest; -pub use transfer_ledger_withdraw::TransferLedgerWithdrawRequest; -pub use transfer_originator_funding_account_update::TransferOriginatorFundingAccountUpdateRequest; -pub use transfer_metrics_get::TransferMetricsGetRequest; -pub use transfer_create::{TransferCreateRequest, TransferCreateRequired}; -pub use transfer_recurring_create::{ - TransferRecurringCreateRequest, TransferRecurringCreateRequired, -}; -pub use bank_transfer_create::{BankTransferCreateRequest, BankTransferCreateRequired}; -pub use transfer_list::TransferListRequest; -pub use transfer_recurring_list::TransferRecurringListRequest; -pub use bank_transfer_list::BankTransferListRequest; -pub use transfer_cancel::TransferCancelRequest; -pub use transfer_recurring_cancel::TransferRecurringCancelRequest; -pub use bank_transfer_cancel::BankTransferCancelRequest; -pub use transfer_event_list::TransferEventListRequest; -pub use bank_transfer_event_list::BankTransferEventListRequest; -pub use transfer_event_sync::TransferEventSyncRequest; -pub use bank_transfer_event_sync::BankTransferEventSyncRequest; -pub use transfer_sweep_get::TransferSweepGetRequest; -pub use bank_transfer_sweep_get::BankTransferSweepGetRequest; -pub use transfer_sweep_list::TransferSweepListRequest; -pub use bank_transfer_sweep_list::BankTransferSweepListRequest; -pub use bank_transfer_balance_get::BankTransferBalanceGetRequest; -pub use bank_transfer_migrate_account::BankTransferMigrateAccountRequest; -pub use transfer_migrate_account::TransferMigrateAccountRequest; -pub use transfer_intent_create::{ - TransferIntentCreateRequest, TransferIntentCreateRequired, -}; -pub use transfer_intent_get::TransferIntentGetRequest; -pub use transfer_repayment_list::TransferRepaymentListRequest; -pub use transfer_repayment_return_list::TransferRepaymentReturnListRequest; -pub use transfer_originator_create::TransferOriginatorCreateRequest; -pub use transfer_questionnaire_create::TransferQuestionnaireCreateRequest; -pub use transfer_diligence_submit::TransferDiligenceSubmitRequest; -pub use transfer_diligence_document_upload::TransferDiligenceDocumentUploadRequest; -pub use transfer_originator_get::TransferOriginatorGetRequest; -pub use transfer_originator_list::TransferOriginatorListRequest; -pub use transfer_refund_create::TransferRefundCreateRequest; -pub use transfer_refund_get::TransferRefundGetRequest; -pub use transfer_refund_cancel::TransferRefundCancelRequest; -pub use sandbox_bank_transfer_simulate::SandboxBankTransferSimulateRequest; -pub use sandbox_transfer_sweep_simulate::SandboxTransferSweepSimulateRequest; -pub use sandbox_transfer_simulate::SandboxTransferSimulateRequest; -pub use sandbox_transfer_refund_simulate::SandboxTransferRefundSimulateRequest; -pub use sandbox_transfer_ledger_simulate_available::SandboxTransferLedgerSimulateAvailableRequest; -pub use sandbox_transfer_ledger_deposit_simulate::SandboxTransferLedgerDepositSimulateRequest; -pub use sandbox_transfer_ledger_withdraw_simulate::SandboxTransferLedgerWithdrawSimulateRequest; -pub use sandbox_transfer_repayment_simulate::SandboxTransferRepaymentSimulateRequest; -pub use sandbox_transfer_fire_webhook::SandboxTransferFireWebhookRequest; -pub use sandbox_transfer_test_clock_create::SandboxTransferTestClockCreateRequest; -pub use sandbox_transfer_test_clock_advance::SandboxTransferTestClockAdvanceRequest; -pub use sandbox_transfer_test_clock_get::SandboxTransferTestClockGetRequest; -pub use sandbox_transfer_test_clock_list::SandboxTransferTestClockListRequest; -pub use sandbox_payment_profile_reset_login::SandboxPaymentProfileResetLoginRequest; -pub use employers_search::EmployersSearchRequest; -pub use income_verification_create::IncomeVerificationCreateRequest; -pub use income_verification_paystubs_get::IncomeVerificationPaystubsGetRequest; -pub use income_verification_documents_download::IncomeVerificationDocumentsDownloadRequest; -pub use income_verification_taxforms_get::IncomeVerificationTaxformsGetRequest; -pub use income_verification_precheck::IncomeVerificationPrecheckRequest; -pub use employment_verification_get::EmploymentVerificationGetRequest; -pub use deposit_switch_alt_create::DepositSwitchAltCreateRequest; -pub use credit_audit_copy_token_create::CreditAuditCopyTokenCreateRequest; -pub use credit_report_audit_copy_remove::CreditReportAuditCopyRemoveRequest; -pub use credit_asset_report_freddie_mac_get::CreditAssetReportFreddieMacGetRequest; -pub use credit_freddie_mac_reports_get::CreditFreddieMacReportsGetRequest; -pub use credit_bank_employment_get::CreditBankEmploymentGetRequest; -pub use credit_bank_income_get::CreditBankIncomeGetRequest; -pub use credit_bank_income_pdf_get::CreditBankIncomePdfGetRequest; -pub use credit_bank_income_refresh::CreditBankIncomeRefreshRequest; -pub use credit_bank_income_webhook_update::CreditBankIncomeWebhookUpdateRequest; -pub use credit_payroll_income_parsing_config_update::CreditPayrollIncomeParsingConfigUpdateRequest; -pub use credit_bank_statements_uploads_get::CreditBankStatementsUploadsGetRequest; -pub use credit_payroll_income_get::CreditPayrollIncomeGetRequest; -pub use credit_payroll_income_risk_signals_get::CreditPayrollIncomeRiskSignalsGetRequest; -pub use credit_payroll_income_precheck::CreditPayrollIncomePrecheckRequest; -pub use credit_employment_get::CreditEmploymentGetRequest; -pub use credit_payroll_income_refresh::CreditPayrollIncomeRefreshRequest; -pub use credit_relay_create::CreditRelayCreateRequest; -pub use credit_relay_get::CreditRelayGetRequest; -pub use credit_relay_pdf_get::CreditRelayPdfGetRequest; -pub use credit_relay_refresh::CreditRelayRefreshRequest; -pub use credit_relay_remove::CreditRelayRemoveRequest; -pub use sandbox_bank_transfer_fire_webhook::SandboxBankTransferFireWebhookRequest; -pub use sandbox_income_fire_webhook::SandboxIncomeFireWebhookRequest; -pub use sandbox_bank_income_fire_webhook::SandboxBankIncomeFireWebhookRequest; -pub use sandbox_oauth_select_accounts::SandboxOauthSelectAccountsRequest; -pub use signal_evaluate::{SignalEvaluateRequest, SignalEvaluateRequired}; -pub use signal_decision_report::SignalDecisionReportRequest; -pub use signal_return_report::SignalReturnReportRequest; -pub use signal_prepare::SignalPrepareRequest; -pub use wallet_create::WalletCreateRequest; -pub use wallet_get::WalletGetRequest; -pub use wallet_list::WalletListRequest; -pub use wallet_transaction_execute::{ - WalletTransactionExecuteRequest, WalletTransactionExecuteRequired, -}; -pub use wallet_transaction_get::WalletTransactionGetRequest; -pub use wallet_transaction_list::WalletTransactionListRequest; -pub use transactions_enhance::TransactionsEnhanceRequest; -pub use transactions_rules_create::TransactionsRulesCreateRequest; -pub use transactions_rules_list::TransactionsRulesListRequest; -pub use transactions_rules_remove::TransactionsRulesRemoveRequest; -pub use transactions_user_insights_get::TransactionsUserInsightsGetRequest; -pub use payment_profile_create::PaymentProfileCreateRequest; -pub use payment_profile_get::PaymentProfileGetRequest; -pub use payment_profile_remove::PaymentProfileRemoveRequest; -pub use partner_customer_create::{ - PartnerCustomerCreateRequest, PartnerCustomerCreateRequired, -}; pub use partner_customer_get::PartnerCustomerGetRequest; +pub mod partner_customer_enable; pub use partner_customer_enable::PartnerCustomerEnableRequest; +pub mod partner_customer_remove; pub use partner_customer_remove::PartnerCustomerRemoveRequest; +pub mod partner_customer_oauth_institutions_get; pub use partner_customer_oauth_institutions_get::PartnerCustomerOauthInstitutionsGetRequest; +pub mod link_delivery_create; pub use link_delivery_create::LinkDeliveryCreateRequest; +pub mod link_delivery_get; pub use link_delivery_get::LinkDeliveryGetRequest; -pub use fdx_notifications::{FdxNotificationsRequest, FdxNotificationsRequired}; \ No newline at end of file +pub mod fdx_notifications; +pub use fdx_notifications::FdxNotificationsRequest; +pub mod get_recipients; +pub use get_recipients::GetRecipientsRequest; +pub mod get_recipient; +pub use get_recipient::GetRecipientRequest; +pub mod network_insights_report_get; +pub use network_insights_report_get::NetworkInsightsReportGetRequest; diff --git a/src/request/network_insights_report_get.rs b/src/request/network_insights_report_get.rs new file mode 100644 index 00000000..7f03543b --- /dev/null +++ b/src/request/network_insights_report_get.rs @@ -0,0 +1,49 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::network_insights_report_get`]. + +On request success, this will return a [`NetworkInsightsReportGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct NetworkInsightsReportGetRequest { + pub access_tokens: Vec, +} +impl FluentRequest<'_, NetworkInsightsReportGetRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, NetworkInsightsReportGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::NetworkInsightsReportGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/network_insights/report/get"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!({ "access_tokens" : self.params.access_tokens }), + ); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve network insights for the provided `access_tokens` + +This endpoint allows you to retrieve the Network Insights from a list of `access_tokens`. + +See endpoint docs at .*/ + pub fn network_insights_report_get( + &self, + access_tokens: &[&str], + ) -> FluentRequest<'_, NetworkInsightsReportGetRequest> { + FluentRequest { + client: self, + params: NetworkInsightsReportGetRequest { + access_tokens: access_tokens.iter().map(|&x| x.to_owned()).collect(), + }, + } + } +} diff --git a/src/request/partner_customer_create.rs b/src/request/partner_customer_create.rs index 2d1106a4..fa4c291b 100644 --- a/src/request/partner_customer_create.rs +++ b/src/request/partner_customer_create.rs @@ -1,9 +1,11 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + PartnerEndCustomerAddress, PartnerEndCustomerAssetsUnderManagement, + PartnerEndCustomerBillingContact, PartnerEndCustomerCustomerSupportInfo, Products, + PartnerEndCustomerTechnicalContact, +}; /**You should use this struct via [`PlaidClient::partner_customer_create`]. On request success, this will return a [`PartnerCustomerCreateResponse`].*/ @@ -21,14 +23,13 @@ pub struct PartnerCustomerCreateRequest { pub is_diligence_attested: bool, pub legal_entity_name: String, pub logo: Option, - pub products: Option>, + pub products: Option>, pub redirect_uris: Option>, pub registration_number: Option, pub secret: Option, pub technical_contact: Option, pub website: String, } -impl PartnerCustomerCreateRequest {} pub struct PartnerCustomerCreateRequired<'a> { pub address: PartnerEndCustomerAddress, pub application_name: &'a str, @@ -38,8 +39,8 @@ pub struct PartnerCustomerCreateRequired<'a> { pub legal_entity_name: &'a str, pub website: &'a str, } -impl<'a> PartnerCustomerCreateRequired<'a> {} impl FluentRequest<'_, PartnerCustomerCreateRequest> { + ///Set the value of the assets_under_management field. pub fn assets_under_management( mut self, assets_under_management: PartnerEndCustomerAssetsUnderManagement, @@ -47,6 +48,7 @@ impl FluentRequest<'_, PartnerCustomerCreateRequest> { self.params.assets_under_management = Some(assets_under_management); self } + ///Set the value of the billing_contact field. pub fn billing_contact( mut self, billing_contact: PartnerEndCustomerBillingContact, @@ -54,14 +56,17 @@ impl FluentRequest<'_, PartnerCustomerCreateRequest> { self.params.billing_contact = Some(billing_contact); self } + ///Set the value of the client_id field. pub fn client_id(mut self, client_id: &str) -> Self { self.params.client_id = Some(client_id.to_owned()); self } + ///Set the value of the create_link_customization field. pub fn create_link_customization(mut self, create_link_customization: bool) -> Self { self.params.create_link_customization = Some(create_link_customization); self } + ///Set the value of the customer_support_info field. pub fn customer_support_info( mut self, customer_support_info: PartnerEndCustomerCustomerSupportInfo, @@ -69,21 +74,17 @@ impl FluentRequest<'_, PartnerCustomerCreateRequest> { self.params.customer_support_info = Some(customer_support_info); self } + ///Set the value of the logo field. pub fn logo(mut self, logo: &str) -> Self { self.params.logo = Some(logo.to_owned()); self } - pub fn products( - mut self, - products: impl IntoIterator>, - ) -> Self { - self - .params - .products = Some( - products.into_iter().map(|s| s.as_ref().to_owned()).collect(), - ); + ///Set the value of the products field. + pub fn products(mut self, products: Vec) -> Self { + self.params.products = Some(products); self } + ///Set the value of the redirect_uris field. pub fn redirect_uris( mut self, redirect_uris: impl IntoIterator>, @@ -95,14 +96,17 @@ impl FluentRequest<'_, PartnerCustomerCreateRequest> { ); self } + ///Set the value of the registration_number field. pub fn registration_number(mut self, registration_number: &str) -> Self { self.params.registration_number = Some(registration_number.to_owned()); self } + ///Set the value of the secret field. pub fn secret(mut self, secret: &str) -> Self { self.params.secret = Some(secret.to_owned()); self } + ///Set the value of the technical_contact field. pub fn technical_contact( mut self, technical_contact: PartnerEndCustomerTechnicalContact, @@ -112,66 +116,116 @@ impl FluentRequest<'_, PartnerCustomerCreateRequest> { } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PartnerCustomerCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PartnerCustomerCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/partner/customer/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "address" : self.params.address })); - r = r.json(json!({ "application_name" : self.params.application_name })); + r = r.json(serde_json::json!({ "address" : self.params.address })); + r = r + .json( + serde_json::json!( + { "application_name" : self.params.application_name } + ), + ); if let Some(ref unwrapped) = self.params.assets_under_management { - r = r.json(json!({ "assets_under_management" : unwrapped })); + r = r.json(serde_json::json!({ "assets_under_management" : unwrapped })); } if let Some(ref unwrapped) = self.params.billing_contact { - r = r.json(json!({ "billing_contact" : unwrapped })); + r = r.json(serde_json::json!({ "billing_contact" : unwrapped })); } if let Some(ref unwrapped) = self.params.client_id { - r = r.json(json!({ "client_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_id" : unwrapped })); } - r = r.json(json!({ "company_name" : self.params.company_name })); + r = r.json(serde_json::json!({ "company_name" : self.params.company_name })); if let Some(ref unwrapped) = self.params.create_link_customization { - r = r.json(json!({ "create_link_customization" : unwrapped })); + r = r + .json( + serde_json::json!({ "create_link_customization" : unwrapped }), + ); } if let Some(ref unwrapped) = self.params.customer_support_info { - r = r.json(json!({ "customer_support_info" : unwrapped })); + r = r.json(serde_json::json!({ "customer_support_info" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "is_bank_addendum_completed" : self.params .is_bank_addendum_completed } ), ); r = r .json( - json!( + serde_json::json!( { "is_diligence_attested" : self.params.is_diligence_attested } ), ); - r = r.json(json!({ "legal_entity_name" : self.params.legal_entity_name })); + r = r + .json( + serde_json::json!( + { "legal_entity_name" : self.params.legal_entity_name } + ), + ); if let Some(ref unwrapped) = self.params.logo { - r = r.json(json!({ "logo" : unwrapped })); + r = r.json(serde_json::json!({ "logo" : unwrapped })); } if let Some(ref unwrapped) = self.params.products { - r = r.json(json!({ "products" : unwrapped })); + r = r.json(serde_json::json!({ "products" : unwrapped })); } if let Some(ref unwrapped) = self.params.redirect_uris { - r = r.json(json!({ "redirect_uris" : unwrapped })); + r = r.json(serde_json::json!({ "redirect_uris" : unwrapped })); } if let Some(ref unwrapped) = self.params.registration_number { - r = r.json(json!({ "registration_number" : unwrapped })); + r = r.json(serde_json::json!({ "registration_number" : unwrapped })); } if let Some(ref unwrapped) = self.params.secret { - r = r.json(json!({ "secret" : unwrapped })); + r = r.json(serde_json::json!({ "secret" : unwrapped })); } if let Some(ref unwrapped) = self.params.technical_contact { - r = r.json(json!({ "technical_contact" : unwrapped })); + r = r.json(serde_json::json!({ "technical_contact" : unwrapped })); } - r = r.json(json!({ "website" : self.params.website })); + r = r.json(serde_json::json!({ "website" : self.params.website })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Creates a new end customer for a Plaid reseller. + +The `/partner/customer/create` endpoint is used by reseller partners to create end customers. To create end customers, it should be called in the Production environment only, even when creating Sandbox API keys. If called in the Sandbox environment, it will return a sample response, but no customer will be created and the API keys will not be valid. + +See endpoint docs at .*/ + pub fn partner_customer_create( + &self, + args: PartnerCustomerCreateRequired, + ) -> FluentRequest<'_, PartnerCustomerCreateRequest> { + FluentRequest { + client: self, + params: PartnerCustomerCreateRequest { + address: args.address, + application_name: args.application_name.to_owned(), + assets_under_management: None, + billing_contact: None, + client_id: None, + company_name: args.company_name.to_owned(), + create_link_customization: None, + customer_support_info: None, + is_bank_addendum_completed: args.is_bank_addendum_completed, + is_diligence_attested: args.is_diligence_attested, + legal_entity_name: args.legal_entity_name.to_owned(), + logo: None, + products: None, + redirect_uris: None, + registration_number: None, + secret: None, + technical_contact: None, + website: args.website.to_owned(), + }, + } + } +} diff --git a/src/request/partner_customer_enable.rs b/src/request/partner_customer_enable.rs index f16aab91..205223c2 100644 --- a/src/request/partner_customer_enable.rs +++ b/src/request/partner_customer_enable.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::partner_customer_enable`]. On request success, this will return a [`PartnerCustomerEnableResponse`].*/ @@ -13,39 +10,62 @@ pub struct PartnerCustomerEnableRequest { pub end_customer_client_id: String, pub secret: Option, } -impl PartnerCustomerEnableRequest {} impl FluentRequest<'_, PartnerCustomerEnableRequest> { + ///Set the value of the client_id field. pub fn client_id(mut self, client_id: &str) -> Self { self.params.client_id = Some(client_id.to_owned()); self } + ///Set the value of the secret field. pub fn secret(mut self, secret: &str) -> Self { self.params.secret = Some(secret.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PartnerCustomerEnableRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PartnerCustomerEnableResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/partner/customer/enable"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.client_id { - r = r.json(json!({ "client_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_id" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "end_customer_client_id" : self.params.end_customer_client_id } ), ); if let Some(ref unwrapped) = self.params.secret { - r = r.json(json!({ "secret" : unwrapped })); + r = r.json(serde_json::json!({ "secret" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Enables a Plaid reseller's end customer in the Production environment. + +The `/partner/customer/enable` endpoint is used by reseller partners to enable an end customer in the full Production environment. + +See endpoint docs at .*/ + pub fn partner_customer_enable( + &self, + end_customer_client_id: &str, + ) -> FluentRequest<'_, PartnerCustomerEnableRequest> { + FluentRequest { + client: self, + params: PartnerCustomerEnableRequest { + client_id: None, + end_customer_client_id: end_customer_client_id.to_owned(), + secret: None, + }, + } + } +} diff --git a/src/request/partner_customer_get.rs b/src/request/partner_customer_get.rs index 3d761979..5a151513 100644 --- a/src/request/partner_customer_get.rs +++ b/src/request/partner_customer_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::partner_customer_get`]. On request success, this will return a [`PartnerCustomerGetResponse`].*/ @@ -13,39 +10,60 @@ pub struct PartnerCustomerGetRequest { pub end_customer_client_id: String, pub secret: Option, } -impl PartnerCustomerGetRequest {} impl FluentRequest<'_, PartnerCustomerGetRequest> { + ///Set the value of the client_id field. pub fn client_id(mut self, client_id: &str) -> Self { self.params.client_id = Some(client_id.to_owned()); self } + ///Set the value of the secret field. pub fn secret(mut self, secret: &str) -> Self { self.params.secret = Some(secret.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PartnerCustomerGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/partner/customer/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.client_id { - r = r.json(json!({ "client_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_id" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "end_customer_client_id" : self.params.end_customer_client_id } ), ); if let Some(ref unwrapped) = self.params.secret { - r = r.json(json!({ "secret" : unwrapped })); + r = r.json(serde_json::json!({ "secret" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Returns a Plaid reseller's end customer. + +The `/partner/customer/get` endpoint is used by reseller partners to retrieve data about a single end customer. + +See endpoint docs at .*/ + pub fn partner_customer_get( + &self, + end_customer_client_id: &str, + ) -> FluentRequest<'_, PartnerCustomerGetRequest> { + FluentRequest { + client: self, + params: PartnerCustomerGetRequest { + client_id: None, + end_customer_client_id: end_customer_client_id.to_owned(), + secret: None, + }, + } + } +} diff --git a/src/request/partner_customer_oauth_institutions_get.rs b/src/request/partner_customer_oauth_institutions_get.rs index 7bdd0511..82c5b0f1 100644 --- a/src/request/partner_customer_oauth_institutions_get.rs +++ b/src/request/partner_customer_oauth_institutions_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::partner_customer_oauth_institutions_get`]. On request success, this will return a [`PartnerCustomerOAuthInstitutionsGetResponse`].*/ @@ -13,12 +10,13 @@ pub struct PartnerCustomerOauthInstitutionsGetRequest { pub end_customer_client_id: String, pub secret: Option, } -impl PartnerCustomerOauthInstitutionsGetRequest {} impl FluentRequest<'_, PartnerCustomerOauthInstitutionsGetRequest> { + ///Set the value of the client_id field. pub fn client_id(mut self, client_id: &str) -> Self { self.params.client_id = Some(client_id.to_owned()); self } + ///Set the value of the secret field. pub fn secret(mut self, secret: &str) -> Self { self.params.secret = Some(secret.to_owned()); self @@ -27,7 +25,7 @@ impl FluentRequest<'_, PartnerCustomerOauthInstitutionsGetRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PartnerCustomerOauthInstitutionsGetRequest> { type Output = httpclient::InMemoryResult< - PartnerCustomerOAuthInstitutionsGetResponse, + crate::model::PartnerCustomerOAuthInstitutionsGetResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -35,20 +33,40 @@ for FluentRequest<'a, PartnerCustomerOauthInstitutionsGetRequest> { let url = "/partner/customer/oauth_institutions/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.client_id { - r = r.json(json!({ "client_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_id" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "end_customer_client_id" : self.params.end_customer_client_id } ), ); if let Some(ref unwrapped) = self.params.secret { - r = r.json(json!({ "secret" : unwrapped })); + r = r.json(serde_json::json!({ "secret" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Returns OAuth-institution registration information for a given end customer. + +The `/partner/customer/oauth_institutions/get` endpoint is used by reseller partners to retrieve OAuth-institution registration information about a single end customer. To learn how to set up a webhook to listen to status update events, visit the [reseller documentation](https://plaid.com/docs/account/resellers/#enabling-end-customers). + +See endpoint docs at .*/ + pub fn partner_customer_oauth_institutions_get( + &self, + end_customer_client_id: &str, + ) -> FluentRequest<'_, PartnerCustomerOauthInstitutionsGetRequest> { + FluentRequest { + client: self, + params: PartnerCustomerOauthInstitutionsGetRequest { + client_id: None, + end_customer_client_id: end_customer_client_id.to_owned(), + secret: None, + }, + } + } +} diff --git a/src/request/partner_customer_remove.rs b/src/request/partner_customer_remove.rs index 57679f57..035cad27 100644 --- a/src/request/partner_customer_remove.rs +++ b/src/request/partner_customer_remove.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::partner_customer_remove`]. On request success, this will return a [`PartnerCustomerRemoveResponse`].*/ @@ -13,39 +10,62 @@ pub struct PartnerCustomerRemoveRequest { pub end_customer_client_id: String, pub secret: Option, } -impl PartnerCustomerRemoveRequest {} impl FluentRequest<'_, PartnerCustomerRemoveRequest> { + ///Set the value of the client_id field. pub fn client_id(mut self, client_id: &str) -> Self { self.params.client_id = Some(client_id.to_owned()); self } + ///Set the value of the secret field. pub fn secret(mut self, secret: &str) -> Self { self.params.secret = Some(secret.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PartnerCustomerRemoveRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PartnerCustomerRemoveResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/partner/customer/remove"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.client_id { - r = r.json(json!({ "client_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_id" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "end_customer_client_id" : self.params.end_customer_client_id } ), ); if let Some(ref unwrapped) = self.params.secret { - r = r.json(json!({ "secret" : unwrapped })); + r = r.json(serde_json::json!({ "secret" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Removes a Plaid reseller's end customer. + +The `/partner/customer/remove` endpoint is used by reseller partners to remove an end customer. Removing an end customer will remove it from view in the Plaid Dashboard and deactivate its API keys. This endpoint can only be used to remove an end customer that has not yet been enabled in full Production. + +See endpoint docs at .*/ + pub fn partner_customer_remove( + &self, + end_customer_client_id: &str, + ) -> FluentRequest<'_, PartnerCustomerRemoveRequest> { + FluentRequest { + client: self, + params: PartnerCustomerRemoveRequest { + client_id: None, + end_customer_client_id: end_customer_client_id.to_owned(), + secret: None, + }, + } + } +} diff --git a/src/request/payment_initiation_consent_create.rs b/src/request/payment_initiation_consent_create.rs index 4eb06c6e..637fe0cf 100644 --- a/src/request/payment_initiation_consent_create.rs +++ b/src/request/payment_initiation_consent_create.rs @@ -1,9 +1,11 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + PaymentInitiationConsentConstraints, ExternalPaymentInitiationConsentOptions, + PaymentInitiationConsentPayerDetails, PaymentInitiationConsentScope, + PaymentInitiationConsentType, +}; /**You should use this struct via [`PlaidClient::payment_initiation_consent_create`]. On request success, this will return a [`PaymentInitiationConsentCreateResponse`].*/ @@ -11,42 +13,93 @@ On request success, this will return a [`PaymentInitiationConsentCreateResponse` pub struct PaymentInitiationConsentCreateRequest { pub constraints: PaymentInitiationConsentConstraints, pub options: Option, + pub payer_details: Option, pub recipient_id: String, pub reference: String, - pub scopes: Vec, + pub scopes: Option>, + pub type_: Option, } -impl PaymentInitiationConsentCreateRequest {} -pub struct PaymentInitiationConsentCreateRequired<'a> { - pub constraints: PaymentInitiationConsentConstraints, - pub recipient_id: &'a str, - pub reference: &'a str, - pub scopes: &'a [&'a str], -} -impl<'a> PaymentInitiationConsentCreateRequired<'a> {} impl FluentRequest<'_, PaymentInitiationConsentCreateRequest> { + ///Set the value of the options field. pub fn options(mut self, options: ExternalPaymentInitiationConsentOptions) -> Self { self.params.options = Some(options); self } + ///Set the value of the payer_details field. + pub fn payer_details( + mut self, + payer_details: PaymentInitiationConsentPayerDetails, + ) -> Self { + self.params.payer_details = Some(payer_details); + self + } + ///Set the value of the scopes field. + pub fn scopes(mut self, scopes: Vec) -> Self { + self.params.scopes = Some(scopes); + self + } + ///Set the value of the type_ field. + pub fn type_(mut self, type_: PaymentInitiationConsentType) -> Self { + self.params.type_ = Some(type_); + self + } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationConsentCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationConsentCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/consent/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "constraints" : self.params.constraints })); + r = r.json(serde_json::json!({ "constraints" : self.params.constraints })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.payer_details { + r = r.json(serde_json::json!({ "payer_details" : unwrapped })); + } + r = r.json(serde_json::json!({ "recipient_id" : self.params.recipient_id })); + r = r.json(serde_json::json!({ "reference" : self.params.reference })); + if let Some(ref unwrapped) = self.params.scopes { + r = r.json(serde_json::json!({ "scopes" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.type_ { + r = r.json(serde_json::json!({ "type" : unwrapped })); } - r = r.json(json!({ "recipient_id" : self.params.recipient_id })); - r = r.json(json!({ "reference" : self.params.reference })); - r = r.json(json!({ "scopes" : self.params.scopes })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create payment consent + +The `/payment_initiation/consent/create` endpoint is used to create a payment consent, which can be used to initiate payments on behalf of the user. Payment consents are created with `UNAUTHORISED` status by default and must be authorised by the user before payments can be initiated. + +Consents can be limited in time and scope, and have constraints that describe limitations for payments. + +See endpoint docs at .*/ + pub fn payment_initiation_consent_create( + &self, + constraints: PaymentInitiationConsentConstraints, + recipient_id: &str, + reference: &str, + ) -> FluentRequest<'_, PaymentInitiationConsentCreateRequest> { + FluentRequest { + client: self, + params: PaymentInitiationConsentCreateRequest { + constraints, + options: None, + payer_details: None, + recipient_id: recipient_id.to_owned(), + reference: reference.to_owned(), + scopes: None, + type_: None, + }, + } + } +} diff --git a/src/request/payment_initiation_consent_get.rs b/src/request/payment_initiation_consent_get.rs index 3cfeccc6..189d6fba 100644 --- a/src/request/payment_initiation_consent_get.rs +++ b/src/request/payment_initiation_consent_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::payment_initiation_consent_get`]. On request success, this will return a [`PaymentInitiationConsentGetResponse`].*/ @@ -11,20 +8,39 @@ On request success, this will return a [`PaymentInitiationConsentGetResponse`].* pub struct PaymentInitiationConsentGetRequest { pub consent_id: String, } -impl PaymentInitiationConsentGetRequest {} impl FluentRequest<'_, PaymentInitiationConsentGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationConsentGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationConsentGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/consent/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "consent_id" : self.params.consent_id })); + r = r.json(serde_json::json!({ "consent_id" : self.params.consent_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get payment consent + +The `/payment_initiation/consent/get` endpoint can be used to check the status of a payment consent, as well as to receive basic information such as recipient and constraints. + +See endpoint docs at .*/ + pub fn payment_initiation_consent_get( + &self, + consent_id: &str, + ) -> FluentRequest<'_, PaymentInitiationConsentGetRequest> { + FluentRequest { + client: self, + params: PaymentInitiationConsentGetRequest { + consent_id: consent_id.to_owned(), + }, + } + } +} diff --git a/src/request/payment_initiation_consent_payment_execute.rs b/src/request/payment_initiation_consent_payment_execute.rs index 253655e3..fa51b2a8 100644 --- a/src/request/payment_initiation_consent_payment_execute.rs +++ b/src/request/payment_initiation_consent_payment_execute.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{PaymentAmount, PaymentInitiationConsentProcessingMode}; /**You should use this struct via [`PlaidClient::payment_initiation_consent_payment_execute`]. On request success, this will return a [`PaymentInitiationConsentPaymentExecuteResponse`].*/ @@ -12,25 +10,85 @@ pub struct PaymentInitiationConsentPaymentExecuteRequest { pub amount: PaymentAmount, pub consent_id: String, pub idempotency_key: String, + pub processing_mode: Option, + pub reference: Option, + pub scope: Option, +} +impl FluentRequest<'_, PaymentInitiationConsentPaymentExecuteRequest> { + ///Set the value of the processing_mode field. + pub fn processing_mode( + mut self, + processing_mode: PaymentInitiationConsentProcessingMode, + ) -> Self { + self.params.processing_mode = Some(processing_mode); + self + } + ///Set the value of the reference field. + pub fn reference(mut self, reference: &str) -> Self { + self.params.reference = Some(reference.to_owned()); + self + } + ///Set the value of the scope field. + pub fn scope(mut self, scope: serde_json::Value) -> Self { + self.params.scope = Some(scope); + self + } } -impl PaymentInitiationConsentPaymentExecuteRequest {} -impl FluentRequest<'_, PaymentInitiationConsentPaymentExecuteRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationConsentPaymentExecuteRequest> { type Output = httpclient::InMemoryResult< - PaymentInitiationConsentPaymentExecuteResponse, + crate::model::PaymentInitiationConsentPaymentExecuteResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/consent/payment/execute"; let mut r = self.client.client.post(url); - r = r.json(json!({ "amount" : self.params.amount })); - r = r.json(json!({ "consent_id" : self.params.consent_id })); - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "consent_id" : self.params.consent_id })); + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); + if let Some(ref unwrapped) = self.params.processing_mode { + r = r.json(serde_json::json!({ "processing_mode" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.reference { + r = r.json(serde_json::json!({ "reference" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.scope { + r = r.json(serde_json::json!({ "scope" : unwrapped })); + } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Execute a single payment using consent + +The `/payment_initiation/consent/payment/execute` endpoint can be used to execute payments using payment consent. + +See endpoint docs at .*/ + pub fn payment_initiation_consent_payment_execute( + &self, + amount: PaymentAmount, + consent_id: &str, + idempotency_key: &str, + ) -> FluentRequest<'_, PaymentInitiationConsentPaymentExecuteRequest> { + FluentRequest { + client: self, + params: PaymentInitiationConsentPaymentExecuteRequest { + amount, + consent_id: consent_id.to_owned(), + idempotency_key: idempotency_key.to_owned(), + processing_mode: None, + reference: None, + scope: None, + }, + } + } +} diff --git a/src/request/payment_initiation_consent_revoke.rs b/src/request/payment_initiation_consent_revoke.rs index e7a0e5e1..be0035b3 100644 --- a/src/request/payment_initiation_consent_revoke.rs +++ b/src/request/payment_initiation_consent_revoke.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::payment_initiation_consent_revoke`]. On request success, this will return a [`PaymentInitiationConsentRevokeResponse`].*/ @@ -11,20 +8,39 @@ On request success, this will return a [`PaymentInitiationConsentRevokeResponse` pub struct PaymentInitiationConsentRevokeRequest { pub consent_id: String, } -impl PaymentInitiationConsentRevokeRequest {} impl FluentRequest<'_, PaymentInitiationConsentRevokeRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationConsentRevokeRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationConsentRevokeResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/consent/revoke"; let mut r = self.client.client.post(url); - r = r.json(json!({ "consent_id" : self.params.consent_id })); + r = r.json(serde_json::json!({ "consent_id" : self.params.consent_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Revoke payment consent + +The `/payment_initiation/consent/revoke` endpoint can be used to revoke the payment consent. Once the consent is revoked, it is not possible to initiate payments using it. + +See endpoint docs at .*/ + pub fn payment_initiation_consent_revoke( + &self, + consent_id: &str, + ) -> FluentRequest<'_, PaymentInitiationConsentRevokeRequest> { + FluentRequest { + client: self, + params: PaymentInitiationConsentRevokeRequest { + consent_id: consent_id.to_owned(), + }, + } + } +} diff --git a/src/request/payment_initiation_payment_create.rs b/src/request/payment_initiation_payment_create.rs index b8772e7d..99f24d5d 100644 --- a/src/request/payment_initiation_payment_create.rs +++ b/src/request/payment_initiation_payment_create.rs @@ -1,9 +1,9 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + PaymentAmount, ExternalPaymentOptions, ExternalPaymentScheduleRequest, +}; /**You should use this struct via [`PlaidClient::payment_initiation_payment_create`]. On request success, this will return a [`PaymentInitiationPaymentCreateResponse`].*/ @@ -15,12 +15,13 @@ pub struct PaymentInitiationPaymentCreateRequest { pub reference: String, pub schedule: Option, } -impl PaymentInitiationPaymentCreateRequest {} impl FluentRequest<'_, PaymentInitiationPaymentCreateRequest> { + ///Set the value of the options field. pub fn options(mut self, options: ExternalPaymentOptions) -> Self { self.params.options = Some(options); self } + ///Set the value of the schedule field. pub fn schedule(mut self, schedule: ExternalPaymentScheduleRequest) -> Self { self.params.schedule = Some(schedule); self @@ -28,24 +29,54 @@ impl FluentRequest<'_, PaymentInitiationPaymentCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationPaymentCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationPaymentCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/payment/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "recipient_id" : self.params.recipient_id })); - r = r.json(json!({ "reference" : self.params.reference })); + r = r.json(serde_json::json!({ "recipient_id" : self.params.recipient_id })); + r = r.json(serde_json::json!({ "reference" : self.params.reference })); if let Some(ref unwrapped) = self.params.schedule { - r = r.json(json!({ "schedule" : unwrapped })); + r = r.json(serde_json::json!({ "schedule" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a payment + +After creating a payment recipient, you can use the `/payment_initiation/payment/create` endpoint to create a payment to that recipient. Payments can be one-time or standing order (recurring) and can be denominated in either EUR, GBP or other chosen [currency](https://plaid.com/docs/api/products/payment-initiation/#payment_initiation-payment-create-request-amount-currency). If making domestic GBP-denominated payments, your recipient must have been created with BACS numbers. In general, EUR-denominated payments will be sent via SEPA Credit Transfer, GBP-denominated payments will be sent via the Faster Payments network and for non-Eurozone markets typically via the local payment scheme, but the payment network used will be determined by the institution. Payments sent via Faster Payments will typically arrive immediately, while payments sent via SEPA Credit Transfer or other local payment schemes will typically arrive in one business day. + +Standing orders (recurring payments) must be denominated in GBP and can only be sent to recipients in the UK. Once created, standing order payments cannot be modified or canceled via the API. An end user can cancel or modify a standing order directly on their banking application or website, or by contacting the bank. Standing orders will follow the payment rules of the underlying rails (Faster Payments in UK). Payments can be sent Monday to Friday, excluding bank holidays. If the pre-arranged date falls on a weekend or bank holiday, the payment is made on the next working day. It is not possible to guarantee the exact time the payment will reach the recipient’s account, although at least 90% of standing order payments are sent by 6am. + +In Limited Production, payments must be below 5 GBP or other chosen [currency](https://plaid.com/docs/api/products/payment-initiation/#payment_initiation-payment-create-request-amount-currency), and standing orders, variable recurring payments, and Virtual Accounts are not supported. + +See endpoint docs at .*/ + pub fn payment_initiation_payment_create( + &self, + amount: PaymentAmount, + recipient_id: &str, + reference: &str, + ) -> FluentRequest<'_, PaymentInitiationPaymentCreateRequest> { + FluentRequest { + client: self, + params: PaymentInitiationPaymentCreateRequest { + amount, + options: None, + recipient_id: recipient_id.to_owned(), + reference: reference.to_owned(), + schedule: None, + }, + } + } +} diff --git a/src/request/payment_initiation_payment_get.rs b/src/request/payment_initiation_payment_get.rs index 6a39cbd8..9504e4d1 100644 --- a/src/request/payment_initiation_payment_get.rs +++ b/src/request/payment_initiation_payment_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::payment_initiation_payment_get`]. On request success, this will return a [`PaymentInitiationPaymentGetResponse`].*/ @@ -11,20 +8,39 @@ On request success, this will return a [`PaymentInitiationPaymentGetResponse`].* pub struct PaymentInitiationPaymentGetRequest { pub payment_id: String, } -impl PaymentInitiationPaymentGetRequest {} impl FluentRequest<'_, PaymentInitiationPaymentGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationPaymentGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationPaymentGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/payment/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "payment_id" : self.params.payment_id })); + r = r.json(serde_json::json!({ "payment_id" : self.params.payment_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get payment details + +The `/payment_initiation/payment/get` endpoint can be used to check the status of a payment, as well as to receive basic information such as recipient and payment amount. In the case of standing orders, the `/payment_initiation/payment/get` endpoint will provide information about the status of the overall standing order itself; the API cannot be used to retrieve payment status for individual payments within a standing order. + +See endpoint docs at .*/ + pub fn payment_initiation_payment_get( + &self, + payment_id: &str, + ) -> FluentRequest<'_, PaymentInitiationPaymentGetRequest> { + FluentRequest { + client: self, + params: PaymentInitiationPaymentGetRequest { + payment_id: payment_id.to_owned(), + }, + } + } +} diff --git a/src/request/payment_initiation_payment_list.rs b/src/request/payment_initiation_payment_list.rs index 7f497768..9f20b41e 100644 --- a/src/request/payment_initiation_payment_list.rs +++ b/src/request/payment_initiation_payment_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::payment_initiation_payment_list`]. On request success, this will return a [`PaymentInitiationPaymentListResponse`].*/ @@ -13,16 +10,18 @@ pub struct PaymentInitiationPaymentListRequest { pub count: Option, pub cursor: Option>, } -impl PaymentInitiationPaymentListRequest {} impl FluentRequest<'_, PaymentInitiationPaymentListRequest> { + ///Set the value of the consent_id field. pub fn consent_id(mut self, consent_id: &str) -> Self { self.params.consent_id = Some(consent_id.to_owned()); self } + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: chrono::DateTime) -> Self { self.params.cursor = Some(cursor); self @@ -30,24 +29,45 @@ impl FluentRequest<'_, PaymentInitiationPaymentListRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationPaymentListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationPaymentListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/payment/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.consent_id { - r = r.json(json!({ "consent_id" : unwrapped })); + r = r.json(serde_json::json!({ "consent_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List payments + +The `/payment_initiation/payment/list` endpoint can be used to retrieve all created payments. By default, the 10 most recent payments are returned. You can request more payments and paginate through the results using the optional `count` and `cursor` parameters. + +See endpoint docs at .*/ + pub fn payment_initiation_payment_list( + &self, + ) -> FluentRequest<'_, PaymentInitiationPaymentListRequest> { + FluentRequest { + client: self, + params: PaymentInitiationPaymentListRequest { + consent_id: None, + count: None, + cursor: None, + }, + } + } +} diff --git a/src/request/payment_initiation_payment_reverse.rs b/src/request/payment_initiation_payment_reverse.rs index b0899c8e..115b5e51 100644 --- a/src/request/payment_initiation_payment_reverse.rs +++ b/src/request/payment_initiation_payment_reverse.rs @@ -1,43 +1,113 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{PaymentAmountToRefund, PaymentInitiationAddress}; /**You should use this struct via [`PlaidClient::payment_initiation_payment_reverse`]. On request success, this will return a [`PaymentInitiationPaymentReverseResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct PaymentInitiationPaymentReverseRequest { pub amount: Option, + pub counterparty_address: Option, + pub counterparty_date_of_birth: Option, pub idempotency_key: String, pub payment_id: String, pub reference: String, } -impl PaymentInitiationPaymentReverseRequest {} impl FluentRequest<'_, PaymentInitiationPaymentReverseRequest> { + ///Set the value of the amount field. pub fn amount(mut self, amount: PaymentAmountToRefund) -> Self { self.params.amount = Some(amount); self } + ///Set the value of the counterparty_address field. + pub fn counterparty_address( + mut self, + counterparty_address: PaymentInitiationAddress, + ) -> Self { + self.params.counterparty_address = Some(counterparty_address); + self + } + ///Set the value of the counterparty_date_of_birth field. + pub fn counterparty_date_of_birth( + mut self, + counterparty_date_of_birth: chrono::NaiveDate, + ) -> Self { + self.params.counterparty_date_of_birth = Some(counterparty_date_of_birth); + self + } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationPaymentReverseRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationPaymentReverseResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/payment/reverse"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.amount { - r = r.json(json!({ "amount" : unwrapped })); + r = r.json(serde_json::json!({ "amount" : unwrapped })); } - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); - r = r.json(json!({ "payment_id" : self.params.payment_id })); - r = r.json(json!({ "reference" : self.params.reference })); + if let Some(ref unwrapped) = self.params.counterparty_address { + r = r.json(serde_json::json!({ "counterparty_address" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.counterparty_date_of_birth { + r = r + .json( + serde_json::json!({ "counterparty_date_of_birth" : unwrapped }), + ); + } + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); + r = r.json(serde_json::json!({ "payment_id" : self.params.payment_id })); + r = r.json(serde_json::json!({ "reference" : self.params.reference })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Reverse an existing payment + +Reverse a settled payment from a Plaid virtual account. + +The original payment must be in a settled state to be refunded. +To refund partially, specify the amount as part of the request. +If the amount is not specified, the refund amount will be equal to all +of the remaining payment amount that has not been refunded yet. + +The refund will go back to the source account that initiated the payment. +The original payment must have been initiated to a Plaid virtual account +so that this account can be used to initiate the refund. + +Providing counterparty information such as date of birth and address increases +the likelihood of refund being successful without human intervention. + + +See endpoint docs at .*/ + pub fn payment_initiation_payment_reverse( + &self, + idempotency_key: &str, + payment_id: &str, + reference: &str, + ) -> FluentRequest<'_, PaymentInitiationPaymentReverseRequest> { + FluentRequest { + client: self, + params: PaymentInitiationPaymentReverseRequest { + amount: None, + counterparty_address: None, + counterparty_date_of_birth: None, + idempotency_key: idempotency_key.to_owned(), + payment_id: payment_id.to_owned(), + reference: reference.to_owned(), + }, + } + } +} diff --git a/src/request/payment_initiation_recipient_create.rs b/src/request/payment_initiation_recipient_create.rs index 84bb350f..57f11b7f 100644 --- a/src/request/payment_initiation_recipient_create.rs +++ b/src/request/payment_initiation_recipient_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{PaymentInitiationAddress, RecipientBACSNullable}; /**You should use this struct via [`PlaidClient::payment_initiation_recipient_create`]. On request success, this will return a [`PaymentInitiationRecipientCreateResponse`].*/ @@ -14,16 +12,18 @@ pub struct PaymentInitiationRecipientCreateRequest { pub iban: Option, pub name: String, } -impl PaymentInitiationRecipientCreateRequest {} impl FluentRequest<'_, PaymentInitiationRecipientCreateRequest> { + ///Set the value of the address field. pub fn address(mut self, address: PaymentInitiationAddress) -> Self { self.params.address = Some(address); self } + ///Set the value of the bacs field. pub fn bacs(mut self, bacs: RecipientBacsNullable) -> Self { self.params.bacs = Some(bacs); self } + ///Set the value of the iban field. pub fn iban(mut self, iban: &str) -> Self { self.params.iban = Some(iban.to_owned()); self @@ -31,25 +31,53 @@ impl FluentRequest<'_, PaymentInitiationRecipientCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationRecipientCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationRecipientCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/recipient/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.address { - r = r.json(json!({ "address" : unwrapped })); + r = r.json(serde_json::json!({ "address" : unwrapped })); } if let Some(ref unwrapped) = self.params.bacs { - r = r.json(json!({ "bacs" : unwrapped })); + r = r.json(serde_json::json!({ "bacs" : unwrapped })); } if let Some(ref unwrapped) = self.params.iban { - r = r.json(json!({ "iban" : unwrapped })); + r = r.json(serde_json::json!({ "iban" : unwrapped })); } - r = r.json(json!({ "name" : self.params.name })); + r = r.json(serde_json::json!({ "name" : self.params.name })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create payment recipient + +Create a payment recipient for payment initiation. The recipient must be in Europe, within a country that is a member of the Single Euro Payment Area (SEPA) or a non-Eurozone country [supported](https://plaid.com/global) by Plaid. For a standing order (recurring) payment, the recipient must be in the UK. + +It is recommended to use `bacs` in the UK and `iban` in EU. + +The endpoint is idempotent: if a developer has already made a request with the same payment details, Plaid will return the same `recipient_id`. + + +See endpoint docs at .*/ + pub fn payment_initiation_recipient_create( + &self, + name: &str, + ) -> FluentRequest<'_, PaymentInitiationRecipientCreateRequest> { + FluentRequest { + client: self, + params: PaymentInitiationRecipientCreateRequest { + address: None, + bacs: None, + iban: None, + name: name.to_owned(), + }, + } + } +} diff --git a/src/request/payment_initiation_recipient_get.rs b/src/request/payment_initiation_recipient_get.rs index bc4f3f8a..ad63442c 100644 --- a/src/request/payment_initiation_recipient_get.rs +++ b/src/request/payment_initiation_recipient_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::payment_initiation_recipient_get`]. On request success, this will return a [`PaymentInitiationRecipientGetResponse`].*/ @@ -11,20 +8,39 @@ On request success, this will return a [`PaymentInitiationRecipientGetResponse`] pub struct PaymentInitiationRecipientGetRequest { pub recipient_id: String, } -impl PaymentInitiationRecipientGetRequest {} impl FluentRequest<'_, PaymentInitiationRecipientGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationRecipientGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationRecipientGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/recipient/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "recipient_id" : self.params.recipient_id })); + r = r.json(serde_json::json!({ "recipient_id" : self.params.recipient_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get payment recipient + +Get details about a payment recipient you have previously created. + +See endpoint docs at .*/ + pub fn payment_initiation_recipient_get( + &self, + recipient_id: &str, + ) -> FluentRequest<'_, PaymentInitiationRecipientGetRequest> { + FluentRequest { + client: self, + params: PaymentInitiationRecipientGetRequest { + recipient_id: recipient_id.to_owned(), + }, + } + } +} diff --git a/src/request/payment_initiation_recipient_list.rs b/src/request/payment_initiation_recipient_list.rs index fb660c30..285a2af0 100644 --- a/src/request/payment_initiation_recipient_list.rs +++ b/src/request/payment_initiation_recipient_list.rs @@ -1,28 +1,46 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::payment_initiation_recipient_list`]. On request success, this will return a [`PaymentInitiationRecipientListResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct PaymentInitiationRecipientListRequest {} -impl PaymentInitiationRecipientListRequest {} +pub struct PaymentInitiationRecipientListRequest { + pub body: serde_json::Value, +} impl FluentRequest<'_, PaymentInitiationRecipientListRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentInitiationRecipientListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::PaymentInitiationRecipientListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_initiation/recipient/list"; let mut r = self.client.client.post(url); - r = r.set_query(self.params); + r = r.json(serde_json::json!({ "body" : self.params.body })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List payment recipients + +The `/payment_initiation/recipient/list` endpoint list the payment recipients that you have previously created. + +See endpoint docs at .*/ + pub fn payment_initiation_recipient_list( + &self, + body: serde_json::Value, + ) -> FluentRequest<'_, PaymentInitiationRecipientListRequest> { + FluentRequest { + client: self, + params: PaymentInitiationRecipientListRequest { + body, + }, + } + } +} diff --git a/src/request/payment_profile_create.rs b/src/request/payment_profile_create.rs index 72ccde53..aaf18675 100644 --- a/src/request/payment_profile_create.rs +++ b/src/request/payment_profile_create.rs @@ -1,27 +1,45 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::payment_profile_create`]. On request success, this will return a [`PaymentProfileCreateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct PaymentProfileCreateRequest {} -impl PaymentProfileCreateRequest {} +pub struct PaymentProfileCreateRequest { + pub body: serde_json::Value, +} impl FluentRequest<'_, PaymentProfileCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentProfileCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/payment_profile/create"; let mut r = self.client.client.post(url); - r = r.set_query(self.params); + r = r.json(serde_json::json!({ "body" : self.params.body })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create payment profile + +Use `/payment_profile/create` endpoint to create a new payment profile. +To initiate the account linking experience, call `/link/token/create` and provide the `payment_profile_token` in the `transfer.payment_profile_token` field. +You can then use the `payment_profile_token` when creating transfers using `/transfer/authorization/create` and `/transfer/create`. + +See endpoint docs at .*/ + pub fn payment_profile_create( + &self, + body: serde_json::Value, + ) -> FluentRequest<'_, PaymentProfileCreateRequest> { + FluentRequest { + client: self, + params: PaymentProfileCreateRequest { + body, + }, + } + } +} diff --git a/src/request/payment_profile_get.rs b/src/request/payment_profile_get.rs index 78339889..b9833420 100644 --- a/src/request/payment_profile_get.rs +++ b/src/request/payment_profile_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::payment_profile_get`]. On request success, this will return a [`PaymentProfileGetResponse`].*/ @@ -11,10 +8,9 @@ On request success, this will return a [`PaymentProfileGetResponse`].*/ pub struct PaymentProfileGetRequest { pub payment_profile_token: String, } -impl PaymentProfileGetRequest {} impl FluentRequest<'_, PaymentProfileGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentProfileGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -22,7 +18,7 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentProfileGetReques let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "payment_profile_token" : self.params.payment_profile_token } ), ); @@ -31,4 +27,22 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentProfileGetReques res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get payment profile + +Use `/payment_profile/get` endpoint to get the status of a given Payment Profile. + +See endpoint docs at .*/ + pub fn payment_profile_get( + &self, + payment_profile_token: &str, + ) -> FluentRequest<'_, PaymentProfileGetRequest> { + FluentRequest { + client: self, + params: PaymentProfileGetRequest { + payment_profile_token: payment_profile_token.to_owned(), + }, + } + } +} diff --git a/src/request/payment_profile_remove.rs b/src/request/payment_profile_remove.rs index 694d02d8..8c3d8198 100644 --- a/src/request/payment_profile_remove.rs +++ b/src/request/payment_profile_remove.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::payment_profile_remove`]. On request success, this will return a [`PaymentProfileRemoveResponse`].*/ @@ -11,10 +8,9 @@ On request success, this will return a [`PaymentProfileRemoveResponse`].*/ pub struct PaymentProfileRemoveRequest { pub payment_profile_token: String, } -impl PaymentProfileRemoveRequest {} impl FluentRequest<'_, PaymentProfileRemoveRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentProfileRemoveRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -22,7 +18,7 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentProfileRemoveReq let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "payment_profile_token" : self.params.payment_profile_token } ), ); @@ -31,4 +27,22 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, PaymentProfileRemoveReq res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Remove payment profile + +Use the `/payment_profile/remove` endpoint to remove a given Payment Profile. Once it’s removed, it can no longer be used to create transfers. + +See endpoint docs at .*/ + pub fn payment_profile_remove( + &self, + payment_profile_token: &str, + ) -> FluentRequest<'_, PaymentProfileRemoveRequest> { + FluentRequest { + client: self, + params: PaymentProfileRemoveRequest { + payment_profile_token: payment_profile_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_account_get.rs b/src/request/processor_account_get.rs index c7463705..7d4b3175 100644 --- a/src/request/processor_account_get.rs +++ b/src/request/processor_account_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_account_get`]. On request success, this will return a [`ProcessorAccountGetResponse`].*/ @@ -11,19 +8,44 @@ On request success, this will return a [`ProcessorAccountGetResponse`].*/ pub struct ProcessorAccountGetRequest { pub processor_token: String, } -impl ProcessorAccountGetRequest {} impl FluentRequest<'_, ProcessorAccountGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorAccountGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/account/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve the account associated with a processor token + +This endpoint returns the account associated with a given processor token. + +This endpoint retrieves cached information, rather than extracting fresh information from the institution. As a result, the account balance returned may not be up-to-date; for realtime balance information, use `/processor/balance/get` instead. Note that some information is nullable. + + +See endpoint docs at .*/ + pub fn processor_account_get( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorAccountGetRequest> { + FluentRequest { + client: self, + params: ProcessorAccountGetRequest { + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_apex_processor_token_create.rs b/src/request/processor_apex_processor_token_create.rs index 6c44d835..7642bfa7 100644 --- a/src/request/processor_apex_processor_token_create.rs +++ b/src/request/processor_apex_processor_token_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_apex_processor_token_create`]. On request success, this will return a [`ProcessorTokenCreateResponse`].*/ @@ -12,21 +9,40 @@ pub struct ProcessorApexProcessorTokenCreateRequest { pub access_token: String, pub account_id: String, } -impl ProcessorApexProcessorTokenCreateRequest {} impl FluentRequest<'_, ProcessorApexProcessorTokenCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorApexProcessorTokenCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/apex/processor_token/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create Apex bank account token + +Used to create a token suitable for sending to Apex to enable Plaid-Apex integrations. + +See endpoint docs at .*/ + pub fn processor_apex_processor_token_create( + &self, + access_token: &str, + account_id: &str, + ) -> FluentRequest<'_, ProcessorApexProcessorTokenCreateRequest> { + FluentRequest { + client: self, + params: ProcessorApexProcessorTokenCreateRequest { + access_token: access_token.to_owned(), + account_id: account_id.to_owned(), + }, + } + } +} diff --git a/src/request/processor_auth_get.rs b/src/request/processor_auth_get.rs index 9ef80778..0bb6c384 100644 --- a/src/request/processor_auth_get.rs +++ b/src/request/processor_auth_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_auth_get`]. On request success, this will return a [`ProcessorAuthGetResponse`].*/ @@ -11,19 +8,44 @@ On request success, this will return a [`ProcessorAuthGetResponse`].*/ pub struct ProcessorAuthGetRequest { pub processor_token: String, } -impl ProcessorAuthGetRequest {} impl FluentRequest<'_, ProcessorAuthGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorAuthGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/auth/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve Auth data + +The `/processor/auth/get` endpoint returns the bank account and bank identification number (such as the routing number, for US accounts), for a checking or savings account that''s associated with a given `processor_token`. The endpoint also returns high-level account data and balances when available. + +Versioning note: API versions 2019-05-29 and earlier use a different schema for the `numbers` object returned by this endpoint. For details, see [Plaid API versioning](https://plaid.com/docs/api/versioning/#version-2020-09-14). + + +See endpoint docs at .*/ + pub fn processor_auth_get( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorAuthGetRequest> { + FluentRequest { + client: self, + params: ProcessorAuthGetRequest { + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_balance_get.rs b/src/request/processor_balance_get.rs index 46970525..ef5c304a 100644 --- a/src/request/processor_balance_get.rs +++ b/src/request/processor_balance_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::ProcessorBalanceGetRequestOptions; /**You should use this struct via [`PlaidClient::processor_balance_get`]. On request success, this will return a [`ProcessorBalanceGetResponse`].*/ @@ -12,27 +10,51 @@ pub struct ProcessorBalanceGetRequest { pub options: Option, pub processor_token: String, } -impl ProcessorBalanceGetRequest {} impl FluentRequest<'_, ProcessorBalanceGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: ProcessorBalanceGetRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorBalanceGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/balance/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve Balance data + +The `/processor/balance/get` endpoint returns the real-time balance for each of an Item's accounts. While other endpoints may return a balance object, only `/processor/balance/get` forces the available and current balance fields to be refreshed rather than cached. + +See endpoint docs at .*/ + pub fn processor_balance_get( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorBalanceGetRequest> { + FluentRequest { + client: self, + params: ProcessorBalanceGetRequest { + options: None, + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_bank_transfer_create.rs b/src/request/processor_bank_transfer_create.rs index 0c416a8e..71451040 100644 --- a/src/request/processor_bank_transfer_create.rs +++ b/src/request/processor_bank_transfer_create.rs @@ -1,52 +1,55 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + ACHClass, BankTransferMetadata, BankTransferNetwork, BankTransferType, + BankTransferUser, +}; /**You should use this struct via [`PlaidClient::processor_bank_transfer_create`]. On request success, this will return a [`ProcessorBankTransferCreateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorBankTransferCreateRequest { - pub ach_class: Option, + pub ach_class: Option, pub amount: String, pub custom_tag: Option, pub description: String, pub idempotency_key: String, pub iso_currency_code: String, pub metadata: Option, - pub network: String, + pub network: BankTransferNetwork, pub origination_account_id: Option, pub processor_token: String, - pub type_: String, + pub type_: BankTransferType, pub user: BankTransferUser, } -impl ProcessorBankTransferCreateRequest {} pub struct ProcessorBankTransferCreateRequired<'a> { pub amount: &'a str, pub description: &'a str, pub idempotency_key: &'a str, pub iso_currency_code: &'a str, - pub network: &'a str, + pub network: BankTransferNetwork, pub processor_token: &'a str, - pub type_: &'a str, + pub type_: BankTransferType, pub user: BankTransferUser, } -impl<'a> ProcessorBankTransferCreateRequired<'a> {} impl FluentRequest<'_, ProcessorBankTransferCreateRequest> { - pub fn ach_class(mut self, ach_class: &str) -> Self { - self.params.ach_class = Some(ach_class.to_owned()); + ///Set the value of the ach_class field. + pub fn ach_class(mut self, ach_class: AchClass) -> Self { + self.params.ach_class = Some(ach_class); self } + ///Set the value of the custom_tag field. pub fn custom_tag(mut self, custom_tag: &str) -> Self { self.params.custom_tag = Some(custom_tag.to_owned()); self } + ///Set the value of the metadata field. pub fn metadata(mut self, metadata: BankTransferMetadata) -> Self { self.params.metadata = Some(metadata); self } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self @@ -54,35 +57,81 @@ impl FluentRequest<'_, ProcessorBankTransferCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorBankTransferCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorBankTransferCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/bank_transfer/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.ach_class { - r = r.json(json!({ "ach_class" : unwrapped })); + r = r.json(serde_json::json!({ "ach_class" : unwrapped })); } - r = r.json(json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); if let Some(ref unwrapped) = self.params.custom_tag { - r = r.json(json!({ "custom_tag" : unwrapped })); + r = r.json(serde_json::json!({ "custom_tag" : unwrapped })); } - r = r.json(json!({ "description" : self.params.description })); - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); - r = r.json(json!({ "iso_currency_code" : self.params.iso_currency_code })); + r = r.json(serde_json::json!({ "description" : self.params.description })); + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); + r = r + .json( + serde_json::json!( + { "iso_currency_code" : self.params.iso_currency_code } + ), + ); if let Some(ref unwrapped) = self.params.metadata { - r = r.json(json!({ "metadata" : unwrapped })); + r = r.json(serde_json::json!({ "metadata" : unwrapped })); } - r = r.json(json!({ "network" : self.params.network })); + r = r.json(serde_json::json!({ "network" : self.params.network })); if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } - r = r.json(json!({ "processor_token" : self.params.processor_token })); - r = r.json(json!({ "type" : self.params.type_ })); - r = r.json(json!({ "user" : self.params.user })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); + r = r.json(serde_json::json!({ "type" : self.params.type_ })); + r = r.json(serde_json::json!({ "user" : self.params.user })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a bank transfer as a processor + +Use the `/processor/bank_transfer/create` endpoint to initiate a new bank transfer as a processor + +See endpoint docs at .*/ + pub fn processor_bank_transfer_create( + &self, + args: ProcessorBankTransferCreateRequired, + ) -> FluentRequest<'_, ProcessorBankTransferCreateRequest> { + FluentRequest { + client: self, + params: ProcessorBankTransferCreateRequest { + ach_class: None, + amount: args.amount.to_owned(), + custom_tag: None, + description: args.description.to_owned(), + idempotency_key: args.idempotency_key.to_owned(), + iso_currency_code: args.iso_currency_code.to_owned(), + metadata: None, + network: args.network, + origination_account_id: None, + processor_token: args.processor_token.to_owned(), + type_: args.type_, + user: args.user, + }, + } + } +} diff --git a/src/request/processor_identity_get.rs b/src/request/processor_identity_get.rs index 059ca4cb..68964e4c 100644 --- a/src/request/processor_identity_get.rs +++ b/src/request/processor_identity_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_identity_get`]. On request success, this will return a [`ProcessorIdentityGetResponse`].*/ @@ -11,19 +8,41 @@ On request success, this will return a [`ProcessorIdentityGetResponse`].*/ pub struct ProcessorIdentityGetRequest { pub processor_token: String, } -impl ProcessorIdentityGetRequest {} impl FluentRequest<'_, ProcessorIdentityGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorIdentityGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/identity/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve Identity data + +The `/processor/identity/get` endpoint allows you to retrieve various account holder information on file with the financial institution, including names, emails, phone numbers, and addresses. + +See endpoint docs at .*/ + pub fn processor_identity_get( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorIdentityGetRequest> { + FluentRequest { + client: self, + params: ProcessorIdentityGetRequest { + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_identity_match.rs b/src/request/processor_identity_match.rs index 6afba371..351dc065 100644 --- a/src/request/processor_identity_match.rs +++ b/src/request/processor_identity_match.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::IdentityMatchUser; /**You should use this struct via [`PlaidClient::processor_identity_match`]. On request success, this will return a [`ProcessorIdentityMatchResponse`].*/ @@ -12,27 +10,55 @@ pub struct ProcessorIdentityMatchRequest { pub processor_token: String, pub user: Option, } -impl ProcessorIdentityMatchRequest {} impl FluentRequest<'_, ProcessorIdentityMatchRequest> { + ///Set the value of the user field. pub fn user(mut self, user: IdentityMatchUser) -> Self { self.params.user = Some(user); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorIdentityMatchRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorIdentityMatchResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/identity/match"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); if let Some(ref unwrapped) = self.params.user { - r = r.json(json!({ "user" : unwrapped })); + r = r.json(serde_json::json!({ "user" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve identity match score + +The `/processor/identity/match` endpoint generates a match score, which indicates how well the provided identity data matches the identity information on file with the account holder's financial institution. + +Fields within the `balances` object will always be null when retrieved by `/identity/match`. Instead, use the free `/accounts/get` endpoint to request balance cached data, or `/accounts/balance/get` for real-time data. + +See endpoint docs at .*/ + pub fn processor_identity_match( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorIdentityMatchRequest> { + FluentRequest { + client: self, + params: ProcessorIdentityMatchRequest { + processor_token: processor_token.to_owned(), + user: None, + }, + } + } +} diff --git a/src/request/processor_liabilities_get.rs b/src/request/processor_liabilities_get.rs index 68cd1f5f..b8a421f7 100644 --- a/src/request/processor_liabilities_get.rs +++ b/src/request/processor_liabilities_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_liabilities_get`]. On request success, this will return a [`ProcessorLiabilitiesGetResponse`].*/ @@ -11,20 +8,48 @@ On request success, this will return a [`ProcessorLiabilitiesGetResponse`].*/ pub struct ProcessorLiabilitiesGetRequest { pub processor_token: String, } -impl ProcessorLiabilitiesGetRequest {} impl FluentRequest<'_, ProcessorLiabilitiesGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorLiabilitiesGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorLiabilitiesGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/liabilities/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve Liabilities data + +The `/processor/liabilities/get` endpoint returns various details about a loan or credit account. Liabilities data is available primarily for US financial institutions, with some limited coverage of Canadian institutions. Currently supported account types are account type `credit` with account subtype `credit card` or `paypal`, and account type `loan` with account subtype `student` or `mortgage`. + +The types of information returned by Liabilities can include balances and due dates, loan terms, and account details such as original loan amount and guarantor. Data is refreshed approximately once per day; the latest data can be retrieved by calling `/processor/liabilities/get`. + +Note: This request may take some time to complete if `liabilities` was not specified as an initial product when creating the processor token. This is because Plaid must communicate directly with the institution to retrieve the additional data. + +See endpoint docs at .*/ + pub fn processor_liabilities_get( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorLiabilitiesGetRequest> { + FluentRequest { + client: self, + params: ProcessorLiabilitiesGetRequest { + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_signal_decision_report.rs b/src/request/processor_signal_decision_report.rs index 26f5e4b0..84c1ba70 100644 --- a/src/request/processor_signal_decision_report.rs +++ b/src/request/processor_signal_decision_report.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{SignalDecisionOutcome, SignalPaymentMethod}; /**You should use this struct via [`PlaidClient::processor_signal_decision_report`]. On request success, this will return a [`ProcessorSignalDecisionReportResponse`].*/ @@ -12,13 +10,13 @@ pub struct ProcessorSignalDecisionReportRequest { pub amount_instantly_available: Option, pub client_transaction_id: String, pub days_funds_on_hold: Option, - pub decision_outcome: Option, + pub decision_outcome: Option, pub initiated: bool, - pub payment_method: Option, + pub payment_method: Option, pub processor_token: String, } -impl ProcessorSignalDecisionReportRequest {} impl FluentRequest<'_, ProcessorSignalDecisionReportRequest> { + ///Set the value of the amount_instantly_available field. pub fn amount_instantly_available( mut self, amount_instantly_available: f64, @@ -26,50 +24,91 @@ impl FluentRequest<'_, ProcessorSignalDecisionReportRequest> { self.params.amount_instantly_available = Some(amount_instantly_available); self } + ///Set the value of the days_funds_on_hold field. pub fn days_funds_on_hold(mut self, days_funds_on_hold: i64) -> Self { self.params.days_funds_on_hold = Some(days_funds_on_hold); self } - pub fn decision_outcome(mut self, decision_outcome: &str) -> Self { - self.params.decision_outcome = Some(decision_outcome.to_owned()); + ///Set the value of the decision_outcome field. + pub fn decision_outcome(mut self, decision_outcome: SignalDecisionOutcome) -> Self { + self.params.decision_outcome = Some(decision_outcome); self } - pub fn payment_method(mut self, payment_method: &str) -> Self { - self.params.payment_method = Some(payment_method.to_owned()); + ///Set the value of the payment_method field. + pub fn payment_method(mut self, payment_method: SignalPaymentMethod) -> Self { + self.params.payment_method = Some(payment_method); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorSignalDecisionReportRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorSignalDecisionReportResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/signal/decision/report"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.amount_instantly_available { - r = r.json(json!({ "amount_instantly_available" : unwrapped })); + r = r + .json( + serde_json::json!({ "amount_instantly_available" : unwrapped }), + ); } r = r .json( - json!( + serde_json::json!( { "client_transaction_id" : self.params.client_transaction_id } ), ); if let Some(ref unwrapped) = self.params.days_funds_on_hold { - r = r.json(json!({ "days_funds_on_hold" : unwrapped })); + r = r.json(serde_json::json!({ "days_funds_on_hold" : unwrapped })); } if let Some(ref unwrapped) = self.params.decision_outcome { - r = r.json(json!({ "decision_outcome" : unwrapped })); + r = r.json(serde_json::json!({ "decision_outcome" : unwrapped })); } - r = r.json(json!({ "initiated" : self.params.initiated })); + r = r.json(serde_json::json!({ "initiated" : self.params.initiated })); if let Some(ref unwrapped) = self.params.payment_method { - r = r.json(json!({ "payment_method" : unwrapped })); + r = r.json(serde_json::json!({ "payment_method" : unwrapped })); } - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Report whether you initiated an ACH transaction + +After calling `/processor/signal/evaluate`, call `/processor/signal/decision/report` to report whether the transaction was initiated. + +If you are using the [Plaid Transfer product](https://www.plaid.com/docs/transfer) to create transfers, it is not necessary to use this endpoint, as Plaid already knows whether the transfer was initiated. + +See endpoint docs at .*/ + pub fn processor_signal_decision_report( + &self, + client_transaction_id: &str, + initiated: bool, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorSignalDecisionReportRequest> { + FluentRequest { + client: self, + params: ProcessorSignalDecisionReportRequest { + amount_instantly_available: None, + client_transaction_id: client_transaction_id.to_owned(), + days_funds_on_hold: None, + decision_outcome: None, + initiated, + payment_method: None, + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_signal_evaluate.rs b/src/request/processor_signal_evaluate.rs index 228929d5..4d10b259 100644 --- a/src/request/processor_signal_evaluate.rs +++ b/src/request/processor_signal_evaluate.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{SignalDevice, SignalUser}; /**You should use this struct via [`PlaidClient::processor_signal_evaluate`]. On request success, this will return a [`ProcessorSignalEvaluateResponse`].*/ @@ -16,31 +14,42 @@ pub struct ProcessorSignalEvaluateRequest { pub device: Option, pub is_recurring: Option, pub processor_token: String, + pub ruleset_key: Option, pub user: Option, pub user_present: Option, } -impl ProcessorSignalEvaluateRequest {} impl FluentRequest<'_, ProcessorSignalEvaluateRequest> { + ///Set the value of the client_user_id field. pub fn client_user_id(mut self, client_user_id: &str) -> Self { self.params.client_user_id = Some(client_user_id.to_owned()); self } + ///Set the value of the default_payment_method field. pub fn default_payment_method(mut self, default_payment_method: &str) -> Self { self.params.default_payment_method = Some(default_payment_method.to_owned()); self } + ///Set the value of the device field. pub fn device(mut self, device: SignalDevice) -> Self { self.params.device = Some(device); self } + ///Set the value of the is_recurring field. pub fn is_recurring(mut self, is_recurring: bool) -> Self { self.params.is_recurring = Some(is_recurring); self } + ///Set the value of the ruleset_key field. + pub fn ruleset_key(mut self, ruleset_key: &str) -> Self { + self.params.ruleset_key = Some(ruleset_key.to_owned()); + self + } + ///Set the value of the user field. pub fn user(mut self, user: SignalUser) -> Self { self.params.user = Some(user); self } + ///Set the value of the user_present field. pub fn user_present(mut self, user_present: bool) -> Self { self.params.user_present = Some(user_present); self @@ -48,41 +57,84 @@ impl FluentRequest<'_, ProcessorSignalEvaluateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorSignalEvaluateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorSignalEvaluateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/signal/evaluate"; let mut r = self.client.client.post(url); - r = r.json(json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); r = r .json( - json!( + serde_json::json!( { "client_transaction_id" : self.params.client_transaction_id } ), ); if let Some(ref unwrapped) = self.params.client_user_id { - r = r.json(json!({ "client_user_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.default_payment_method { - r = r.json(json!({ "default_payment_method" : unwrapped })); + r = r.json(serde_json::json!({ "default_payment_method" : unwrapped })); } if let Some(ref unwrapped) = self.params.device { - r = r.json(json!({ "device" : unwrapped })); + r = r.json(serde_json::json!({ "device" : unwrapped })); } if let Some(ref unwrapped) = self.params.is_recurring { - r = r.json(json!({ "is_recurring" : unwrapped })); + r = r.json(serde_json::json!({ "is_recurring" : unwrapped })); + } + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); + if let Some(ref unwrapped) = self.params.ruleset_key { + r = r.json(serde_json::json!({ "ruleset_key" : unwrapped })); } - r = r.json(json!({ "processor_token" : self.params.processor_token })); if let Some(ref unwrapped) = self.params.user { - r = r.json(json!({ "user" : unwrapped })); + r = r.json(serde_json::json!({ "user" : unwrapped })); } if let Some(ref unwrapped) = self.params.user_present { - r = r.json(json!({ "user_present" : unwrapped })); + r = r.json(serde_json::json!({ "user_present" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Evaluate a planned ACH transaction + +Use `/processor/signal/evaluate` to evaluate a planned ACH transaction as a processor to get a return risk assessment (such as a risk score and risk tier) and additional risk signals. + +In order to obtain a valid score for an ACH transaction, Plaid must have an access token for the account, and the Item must be healthy (receiving product updates) or have recently been in a healthy state. If the transaction does not meet eligibility requirements, an error will be returned corresponding to the underlying cause. If `/processor/signal/evaluate` is called on the same transaction multiple times within a 24-hour period, cached results may be returned. For more information please refer to our error documentation on [item errors](/docs/errors/item/) and [Link in Update Mode](/docs/link/update-mode/). + +Note: This request may take some time to complete if Signal is being added to an existing Item. This is because Plaid must communicate directly with the institution when retrieving the data for the first time. To reduce this latency, you can call `/signal/prepare` on the Item before you need to request Signal data. + +See endpoint docs at .*/ + pub fn processor_signal_evaluate( + &self, + amount: f64, + client_transaction_id: &str, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorSignalEvaluateRequest> { + FluentRequest { + client: self, + params: ProcessorSignalEvaluateRequest { + amount, + client_transaction_id: client_transaction_id.to_owned(), + client_user_id: None, + default_payment_method: None, + device: None, + is_recurring: None, + processor_token: processor_token.to_owned(), + ruleset_key: None, + user: None, + user_present: None, + }, + } + } +} diff --git a/src/request/processor_signal_prepare.rs b/src/request/processor_signal_prepare.rs index 0c48ba7d..957c4699 100644 --- a/src/request/processor_signal_prepare.rs +++ b/src/request/processor_signal_prepare.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_signal_prepare`]. On request success, this will return a [`ProcessorSignalPrepareResponse`].*/ @@ -11,19 +8,45 @@ On request success, this will return a [`ProcessorSignalPrepareResponse`].*/ pub struct ProcessorSignalPrepareRequest { pub processor_token: String, } -impl ProcessorSignalPrepareRequest {} impl FluentRequest<'_, ProcessorSignalPrepareRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorSignalPrepareRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorSignalPrepareResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/signal/prepare"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Opt-in a processor token to Signal + +When a processor token is not initialized with Signal, call `/processor/signal/prepare` to opt-in that processor token to the Signal data collection process, which will improve the accuracy of the Signal score. + +If this endpoint is called with a processor token that is already initialized with Signal, it will return a 200 response and will not modify the processor token. + +See endpoint docs at .*/ + pub fn processor_signal_prepare( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorSignalPrepareRequest> { + FluentRequest { + client: self, + params: ProcessorSignalPrepareRequest { + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_signal_return_report.rs b/src/request/processor_signal_return_report.rs index db504597..0de395be 100644 --- a/src/request/processor_signal_return_report.rs +++ b/src/request/processor_signal_return_report.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_signal_return_report`]. On request success, this will return a [`ProcessorSignalReturnReportResponse`].*/ @@ -14,8 +11,8 @@ pub struct ProcessorSignalReturnReportRequest { pub return_code: String, pub returned_at: Option>, } -impl ProcessorSignalReturnReportRequest {} impl FluentRequest<'_, ProcessorSignalReturnReportRequest> { + ///Set the value of the returned_at field. pub fn returned_at(mut self, returned_at: chrono::DateTime) -> Self { self.params.returned_at = Some(returned_at); self @@ -23,7 +20,9 @@ impl FluentRequest<'_, ProcessorSignalReturnReportRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorSignalReturnReportRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorSignalReturnReportResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -31,18 +30,48 @@ for FluentRequest<'a, ProcessorSignalReturnReportRequest> { let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "client_transaction_id" : self.params.client_transaction_id } ), ); - r = r.json(json!({ "processor_token" : self.params.processor_token })); - r = r.json(json!({ "return_code" : self.params.return_code })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); + r = r.json(serde_json::json!({ "return_code" : self.params.return_code })); if let Some(ref unwrapped) = self.params.returned_at { - r = r.json(json!({ "returned_at" : unwrapped })); + r = r.json(serde_json::json!({ "returned_at" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Report a return for an ACH transaction + +Call the `/processor/signal/return/report` endpoint to report a returned transaction that was previously sent to the `/processor/signal/evaluate` endpoint. Your feedback will be used by the model to incorporate the latest risk trend in your portfolio. + +If you are using the [Plaid Transfer product](https://www.plaid.com/docs/transfer) to create transfers, it is not necessary to use this endpoint, as Plaid already knows whether the transfer was returned. + +See endpoint docs at .*/ + pub fn processor_signal_return_report( + &self, + client_transaction_id: &str, + processor_token: &str, + return_code: &str, + ) -> FluentRequest<'_, ProcessorSignalReturnReportRequest> { + FluentRequest { + client: self, + params: ProcessorSignalReturnReportRequest { + client_transaction_id: client_transaction_id.to_owned(), + processor_token: processor_token.to_owned(), + return_code: return_code.to_owned(), + returned_at: None, + }, + } + } +} diff --git a/src/request/processor_stripe_bank_account_token_create.rs b/src/request/processor_stripe_bank_account_token_create.rs index 2a5063cb..5513886a 100644 --- a/src/request/processor_stripe_bank_account_token_create.rs +++ b/src/request/processor_stripe_bank_account_token_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_stripe_bank_account_token_create`]. On request success, this will return a [`ProcessorStripeBankAccountTokenCreateResponse`].*/ @@ -12,23 +9,47 @@ pub struct ProcessorStripeBankAccountTokenCreateRequest { pub access_token: String, pub account_id: String, } -impl ProcessorStripeBankAccountTokenCreateRequest {} impl FluentRequest<'_, ProcessorStripeBankAccountTokenCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorStripeBankAccountTokenCreateRequest> { type Output = httpclient::InMemoryResult< - ProcessorStripeBankAccountTokenCreateResponse, + crate::model::ProcessorStripeBankAccountTokenCreateResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/stripe/bank_account_token/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create Stripe bank account token + + +Used to create a token suitable for sending to Stripe to enable Plaid-Stripe integrations. For a detailed guide on integrating Stripe, see [Add Stripe to your app](https://plaid.com/docs/auth/partnerships/stripe/). + +Note that the Stripe bank account token is a one-time use token. To store bank account information for later use, you can use a Stripe customer object and create an associated bank account from the token, or you can use a Stripe Custom account and create an associated external bank account from the token. This bank account information should work indefinitely, unless the user's bank account information changes or they revoke Plaid's permissions to access their account. Stripe bank account information cannot be modified once the bank account token has been created. If you ever need to change the bank account details used by Stripe for a specific customer, have the user go through Link again and create a new bank account token from the new `access_token`. + +To revoke a bank account token, the entire underlying access token must be revoked using `/item/remove`. + +See endpoint docs at .*/ + pub fn processor_stripe_bank_account_token_create( + &self, + access_token: &str, + account_id: &str, + ) -> FluentRequest<'_, ProcessorStripeBankAccountTokenCreateRequest> { + FluentRequest { + client: self, + params: ProcessorStripeBankAccountTokenCreateRequest { + access_token: access_token.to_owned(), + account_id: account_id.to_owned(), + }, + } + } +} diff --git a/src/request/processor_token_create.rs b/src/request/processor_token_create.rs index cbb2b204..faf01461 100644 --- a/src/request/processor_token_create.rs +++ b/src/request/processor_token_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_token_create`]. On request success, this will return a [`ProcessorTokenCreateResponse`].*/ @@ -13,21 +10,42 @@ pub struct ProcessorTokenCreateRequest { pub account_id: String, pub processor: String, } -impl ProcessorTokenCreateRequest {} impl FluentRequest<'_, ProcessorTokenCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorTokenCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/token/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); - r = r.json(json!({ "processor" : self.params.processor })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "processor" : self.params.processor })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create processor token + +Used to create a token suitable for sending to one of Plaid's partners to enable integrations. Note that Stripe partnerships use bank account tokens instead; see `/processor/stripe/bank_account_token/create` for creating tokens for use with Stripe integrations. If using multiple processors, multiple different processor tokens can be created for a single access token. Once created, a processor token for a given Item cannot be modified or updated. To revoke the processor's access, the entire Item must be deleted by calling `/item/remove`. + +See endpoint docs at .*/ + pub fn processor_token_create( + &self, + access_token: &str, + account_id: &str, + processor: &str, + ) -> FluentRequest<'_, ProcessorTokenCreateRequest> { + FluentRequest { + client: self, + params: ProcessorTokenCreateRequest { + access_token: access_token.to_owned(), + account_id: account_id.to_owned(), + processor: processor.to_owned(), + }, + } + } +} diff --git a/src/request/processor_token_permissions_get.rs b/src/request/processor_token_permissions_get.rs index 3cde9681..d063e8a6 100644 --- a/src/request/processor_token_permissions_get.rs +++ b/src/request/processor_token_permissions_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_token_permissions_get`]. On request success, this will return a [`ProcessorTokenPermissionsGetResponse`].*/ @@ -11,20 +8,44 @@ On request success, this will return a [`ProcessorTokenPermissionsGetResponse`]. pub struct ProcessorTokenPermissionsGetRequest { pub processor_token: String, } -impl ProcessorTokenPermissionsGetRequest {} impl FluentRequest<'_, ProcessorTokenPermissionsGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorTokenPermissionsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorTokenPermissionsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/token/permissions/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get a processor token's product permissions + +Used to get a processor token's product permissions. The `products` field will be an empty list if the processor can access all available products. + +See endpoint docs at .*/ + pub fn processor_token_permissions_get( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorTokenPermissionsGetRequest> { + FluentRequest { + client: self, + params: ProcessorTokenPermissionsGetRequest { + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_token_permissions_set.rs b/src/request/processor_token_permissions_set.rs index 3e0a13cf..92d182c7 100644 --- a/src/request/processor_token_permissions_set.rs +++ b/src/request/processor_token_permissions_set.rs @@ -1,32 +1,56 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::Products; /**You should use this struct via [`PlaidClient::processor_token_permissions_set`]. On request success, this will return a [`ProcessorTokenPermissionsSetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProcessorTokenPermissionsSetRequest { pub processor_token: String, - pub products: Vec, + pub products: Vec, } -impl ProcessorTokenPermissionsSetRequest {} impl FluentRequest<'_, ProcessorTokenPermissionsSetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorTokenPermissionsSetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorTokenPermissionsSetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/token/permissions/set"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); - r = r.json(json!({ "products" : self.params.products })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); + r = r.json(serde_json::json!({ "products" : self.params.products })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Control a processor's access to products + +Used to control a processor's access to products on the given processor token. By default, a processor will have access to all available products on the corresponding item. To restrict access to a particular set of products, call this endpoint with the desired products. To restore access to all available products, call this endpoint with an empty list. This endpoint can be called multiple times as your needs and your processor's needs change. + +See endpoint docs at .*/ + pub fn processor_token_permissions_set( + &self, + processor_token: &str, + products: Vec, + ) -> FluentRequest<'_, ProcessorTokenPermissionsSetRequest> { + FluentRequest { + client: self, + params: ProcessorTokenPermissionsSetRequest { + processor_token: processor_token.to_owned(), + products, + }, + } + } +} diff --git a/src/request/processor_token_webhook_update.rs b/src/request/processor_token_webhook_update.rs index d65f351d..34ee59f7 100644 --- a/src/request/processor_token_webhook_update.rs +++ b/src/request/processor_token_webhook_update.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_token_webhook_update`]. On request success, this will return a [`ProcessorTokenWebhookUpdateResponse`].*/ @@ -12,8 +9,8 @@ pub struct ProcessorTokenWebhookUpdateRequest { pub processor_token: String, pub webhook: Option, } -impl ProcessorTokenWebhookUpdateRequest {} impl FluentRequest<'_, ProcessorTokenWebhookUpdateRequest> { + ///Set the value of the webhook field. pub fn webhook(mut self, webhook: &str) -> Self { self.params.webhook = Some(webhook.to_owned()); self @@ -21,19 +18,45 @@ impl FluentRequest<'_, ProcessorTokenWebhookUpdateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorTokenWebhookUpdateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorTokenWebhookUpdateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/token/webhook/update"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); if let Some(ref unwrapped) = self.params.webhook { - r = r.json(json!({ "webhook" : unwrapped })); + r = r.json(serde_json::json!({ "webhook" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update a processor token's webhook URL + +This endpoint allows you, the processor, to update the webhook URL associated with a processor token. This request triggers a `WEBHOOK_UPDATE_ACKNOWLEDGED` webhook to the newly specified webhook URL. + +See endpoint docs at .*/ + pub fn processor_token_webhook_update( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorTokenWebhookUpdateRequest> { + FluentRequest { + client: self, + params: ProcessorTokenWebhookUpdateRequest { + processor_token: processor_token.to_owned(), + webhook: None, + }, + } + } +} diff --git a/src/request/processor_transactions_get.rs b/src/request/processor_transactions_get.rs index deee7d77..039ca501 100644 --- a/src/request/processor_transactions_get.rs +++ b/src/request/processor_transactions_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::ProcessorTransactionsGetRequestOptions; /**You should use this struct via [`PlaidClient::processor_transactions_get`]. On request success, this will return a [`ProcessorTransactionsGetResponse`].*/ @@ -14,8 +12,8 @@ pub struct ProcessorTransactionsGetRequest { pub processor_token: String, pub start_date: chrono::NaiveDate, } -impl ProcessorTransactionsGetRequest {} impl FluentRequest<'_, ProcessorTransactionsGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: ProcessorTransactionsGetRequestOptions) -> Self { self.params.options = Some(options); self @@ -23,21 +21,61 @@ impl FluentRequest<'_, ProcessorTransactionsGetRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorTransactionsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorTransactionsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/transactions/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "end_date" : self.params.end_date })); + r = r.json(serde_json::json!({ "end_date" : self.params.end_date })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "processor_token" : self.params.processor_token })); - r = r.json(json!({ "start_date" : self.params.start_date })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); + r = r.json(serde_json::json!({ "start_date" : self.params.start_date })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get transaction data + +The `/processor/transactions/get` endpoint allows developers to receive user-authorized transaction data for credit, depository, and some loan-type accounts (only those with account subtype `student`; coverage may be limited). Transaction data is standardized across financial institutions, and in many cases transactions are linked to a clean name, entity type, location, and category. Similarly, account data is standardized and returned with a clean name, number, balance, and other meta information where available. + +Transactions are returned in reverse-chronological order, and the sequence of transaction ordering is stable and will not shift. Transactions are not immutable and can also be removed altogether by the institution; a removed transaction will no longer appear in `/processor/transactions/get`. For more details, see [Pending and posted transactions](https://plaid.com/docs/transactions/transactions-data/#pending-and-posted-transactions). + +Due to the potentially large number of transactions associated with a processor token, results are paginated. Manipulate the `count` and `offset` parameters in conjunction with the `total_transactions` response body field to fetch all available transactions. + +Data returned by `/processor/transactions/get` will be the data available for the processor token as of the most recent successful check for new transactions. Plaid typically checks for new data multiple times a day, but these checks may occur less frequently, such as once a day, depending on the institution. To force Plaid to check for new transactions, you can use the `/processor/transactions/refresh` endpoint. + +Note that data may not be immediately available to `/processor/transactions/get`. Plaid will begin to prepare transactions data upon Item link, if Link was initialized with `transactions`, or upon the first call to `/processor/transactions/get`, if it wasn't. If no transaction history is ready when `/processor/transactions/get` is called, it will return a `PRODUCT_NOT_READY` error. + +To receive Transactions webhooks for a processor token, set its webhook URL via the [`/processor/token/webhook/update`](https://plaid.com/docs/api/processor-partners/#processortokenwebhookupdate) endpoint. + +See endpoint docs at .*/ + pub fn processor_transactions_get( + &self, + end_date: chrono::NaiveDate, + processor_token: &str, + start_date: chrono::NaiveDate, + ) -> FluentRequest<'_, ProcessorTransactionsGetRequest> { + FluentRequest { + client: self, + params: ProcessorTransactionsGetRequest { + end_date, + options: None, + processor_token: processor_token.to_owned(), + start_date, + }, + } + } +} diff --git a/src/request/processor_transactions_recurring_get.rs b/src/request/processor_transactions_recurring_get.rs index d80dff7d..8a07f9d3 100644 --- a/src/request/processor_transactions_recurring_get.rs +++ b/src/request/processor_transactions_recurring_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransactionsRecurringGetRequestOptions; /**You should use this struct via [`PlaidClient::processor_transactions_recurring_get`]. On request success, this will return a [`ProcessorTransactionsRecurringGetResponse`].*/ @@ -12,8 +10,8 @@ pub struct ProcessorTransactionsRecurringGetRequest { pub options: Option, pub processor_token: String, } -impl ProcessorTransactionsRecurringGetRequest {} impl FluentRequest<'_, ProcessorTransactionsRecurringGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: TransactionsRecurringGetRequestOptions) -> Self { self.params.options = Some(options); self @@ -21,19 +19,53 @@ impl FluentRequest<'_, ProcessorTransactionsRecurringGetRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorTransactionsRecurringGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorTransactionsRecurringGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/transactions/recurring/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Fetch recurring transaction streams + +The `/processor/transactions/recurring/get` endpoint allows developers to receive a summary of the recurring outflow and inflow streams (expenses and deposits) from a user’s checking, savings or credit card accounts. Additionally, Plaid provides key insights about each recurring stream including the category, merchant, last amount, and more. Developers can use these insights to build tools and experiences that help their users better manage cash flow, monitor subscriptions, reduce spend, and stay on track with bill payments. + +This endpoint is offered as an add-on to Transactions. To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. + +This endpoint can only be called on a processor token that has already been initialized with Transactions (either during Link, by specifying it in `/link/token/create`; or after Link, by calling `/processor/transactions/get` or `/processor/transactions/sync`). Once all historical transactions have been fetched, call `/processor/transactions/recurring/get` to receive the Recurring Transactions streams and subscribe to the [`RECURRING_TRANSACTIONS_UPDATE`](https://plaid.com/docs/api/products/transactions/#recurring_transactions_update) webhook. To know when historical transactions have been fetched, if you are using `/processor/transactions/sync` listen for the [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#SyncUpdatesAvailableWebhook-historical-update-complete) webhook and check that the `historical_update_complete` field in the payload is `true`. If using `/processor/transactions/get`, listen for the [`HISTORICAL_UPDATE`](https://plaid.com/docs/api/products/transactions/#historical_update) webhook. + +After the initial call, you can call `/processor/transactions/recurring/get` endpoint at any point in the future to retrieve the latest summary of recurring streams. Listen to the [`RECURRING_TRANSACTIONS_UPDATE`](https://plaid.com/docs/api/products/transactions/#recurring_transactions_update) webhook to be notified when new updates are available. + +To receive Transactions webhooks for a processor token, set its webhook URL via the [`/processor/token/webhook/update`](https://plaid.com/docs/api/processor-partners/#processortokenwebhookupdate) endpoint. + +See endpoint docs at .*/ + pub fn processor_transactions_recurring_get( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorTransactionsRecurringGetRequest> { + FluentRequest { + client: self, + params: ProcessorTransactionsRecurringGetRequest { + options: None, + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_transactions_refresh.rs b/src/request/processor_transactions_refresh.rs index 3ba81731..795a3b54 100644 --- a/src/request/processor_transactions_refresh.rs +++ b/src/request/processor_transactions_refresh.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::processor_transactions_refresh`]. On request success, this will return a [`ProcessorTransactionsRefreshResponse`].*/ @@ -11,20 +8,48 @@ On request success, this will return a [`ProcessorTransactionsRefreshResponse`]. pub struct ProcessorTransactionsRefreshRequest { pub processor_token: String, } -impl ProcessorTransactionsRefreshRequest {} impl FluentRequest<'_, ProcessorTransactionsRefreshRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorTransactionsRefreshRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorTransactionsRefreshResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/transactions/refresh"; let mut r = self.client.client.post(url); - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Refresh transaction data + +`/processor/transactions/refresh` is an optional endpoint for users of the Transactions product. It initiates an on-demand extraction to fetch the newest transactions for a processor token. This on-demand extraction takes place in addition to the periodic extractions that automatically occur one or more times per day for any Transactions-enabled processor token. If changes to transactions are discovered after calling `/processor/transactions/refresh`, Plaid will fire a webhook: for `/transactions/sync` users, [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#sync_updates_available) will be fired if there are any transactions updated, added, or removed. For users of both `/processor/transactions/sync` and `/processor/transactions/get`, [`TRANSACTIONS_REMOVED`](https://plaid.com/docs/api/products/transactions/#transactions_removed) will be fired if any removed transactions are detected, and [`DEFAULT_UPDATE`](https://plaid.com/docs/api/products/transactions/#default_update) will be fired if any new transactions are detected. New transactions can be fetched by calling `/processor/transactions/get` or `/processor/transactions/sync`. Note that the `/transactions/refresh` endpoint is not supported for Capital One (`ins_128026`) non-depository accounts and will result in a `PRODUCTS_NOT_SUPPORTED` error if called on an Item that contains only non-depository accounts from that institution. + +As this endpoint triggers a synchronous request for fresh data, latency may be higher than for other Plaid endpoints (typically less than 10 seconds, but occasionally up to 30 seconds or more); if you encounter errors, you may find it necessary to adjust your timeout period when making requests. + +`/processor/transactions/refresh` is offered as an add-on to Transactions and has a separate [fee model](/docs/account/billing/#per-request-flat-fee). To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. + +See endpoint docs at .*/ + pub fn processor_transactions_refresh( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorTransactionsRefreshRequest> { + FluentRequest { + client: self, + params: ProcessorTransactionsRefreshRequest { + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/processor_transactions_sync.rs b/src/request/processor_transactions_sync.rs index 93bbf3f6..b26c4b7f 100644 --- a/src/request/processor_transactions_sync.rs +++ b/src/request/processor_transactions_sync.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransactionsSyncRequestOptions; /**You should use this struct via [`PlaidClient::processor_transactions_sync`]. On request success, this will return a [`ProcessorTransactionsSyncResponse`].*/ @@ -14,16 +12,18 @@ pub struct ProcessorTransactionsSyncRequest { pub options: Option, pub processor_token: String, } -impl ProcessorTransactionsSyncRequest {} impl FluentRequest<'_, ProcessorTransactionsSyncRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self } + ///Set the value of the options field. pub fn options(mut self, options: TransactionsSyncRequestOptions) -> Self { self.params.options = Some(options); self @@ -31,25 +31,71 @@ impl FluentRequest<'_, ProcessorTransactionsSyncRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProcessorTransactionsSyncRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::ProcessorTransactionsSyncResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/processor/transactions/sync"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "processor_token" : self.params.processor_token })); + r = r + .json( + serde_json::json!( + { "processor_token" : self.params.processor_token } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get incremental transaction updates on a processor token + +This endpoint replaces `/processor/transactions/get` and its associated webhooks for most common use-cases. + +The `/processor/transactions/sync` endpoint allows developers to subscribe to all transactions associated with a processor token and get updates synchronously in a stream-like manner, using a cursor to track which updates have already been seen. `/processor/transactions/sync` provides the same functionality as `/processor/transactions/get` and can be used instead of `/processor/transactions/get` to simplify the process of tracking transactions updates. + +This endpoint provides user-authorized transaction data for `credit`, `depository`, and some loan-type accounts (only those with account subtype `student`; coverage may be limited). For transaction history from `investments` accounts, use `/investments/transactions/get` instead. + +Returned transactions data is grouped into three types of update, indicating whether the transaction was added, removed, or modified since the last call to the API. + +In the first call to `/processor/transactions/sync` for a processor token, the endpoint will return all historical transactions data associated with that processor token up until the time of the API call (as "adds"), which then generates a `next_cursor` for that processor token. In subsequent calls, send the `next_cursor` to receive only the changes that have occurred since the previous call. + +Due to the potentially large number of transactions associated with a processor token, results are paginated. The `has_more` field specifies if additional calls are necessary to fetch all available transaction updates. Call `/processor/transactions/sync` with the new cursor, pulling all updates, until `has_more` is `false`. + +When retrieving paginated updates, track both the `next_cursor` from the latest response and the original cursor from the first call in which `has_more` was `true`; if a call to `/processor/transactions/sync` fails when retrieving a paginated update, which can occur as a result of the [`TRANSACTIONS_SYNC_MUTATION_DURING_PAGINATION`](https://plaid.com/docs/errors/transactions/#transactions_sync_mutation_during_pagination) error, the entire pagination request loop must be restarted beginning with the cursor for the first page of the update, rather than retrying only the single request that failed. + +Whenever new or updated transaction data becomes available, `/processor/transactions/sync` will provide these updates. Plaid typically checks for new data multiple times a day, but these checks may occur less frequently, such as once a day, depending on the institution. To force Plaid to check for new transactions, use the `/processor/transactions/refresh` endpoint. + +Note that for newly created processor tokens, data may not be immediately available to `/processor/transactions/sync`. Plaid begins preparing transactions data when the corresponding Item is created, but the process can take anywhere from a few seconds to several minutes to complete, depending on the number of transactions available. + +To receive Transactions webhooks for a processor token, set its webhook URL via the [`/processor/token/webhook/update`](https://plaid.com/docs/api/processor-partners/#processortokenwebhookupdate) endpoint. + +See endpoint docs at .*/ + pub fn processor_transactions_sync( + &self, + processor_token: &str, + ) -> FluentRequest<'_, ProcessorTransactionsSyncRequest> { + FluentRequest { + client: self, + params: ProcessorTransactionsSyncRequest { + count: None, + cursor: None, + options: None, + processor_token: processor_token.to_owned(), + }, + } + } +} diff --git a/src/request/profile_get.rs b/src/request/profile_get.rs new file mode 100644 index 00000000..a4c42053 --- /dev/null +++ b/src/request/profile_get.rs @@ -0,0 +1,46 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::profile_get`]. + +On request success, this will return a [`ProfileGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ProfileGetRequest { + pub profile_token: String, +} +impl FluentRequest<'_, ProfileGetRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, ProfileGetRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/profile/get"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!({ "profile_token" : self.params.profile_token }), + ); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve a Profile + +Returns user permissioned profile data including identity and item access tokens. + +See endpoint docs at .*/ + pub fn profile_get( + &self, + profile_token: &str, + ) -> FluentRequest<'_, ProfileGetRequest> { + FluentRequest { + client: self, + params: ProfileGetRequest { + profile_token: profile_token.to_owned(), + }, + } + } +} diff --git a/src/request/profile_network_status_get.rs b/src/request/profile_network_status_get.rs new file mode 100644 index 00000000..1cb48b9e --- /dev/null +++ b/src/request/profile_network_status_get.rs @@ -0,0 +1,48 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::ProfileNetworkStatusGetUser; +/**You should use this struct via [`PlaidClient::profile_network_status_get`]. + +On request success, this will return a [`ProfileNetworkStatusGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ProfileNetworkStatusGetRequest { + pub user: ProfileNetworkStatusGetUser, +} +impl FluentRequest<'_, ProfileNetworkStatusGetRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, ProfileNetworkStatusGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::ProfileNetworkStatusGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/profile/network_status/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "user" : self.params.user })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Check a user's Plaid Network status + +The `/profile/network_status/get` endpoint can be used to check whether Plaid has a matching profile +for the user. + +See endpoint docs at .*/ + pub fn profile_network_status_get( + &self, + user: ProfileNetworkStatusGetUser, + ) -> FluentRequest<'_, ProfileNetworkStatusGetRequest> { + FluentRequest { + client: self, + params: ProfileNetworkStatusGetRequest { + user, + }, + } + } +} diff --git a/src/request/sandbox_bank_income_fire_webhook.rs b/src/request/sandbox_bank_income_fire_webhook.rs index b27e4136..21c4e3f3 100644 --- a/src/request/sandbox_bank_income_fire_webhook.rs +++ b/src/request/sandbox_bank_income_fire_webhook.rs @@ -1,20 +1,21 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + SandboxBankIncomeWebhookFireRequestWebhookCode, + SandboxBankIncomeWebhookFireRequestWebhookFields, +}; /**You should use this struct via [`PlaidClient::sandbox_bank_income_fire_webhook`]. On request success, this will return a [`SandboxBankIncomeFireWebhookResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SandboxBankIncomeFireWebhookRequest { - pub webhook_code: String, + pub webhook_code: SandboxBankIncomeWebhookFireRequestWebhookCode, pub webhook_fields: SandboxBankIncomeWebhookFireRequestWebhookFields, pub webhook_override: Option, } -impl SandboxBankIncomeFireWebhookRequest {} impl FluentRequest<'_, SandboxBankIncomeFireWebhookRequest> { + ///Set the value of the webhook_override field. pub fn webhook_override(mut self, webhook_override: &str) -> Self { self.params.webhook_override = Some(webhook_override.to_owned()); self @@ -22,20 +23,46 @@ impl FluentRequest<'_, SandboxBankIncomeFireWebhookRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxBankIncomeFireWebhookRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxBankIncomeFireWebhookResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/bank_income/fire_webhook"; let mut r = self.client.client.post(url); - r = r.json(json!({ "webhook_code" : self.params.webhook_code })); - r = r.json(json!({ "webhook_fields" : self.params.webhook_fields })); + r = r.json(serde_json::json!({ "webhook_code" : self.params.webhook_code })); + r = r + .json( + serde_json::json!({ "webhook_fields" : self.params.webhook_fields }), + ); if let Some(ref unwrapped) = self.params.webhook_override { - r = r.json(json!({ "webhook_override" : unwrapped })); + r = r.json(serde_json::json!({ "webhook_override" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Manually fire a bank income webhook in sandbox + +Use the `/sandbox/bank_income/fire_webhook` endpoint to manually trigger a Bank Income webhook in the Sandbox environment. + +See endpoint docs at .*/ + pub fn sandbox_bank_income_fire_webhook( + &self, + webhook_code: SandboxBankIncomeWebhookFireRequestWebhookCode, + webhook_fields: SandboxBankIncomeWebhookFireRequestWebhookFields, + ) -> FluentRequest<'_, SandboxBankIncomeFireWebhookRequest> { + FluentRequest { + client: self, + params: SandboxBankIncomeFireWebhookRequest { + webhook_code, + webhook_fields, + webhook_override: None, + }, + } + } +} diff --git a/src/request/sandbox_bank_transfer_fire_webhook.rs b/src/request/sandbox_bank_transfer_fire_webhook.rs index 6d2c458b..014c9057 100644 --- a/src/request/sandbox_bank_transfer_fire_webhook.rs +++ b/src/request/sandbox_bank_transfer_fire_webhook.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_bank_transfer_fire_webhook`]. On request success, this will return a [`SandboxBankTransferFireWebhookResponse`].*/ @@ -11,20 +8,39 @@ On request success, this will return a [`SandboxBankTransferFireWebhookResponse` pub struct SandboxBankTransferFireWebhookRequest { pub webhook: String, } -impl SandboxBankTransferFireWebhookRequest {} impl FluentRequest<'_, SandboxBankTransferFireWebhookRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxBankTransferFireWebhookRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxBankTransferFireWebhookResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/bank_transfer/fire_webhook"; let mut r = self.client.client.post(url); - r = r.json(json!({ "webhook" : self.params.webhook })); + r = r.json(serde_json::json!({ "webhook" : self.params.webhook })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Manually fire a Bank Transfer webhook + +Use the `/sandbox/bank_transfer/fire_webhook` endpoint to manually trigger a Bank Transfers webhook in the Sandbox environment. + +See endpoint docs at .*/ + pub fn sandbox_bank_transfer_fire_webhook( + &self, + webhook: &str, + ) -> FluentRequest<'_, SandboxBankTransferFireWebhookRequest> { + FluentRequest { + client: self, + params: SandboxBankTransferFireWebhookRequest { + webhook: webhook.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_bank_transfer_simulate.rs b/src/request/sandbox_bank_transfer_simulate.rs index c2e9024b..23174485 100644 --- a/src/request/sandbox_bank_transfer_simulate.rs +++ b/src/request/sandbox_bank_transfer_simulate.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::BankTransferFailure; /**You should use this struct via [`PlaidClient::sandbox_bank_transfer_simulate`]. On request success, this will return a [`SandboxBankTransferSimulateResponse`].*/ @@ -13,8 +11,8 @@ pub struct SandboxBankTransferSimulateRequest { pub event_type: String, pub failure_reason: Option, } -impl SandboxBankTransferSimulateRequest {} impl FluentRequest<'_, SandboxBankTransferSimulateRequest> { + ///Set the value of the failure_reason field. pub fn failure_reason(mut self, failure_reason: BankTransferFailure) -> Self { self.params.failure_reason = Some(failure_reason); self @@ -22,20 +20,48 @@ impl FluentRequest<'_, SandboxBankTransferSimulateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxBankTransferSimulateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxBankTransferSimulateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/bank_transfer/simulate"; let mut r = self.client.client.post(url); - r = r.json(json!({ "bank_transfer_id" : self.params.bank_transfer_id })); - r = r.json(json!({ "event_type" : self.params.event_type })); + r = r + .json( + serde_json::json!( + { "bank_transfer_id" : self.params.bank_transfer_id } + ), + ); + r = r.json(serde_json::json!({ "event_type" : self.params.event_type })); if let Some(ref unwrapped) = self.params.failure_reason { - r = r.json(json!({ "failure_reason" : unwrapped })); + r = r.json(serde_json::json!({ "failure_reason" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Simulate a bank transfer event in Sandbox + +Use the `/sandbox/bank_transfer/simulate` endpoint to simulate a bank transfer event in the Sandbox environment. Note that while an event will be simulated and will appear when using endpoints such as `/bank_transfer/event/sync` or `/bank_transfer/event/list`, no transactions will actually take place and funds will not move between accounts, even within the Sandbox. + +See endpoint docs at .*/ + pub fn sandbox_bank_transfer_simulate( + &self, + bank_transfer_id: &str, + event_type: &str, + ) -> FluentRequest<'_, SandboxBankTransferSimulateRequest> { + FluentRequest { + client: self, + params: SandboxBankTransferSimulateRequest { + bank_transfer_id: bank_transfer_id.to_owned(), + event_type: event_type.to_owned(), + failure_reason: None, + }, + } + } +} diff --git a/src/request/sandbox_income_fire_webhook.rs b/src/request/sandbox_income_fire_webhook.rs index bc1d964d..884b652c 100644 --- a/src/request/sandbox_income_fire_webhook.rs +++ b/src/request/sandbox_income_fire_webhook.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::SandboxIncomeWebhookFireRequestWebhookCode; /**You should use this struct via [`PlaidClient::sandbox_income_fire_webhook`]. On request success, this will return a [`SandboxIncomeFireWebhookResponse`].*/ @@ -13,14 +11,15 @@ pub struct SandboxIncomeFireWebhookRequest { pub user_id: Option, pub verification_status: Option, pub webhook: String, - pub webhook_code: String, + pub webhook_code: SandboxIncomeWebhookFireRequestWebhookCode, } -impl SandboxIncomeFireWebhookRequest {} impl FluentRequest<'_, SandboxIncomeFireWebhookRequest> { + ///Set the value of the user_id field. pub fn user_id(mut self, user_id: &str) -> Self { self.params.user_id = Some(user_id.to_owned()); self } + ///Set the value of the verification_status field. pub fn verification_status(mut self, verification_status: &str) -> Self { self.params.verification_status = Some(verification_status.to_owned()); self @@ -28,24 +27,50 @@ impl FluentRequest<'_, SandboxIncomeFireWebhookRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxIncomeFireWebhookRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxIncomeFireWebhookResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/income/fire_webhook"; let mut r = self.client.client.post(url); - r = r.json(json!({ "item_id" : self.params.item_id })); + r = r.json(serde_json::json!({ "item_id" : self.params.item_id })); if let Some(ref unwrapped) = self.params.user_id { - r = r.json(json!({ "user_id" : unwrapped })); + r = r.json(serde_json::json!({ "user_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.verification_status { - r = r.json(json!({ "verification_status" : unwrapped })); + r = r.json(serde_json::json!({ "verification_status" : unwrapped })); } - r = r.json(json!({ "webhook" : self.params.webhook })); - r = r.json(json!({ "webhook_code" : self.params.webhook_code })); + r = r.json(serde_json::json!({ "webhook" : self.params.webhook })); + r = r.json(serde_json::json!({ "webhook_code" : self.params.webhook_code })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Manually fire an Income webhook + +Use the `/sandbox/income/fire_webhook` endpoint to manually trigger a Payroll or Document Income webhook in the Sandbox environment. + +See endpoint docs at .*/ + pub fn sandbox_income_fire_webhook( + &self, + item_id: &str, + webhook: &str, + webhook_code: SandboxIncomeWebhookFireRequestWebhookCode, + ) -> FluentRequest<'_, SandboxIncomeFireWebhookRequest> { + FluentRequest { + client: self, + params: SandboxIncomeFireWebhookRequest { + item_id: item_id.to_owned(), + user_id: None, + verification_status: None, + webhook: webhook.to_owned(), + webhook_code, + }, + } + } +} diff --git a/src/request/sandbox_item_fire_webhook.rs b/src/request/sandbox_item_fire_webhook.rs index 1892e4cd..91a84f38 100644 --- a/src/request/sandbox_item_fire_webhook.rs +++ b/src/request/sandbox_item_fire_webhook.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::WebhookType; /**You should use this struct via [`PlaidClient::sandbox_item_fire_webhook`]. On request success, this will return a [`SandboxItemFireWebhookResponse`].*/ @@ -11,30 +9,73 @@ On request success, this will return a [`SandboxItemFireWebhookResponse`].*/ pub struct SandboxItemFireWebhookRequest { pub access_token: String, pub webhook_code: String, - pub webhook_type: Option, + pub webhook_type: Option, } -impl SandboxItemFireWebhookRequest {} impl FluentRequest<'_, SandboxItemFireWebhookRequest> { - pub fn webhook_type(mut self, webhook_type: &str) -> Self { - self.params.webhook_type = Some(webhook_type.to_owned()); + ///Set the value of the webhook_type field. + pub fn webhook_type(mut self, webhook_type: WebhookType) -> Self { + self.params.webhook_type = Some(webhook_type); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxItemFireWebhookRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxItemFireWebhookResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/item/fire_webhook"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "webhook_code" : self.params.webhook_code })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "webhook_code" : self.params.webhook_code })); if let Some(ref unwrapped) = self.params.webhook_type { - r = r.json(json!({ "webhook_type" : unwrapped })); + r = r.json(serde_json::json!({ "webhook_type" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Fire a test webhook + +The `/sandbox/item/fire_webhook` endpoint is used to test that code correctly handles webhooks. This endpoint can trigger the following webhooks: + +`DEFAULT_UPDATE`: Webhook to be fired for a given Sandbox Item simulating a default update event for the respective product as specified with the `webhook_type` in the request body. Valid Sandbox `DEFAULT_UPDATE` webhook types include: `AUTH`, `IDENTITY`, `TRANSACTIONS`, `INVESTMENTS_TRANSACTIONS`, `LIABILITIES`, `HOLDINGS`. If the Item does not support the product, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. + +`NEW_ACCOUNTS_AVAILABLE`: Fired to indicate that a new account is available on the Item and you can launch update mode to request access to it. + +`SMS_MICRODEPOSITS_VERIFICATION`: Fired when a given same day micro-deposit item is verified via SMS verification. + +`LOGIN_REPAIRED`: Fired when an Item recovers from the `ITEM_LOGIN_REQUIRED` without the user going through update mode in your app. + +`PENDING_DISCONNECT`: Fired when an Item will stop working in the near future (e.g. due to a planned bank migration) and must be sent through update mode to continue working. + +`RECURRING_TRANSACTIONS_UPDATE`: Recurring Transactions webhook to be fired for a given Sandbox Item. If the Item does not support Recurring Transactions, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. + +`SYNC_UPDATES_AVAILABLE`: Transactions webhook to be fired for a given Sandbox Item. If the Item does not support Transactions, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. + +`PRODUCT_READY`: Assets webhook to be fired when a given asset report has been successfully generated. If the Item does not support Assets, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. + +`ERROR`: Assets webhook to be fired when asset report generation has failed. If the Item does not support Assets, a `SANDBOX_PRODUCT_NOT_ENABLED` error will result. + +Note that this endpoint is provided for developer ease-of-use and is not required for testing webhooks; webhooks will also fire in Sandbox under the same conditions that they would in Production (except for webhooks of type `TRANSFER`). + +See endpoint docs at .*/ + pub fn sandbox_item_fire_webhook( + &self, + access_token: &str, + webhook_code: &str, + ) -> FluentRequest<'_, SandboxItemFireWebhookRequest> { + FluentRequest { + client: self, + params: SandboxItemFireWebhookRequest { + access_token: access_token.to_owned(), + webhook_code: webhook_code.to_owned(), + webhook_type: None, + }, + } + } +} diff --git a/src/request/sandbox_item_reset_login.rs b/src/request/sandbox_item_reset_login.rs index 05df5789..22a8061b 100644 --- a/src/request/sandbox_item_reset_login.rs +++ b/src/request/sandbox_item_reset_login.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_item_reset_login`]. On request success, this will return a [`SandboxItemResetLoginResponse`].*/ @@ -11,19 +8,41 @@ On request success, this will return a [`SandboxItemResetLoginResponse`].*/ pub struct SandboxItemResetLoginRequest { pub access_token: String, } -impl SandboxItemResetLoginRequest {} impl FluentRequest<'_, SandboxItemResetLoginRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxItemResetLoginRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxItemResetLoginResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/item/reset_login"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Force a Sandbox Item into an error state + +`/sandbox/item/reset_login/` forces an Item into an `ITEM_LOGIN_REQUIRED` state in order to simulate an Item whose login is no longer valid. This makes it easy to test Link's [update mode](https://plaid.com/docs/link/update-mode) flow in the Sandbox environment. After calling `/sandbox/item/reset_login`, You can then use Plaid Link update mode to restore the Item to a good state. An `ITEM_LOGIN_REQUIRED` webhook will also be fired after a call to this endpoint, if one is associated with the Item. + + +In the Sandbox, Items will transition to an `ITEM_LOGIN_REQUIRED` error state automatically after 30 days, even if this endpoint is not called. + +See endpoint docs at .*/ + pub fn sandbox_item_reset_login( + &self, + access_token: &str, + ) -> FluentRequest<'_, SandboxItemResetLoginRequest> { + FluentRequest { + client: self, + params: SandboxItemResetLoginRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_item_set_verification_status.rs b/src/request/sandbox_item_set_verification_status.rs index 04b20b29..3ec79360 100644 --- a/src/request/sandbox_item_set_verification_status.rs +++ b/src/request/sandbox_item_set_verification_status.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_item_set_verification_status`]. On request success, this will return a [`SandboxItemSetVerificationStatusResponse`].*/ @@ -13,25 +10,52 @@ pub struct SandboxItemSetVerificationStatusRequest { pub account_id: String, pub verification_status: String, } -impl SandboxItemSetVerificationStatusRequest {} impl FluentRequest<'_, SandboxItemSetVerificationStatusRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxItemSetVerificationStatusRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxItemSetVerificationStatusResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/item/set_verification_status"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); r = r .json( - json!({ "verification_status" : self.params.verification_status }), + serde_json::json!( + { "verification_status" : self.params.verification_status } + ), ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Set verification status for Sandbox account + +The `/sandbox/item/set_verification_status` endpoint can be used to change the verification status of an Item in in the Sandbox in order to simulate the Automated Micro-deposit flow. + +For more information on testing Automated Micro-deposits in Sandbox, see [Auth full coverage testing](https://plaid.com/docs/auth/coverage/testing#). + +See endpoint docs at .*/ + pub fn sandbox_item_set_verification_status( + &self, + access_token: &str, + account_id: &str, + verification_status: &str, + ) -> FluentRequest<'_, SandboxItemSetVerificationStatusRequest> { + FluentRequest { + client: self, + params: SandboxItemSetVerificationStatusRequest { + access_token: access_token.to_owned(), + account_id: account_id.to_owned(), + verification_status: verification_status.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_oauth_select_accounts.rs b/src/request/sandbox_oauth_select_accounts.rs index 40a0b7f0..c9e8bdfd 100644 --- a/src/request/sandbox_oauth_select_accounts.rs +++ b/src/request/sandbox_oauth_select_accounts.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_oauth_select_accounts`]. On request success, this will return a [`SandboxOauthSelectAccountsResponse`].*/ @@ -12,21 +9,41 @@ pub struct SandboxOauthSelectAccountsRequest { pub accounts: Vec, pub oauth_state_id: String, } -impl SandboxOauthSelectAccountsRequest {} impl FluentRequest<'_, SandboxOauthSelectAccountsRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxOauthSelectAccountsRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxOauthSelectAccountsResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/oauth/select_accounts"; let mut r = self.client.client.post(url); - r = r.json(json!({ "accounts" : self.params.accounts })); - r = r.json(json!({ "oauth_state_id" : self.params.oauth_state_id })); + r = r.json(serde_json::json!({ "accounts" : self.params.accounts })); + r = r + .json( + serde_json::json!({ "oauth_state_id" : self.params.oauth_state_id }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + ///Save the selected accounts when connecting to the Platypus Oauth institution + pub fn sandbox_oauth_select_accounts( + &self, + accounts: &[&str], + oauth_state_id: &str, + ) -> FluentRequest<'_, SandboxOauthSelectAccountsRequest> { + FluentRequest { + client: self, + params: SandboxOauthSelectAccountsRequest { + accounts: accounts.iter().map(|&x| x.to_owned()).collect(), + oauth_state_id: oauth_state_id.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_payment_profile_reset_login.rs b/src/request/sandbox_payment_profile_reset_login.rs index 305ab0a0..5a55af9b 100644 --- a/src/request/sandbox_payment_profile_reset_login.rs +++ b/src/request/sandbox_payment_profile_reset_login.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_payment_profile_reset_login`]. On request success, this will return a [`SandboxPaymentProfileResetLoginResponse`].*/ @@ -11,11 +8,12 @@ On request success, this will return a [`SandboxPaymentProfileResetLoginResponse pub struct SandboxPaymentProfileResetLoginRequest { pub payment_profile_token: String, } -impl SandboxPaymentProfileResetLoginRequest {} impl FluentRequest<'_, SandboxPaymentProfileResetLoginRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxPaymentProfileResetLoginRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxPaymentProfileResetLoginResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,7 +21,7 @@ for FluentRequest<'a, SandboxPaymentProfileResetLoginRequest> { let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "payment_profile_token" : self.params.payment_profile_token } ), ); @@ -32,4 +30,26 @@ for FluentRequest<'a, SandboxPaymentProfileResetLoginRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Reset the login of a Payment Profile + +`/sandbox/payment_profile/reset_login/` forces a Payment Profile into a state where the login is no longer valid. This makes it easy to test update mode for Payment Profile in the Sandbox environment. + + After calling `/sandbox/payment_profile/reset_login`, calls to the `/transfer/authorization/create` with the Payment Profile will result in a `decision_rationale` `PAYMENT_PROFILE_LOGIN_REQUIRED`. You can then use update mode for Payment Profile to restore it into a good state. + + In order to invoke this endpoint, you must first [create a Payment Profile](https://plaid.com/docs/transfer/add-to-app/#create-a-payment-profile-optional) and [go through the Link flow](https://plaid.com/docs/transfer/add-to-app/#create-a-link-token). + +See endpoint docs at .*/ + pub fn sandbox_payment_profile_reset_login( + &self, + payment_profile_token: &str, + ) -> FluentRequest<'_, SandboxPaymentProfileResetLoginRequest> { + FluentRequest { + client: self, + params: SandboxPaymentProfileResetLoginRequest { + payment_profile_token: payment_profile_token.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_processor_token_create.rs b/src/request/sandbox_processor_token_create.rs index 288c4ff0..be3d3685 100644 --- a/src/request/sandbox_processor_token_create.rs +++ b/src/request/sandbox_processor_token_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::SandboxProcessorTokenCreateRequestOptions; /**You should use this struct via [`PlaidClient::sandbox_processor_token_create`]. On request success, this will return a [`SandboxProcessorTokenCreateResponse`].*/ @@ -12,8 +10,8 @@ pub struct SandboxProcessorTokenCreateRequest { pub institution_id: String, pub options: Option, } -impl SandboxProcessorTokenCreateRequest {} impl FluentRequest<'_, SandboxProcessorTokenCreateRequest> { + ///Set the value of the options field. pub fn options( mut self, options: SandboxProcessorTokenCreateRequestOptions, @@ -24,19 +22,43 @@ impl FluentRequest<'_, SandboxProcessorTokenCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxProcessorTokenCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxProcessorTokenCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/processor_token/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "institution_id" : self.params.institution_id })); + r = r + .json( + serde_json::json!({ "institution_id" : self.params.institution_id }), + ); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a test Item and processor token + +Use the `/sandbox/processor_token/create` endpoint to create a valid `processor_token` for an arbitrary institution ID and test credentials. The created `processor_token` corresponds to a new Sandbox Item. You can then use this `processor_token` with the `/processor/` API endpoints in Sandbox. You can also use `/sandbox/processor_token/create` with the [`user_custom` test username](https://plaid.com/docs/sandbox/user-custom) to generate a test account with custom data. + +See endpoint docs at .*/ + pub fn sandbox_processor_token_create( + &self, + institution_id: &str, + ) -> FluentRequest<'_, SandboxProcessorTokenCreateRequest> { + FluentRequest { + client: self, + params: SandboxProcessorTokenCreateRequest { + institution_id: institution_id.to_owned(), + options: None, + }, + } + } +} diff --git a/src/request/sandbox_public_token_create.rs b/src/request/sandbox_public_token_create.rs index 1c8dfd2c..2c7f3900 100644 --- a/src/request/sandbox_public_token_create.rs +++ b/src/request/sandbox_public_token_create.rs @@ -1,25 +1,24 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{Products, SandboxPublicTokenCreateRequestOptions}; /**You should use this struct via [`PlaidClient::sandbox_public_token_create`]. On request success, this will return a [`SandboxPublicTokenCreateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SandboxPublicTokenCreateRequest { - pub initial_products: Vec, + pub initial_products: Vec, pub institution_id: String, pub options: Option, pub user_token: Option, } -impl SandboxPublicTokenCreateRequest {} impl FluentRequest<'_, SandboxPublicTokenCreateRequest> { + ///Set the value of the options field. pub fn options(mut self, options: SandboxPublicTokenCreateRequestOptions) -> Self { self.params.options = Some(options); self } + ///Set the value of the user_token field. pub fn user_token(mut self, user_token: &str) -> Self { self.params.user_token = Some(user_token.to_owned()); self @@ -27,23 +26,55 @@ impl FluentRequest<'_, SandboxPublicTokenCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxPublicTokenCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxPublicTokenCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/public_token/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "initial_products" : self.params.initial_products })); - r = r.json(json!({ "institution_id" : self.params.institution_id })); + r = r + .json( + serde_json::json!( + { "initial_products" : self.params.initial_products } + ), + ); + r = r + .json( + serde_json::json!({ "institution_id" : self.params.institution_id }), + ); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } if let Some(ref unwrapped) = self.params.user_token { - r = r.json(json!({ "user_token" : unwrapped })); + r = r.json(serde_json::json!({ "user_token" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a test Item + +Use the `/sandbox/public_token/create` endpoint to create a valid `public_token` for an arbitrary institution ID, initial products, and test credentials. The created `public_token` maps to a new Sandbox Item. You can then call `/item/public_token/exchange` to exchange the `public_token` for an `access_token` and perform all API actions. `/sandbox/public_token/create` can also be used with the [`user_custom` test username](https://plaid.com/docs/sandbox/user-custom) to generate a test account with custom data, or with Plaid's [pre-populated Sandbox test accounts](https://plaid.com/docs/sandbox/test-credentials/). + +See endpoint docs at .*/ + pub fn sandbox_public_token_create( + &self, + initial_products: Vec, + institution_id: &str, + ) -> FluentRequest<'_, SandboxPublicTokenCreateRequest> { + FluentRequest { + client: self, + params: SandboxPublicTokenCreateRequest { + initial_products, + institution_id: institution_id.to_owned(), + options: None, + user_token: None, + }, + } + } +} diff --git a/src/request/sandbox_transfer_fire_webhook.rs b/src/request/sandbox_transfer_fire_webhook.rs index 568ce2a7..b6067d3c 100644 --- a/src/request/sandbox_transfer_fire_webhook.rs +++ b/src/request/sandbox_transfer_fire_webhook.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_transfer_fire_webhook`]. On request success, this will return a [`SandboxTransferFireWebhookResponse`].*/ @@ -11,20 +8,39 @@ On request success, this will return a [`SandboxTransferFireWebhookResponse`].*/ pub struct SandboxTransferFireWebhookRequest { pub webhook: String, } -impl SandboxTransferFireWebhookRequest {} impl FluentRequest<'_, SandboxTransferFireWebhookRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferFireWebhookRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxTransferFireWebhookResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/fire_webhook"; let mut r = self.client.client.post(url); - r = r.json(json!({ "webhook" : self.params.webhook })); + r = r.json(serde_json::json!({ "webhook" : self.params.webhook })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Manually fire a Transfer webhook + +Use the `/sandbox/transfer/fire_webhook` endpoint to manually trigger a `TRANSFER_EVENTS_UPDATE` webhook in the Sandbox environment. + +See endpoint docs at .*/ + pub fn sandbox_transfer_fire_webhook( + &self, + webhook: &str, + ) -> FluentRequest<'_, SandboxTransferFireWebhookRequest> { + FluentRequest { + client: self, + params: SandboxTransferFireWebhookRequest { + webhook: webhook.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_transfer_ledger_deposit_simulate.rs b/src/request/sandbox_transfer_ledger_deposit_simulate.rs index 202103b4..c14b1f7b 100644 --- a/src/request/sandbox_transfer_ledger_deposit_simulate.rs +++ b/src/request/sandbox_transfer_ledger_deposit_simulate.rs @@ -1,20 +1,18 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{TransferLedgerSweepSimulateEventType, TransferFailure}; /**You should use this struct via [`PlaidClient::sandbox_transfer_ledger_deposit_simulate`]. On request success, this will return a [`SandboxTransferLedgerDepositSimulateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SandboxTransferLedgerDepositSimulateRequest { - pub event_type: String, + pub event_type: TransferLedgerSweepSimulateEventType, pub failure_reason: Option, pub sweep_id: String, } -impl SandboxTransferLedgerDepositSimulateRequest {} impl FluentRequest<'_, SandboxTransferLedgerDepositSimulateRequest> { + ///Set the value of the failure_reason field. pub fn failure_reason(mut self, failure_reason: TransferFailure) -> Self { self.params.failure_reason = Some(failure_reason); self @@ -23,21 +21,42 @@ impl FluentRequest<'_, SandboxTransferLedgerDepositSimulateRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferLedgerDepositSimulateRequest> { type Output = httpclient::InMemoryResult< - SandboxTransferLedgerDepositSimulateResponse, + crate::model::SandboxTransferLedgerDepositSimulateResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/ledger/deposit/simulate"; let mut r = self.client.client.post(url); - r = r.json(json!({ "event_type" : self.params.event_type })); + r = r.json(serde_json::json!({ "event_type" : self.params.event_type })); if let Some(ref unwrapped) = self.params.failure_reason { - r = r.json(json!({ "failure_reason" : unwrapped })); + r = r.json(serde_json::json!({ "failure_reason" : unwrapped })); } - r = r.json(json!({ "sweep_id" : self.params.sweep_id })); + r = r.json(serde_json::json!({ "sweep_id" : self.params.sweep_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Simulate a ledger deposit event in Sandbox + +Use the `/sandbox/transfer/ledger/deposit/simulate` endpoint to simulate a ledger deposit event in the Sandbox environment. + +See endpoint docs at .*/ + pub fn sandbox_transfer_ledger_deposit_simulate( + &self, + event_type: TransferLedgerSweepSimulateEventType, + sweep_id: &str, + ) -> FluentRequest<'_, SandboxTransferLedgerDepositSimulateRequest> { + FluentRequest { + client: self, + params: SandboxTransferLedgerDepositSimulateRequest { + event_type, + failure_reason: None, + sweep_id: sweep_id.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_transfer_ledger_simulate_available.rs b/src/request/sandbox_transfer_ledger_simulate_available.rs index 48a56378..6959021e 100644 --- a/src/request/sandbox_transfer_ledger_simulate_available.rs +++ b/src/request/sandbox_transfer_ledger_simulate_available.rs @@ -1,39 +1,73 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_transfer_ledger_simulate_available`]. On request success, this will return a [`SandboxTransferLedgerSimulateAvailableResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SandboxTransferLedgerSimulateAvailableRequest { + pub ledger_id: Option, pub test_clock_id: Option, + pub webhook: Option, } -impl SandboxTransferLedgerSimulateAvailableRequest {} impl FluentRequest<'_, SandboxTransferLedgerSimulateAvailableRequest> { + ///Set the value of the ledger_id field. + pub fn ledger_id(mut self, ledger_id: &str) -> Self { + self.params.ledger_id = Some(ledger_id.to_owned()); + self + } + ///Set the value of the test_clock_id field. pub fn test_clock_id(mut self, test_clock_id: &str) -> Self { self.params.test_clock_id = Some(test_clock_id.to_owned()); self } + ///Set the value of the webhook field. + pub fn webhook(mut self, webhook: &str) -> Self { + self.params.webhook = Some(webhook.to_owned()); + self + } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferLedgerSimulateAvailableRequest> { type Output = httpclient::InMemoryResult< - SandboxTransferLedgerSimulateAvailableResponse, + crate::model::SandboxTransferLedgerSimulateAvailableResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/ledger/simulate_available"; let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.ledger_id { + r = r.json(serde_json::json!({ "ledger_id" : unwrapped })); + } if let Some(ref unwrapped) = self.params.test_clock_id { - r = r.json(json!({ "test_clock_id" : unwrapped })); + r = r.json(serde_json::json!({ "test_clock_id" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.webhook { + r = r.json(serde_json::json!({ "webhook" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Simulate converting pending balance to available balance + +Use the `/sandbox/transfer/ledger/simulate_available` endpoint to simulate converting pending balance to available balance for all originators in the Sandbox environment. + +See endpoint docs at .*/ + pub fn sandbox_transfer_ledger_simulate_available( + &self, + ) -> FluentRequest<'_, SandboxTransferLedgerSimulateAvailableRequest> { + FluentRequest { + client: self, + params: SandboxTransferLedgerSimulateAvailableRequest { + ledger_id: None, + test_clock_id: None, + webhook: None, + }, + } + } +} diff --git a/src/request/sandbox_transfer_ledger_withdraw_simulate.rs b/src/request/sandbox_transfer_ledger_withdraw_simulate.rs index 54717a35..74fb67aa 100644 --- a/src/request/sandbox_transfer_ledger_withdraw_simulate.rs +++ b/src/request/sandbox_transfer_ledger_withdraw_simulate.rs @@ -1,20 +1,18 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{TransferLedgerSweepSimulateEventType, TransferFailure}; /**You should use this struct via [`PlaidClient::sandbox_transfer_ledger_withdraw_simulate`]. On request success, this will return a [`SandboxTransferLedgerWithdrawSimulateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SandboxTransferLedgerWithdrawSimulateRequest { - pub event_type: String, + pub event_type: TransferLedgerSweepSimulateEventType, pub failure_reason: Option, pub sweep_id: String, } -impl SandboxTransferLedgerWithdrawSimulateRequest {} impl FluentRequest<'_, SandboxTransferLedgerWithdrawSimulateRequest> { + ///Set the value of the failure_reason field. pub fn failure_reason(mut self, failure_reason: TransferFailure) -> Self { self.params.failure_reason = Some(failure_reason); self @@ -23,21 +21,42 @@ impl FluentRequest<'_, SandboxTransferLedgerWithdrawSimulateRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferLedgerWithdrawSimulateRequest> { type Output = httpclient::InMemoryResult< - SandboxTransferLedgerWithdrawSimulateResponse, + crate::model::SandboxTransferLedgerWithdrawSimulateResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/ledger/withdraw/simulate"; let mut r = self.client.client.post(url); - r = r.json(json!({ "event_type" : self.params.event_type })); + r = r.json(serde_json::json!({ "event_type" : self.params.event_type })); if let Some(ref unwrapped) = self.params.failure_reason { - r = r.json(json!({ "failure_reason" : unwrapped })); + r = r.json(serde_json::json!({ "failure_reason" : unwrapped })); } - r = r.json(json!({ "sweep_id" : self.params.sweep_id })); + r = r.json(serde_json::json!({ "sweep_id" : self.params.sweep_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Simulate a ledger withdraw event in Sandbox + +Use the `/sandbox/transfer/ledger/withdraw/simulate` endpoint to simulate a ledger withdraw event in the Sandbox environment. + +See endpoint docs at .*/ + pub fn sandbox_transfer_ledger_withdraw_simulate( + &self, + event_type: TransferLedgerSweepSimulateEventType, + sweep_id: &str, + ) -> FluentRequest<'_, SandboxTransferLedgerWithdrawSimulateRequest> { + FluentRequest { + client: self, + params: SandboxTransferLedgerWithdrawSimulateRequest { + event_type, + failure_reason: None, + sweep_id: sweep_id.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_transfer_refund_simulate.rs b/src/request/sandbox_transfer_refund_simulate.rs index 16d3cfd4..000368a0 100644 --- a/src/request/sandbox_transfer_refund_simulate.rs +++ b/src/request/sandbox_transfer_refund_simulate.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransferFailure; /**You should use this struct via [`PlaidClient::sandbox_transfer_refund_simulate`]. On request success, this will return a [`SandboxTransferRefundSimulateResponse`].*/ @@ -13,37 +11,72 @@ pub struct SandboxTransferRefundSimulateRequest { pub failure_reason: Option, pub refund_id: String, pub test_clock_id: Option, + pub webhook: Option, } -impl SandboxTransferRefundSimulateRequest {} impl FluentRequest<'_, SandboxTransferRefundSimulateRequest> { + ///Set the value of the failure_reason field. pub fn failure_reason(mut self, failure_reason: TransferFailure) -> Self { self.params.failure_reason = Some(failure_reason); self } + ///Set the value of the test_clock_id field. pub fn test_clock_id(mut self, test_clock_id: &str) -> Self { self.params.test_clock_id = Some(test_clock_id.to_owned()); self } + ///Set the value of the webhook field. + pub fn webhook(mut self, webhook: &str) -> Self { + self.params.webhook = Some(webhook.to_owned()); + self + } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferRefundSimulateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxTransferRefundSimulateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/refund/simulate"; let mut r = self.client.client.post(url); - r = r.json(json!({ "event_type" : self.params.event_type })); + r = r.json(serde_json::json!({ "event_type" : self.params.event_type })); if let Some(ref unwrapped) = self.params.failure_reason { - r = r.json(json!({ "failure_reason" : unwrapped })); + r = r.json(serde_json::json!({ "failure_reason" : unwrapped })); } - r = r.json(json!({ "refund_id" : self.params.refund_id })); + r = r.json(serde_json::json!({ "refund_id" : self.params.refund_id })); if let Some(ref unwrapped) = self.params.test_clock_id { - r = r.json(json!({ "test_clock_id" : unwrapped })); + r = r.json(serde_json::json!({ "test_clock_id" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.webhook { + r = r.json(serde_json::json!({ "webhook" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Simulate a refund event in Sandbox + +Use the `/sandbox/transfer/refund/simulate` endpoint to simulate a refund event in the Sandbox environment. Note that while an event will be simulated and will appear when using endpoints such as `/transfer/event/sync` or `/transfer/event/list`, no transactions will actually take place and funds will not move between accounts, even within the Sandbox. + +See endpoint docs at .*/ + pub fn sandbox_transfer_refund_simulate( + &self, + event_type: &str, + refund_id: &str, + ) -> FluentRequest<'_, SandboxTransferRefundSimulateRequest> { + FluentRequest { + client: self, + params: SandboxTransferRefundSimulateRequest { + event_type: event_type.to_owned(), + failure_reason: None, + refund_id: refund_id.to_owned(), + test_clock_id: None, + webhook: None, + }, + } + } +} diff --git a/src/request/sandbox_transfer_repayment_simulate.rs b/src/request/sandbox_transfer_repayment_simulate.rs index 8eae5251..c68b8c77 100644 --- a/src/request/sandbox_transfer_repayment_simulate.rs +++ b/src/request/sandbox_transfer_repayment_simulate.rs @@ -1,28 +1,46 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_transfer_repayment_simulate`]. On request success, this will return a [`SandboxTransferRepaymentSimulateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SandboxTransferRepaymentSimulateRequest {} -impl SandboxTransferRepaymentSimulateRequest {} +pub struct SandboxTransferRepaymentSimulateRequest { + pub body: serde_json::Value, +} impl FluentRequest<'_, SandboxTransferRepaymentSimulateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferRepaymentSimulateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxTransferRepaymentSimulateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/repayment/simulate"; let mut r = self.client.client.post(url); - r = r.set_query(self.params); + r = r.json(serde_json::json!({ "body" : self.params.body })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Trigger the creation of a repayment + +Use the `/sandbox/transfer/repayment/simulate` endpoint to trigger the creation of a repayment. As a side effect of calling this route, a repayment is created that includes all unreimbursed returns of guaranteed transfers. If there are no such returns, an 400 error is returned. + +See endpoint docs at .*/ + pub fn sandbox_transfer_repayment_simulate( + &self, + body: serde_json::Value, + ) -> FluentRequest<'_, SandboxTransferRepaymentSimulateRequest> { + FluentRequest { + client: self, + params: SandboxTransferRepaymentSimulateRequest { + body, + }, + } + } +} diff --git a/src/request/sandbox_transfer_simulate.rs b/src/request/sandbox_transfer_simulate.rs index f08e5179..8e1790cc 100644 --- a/src/request/sandbox_transfer_simulate.rs +++ b/src/request/sandbox_transfer_simulate.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransferFailure; /**You should use this struct via [`PlaidClient::sandbox_transfer_simulate`]. On request success, this will return a [`SandboxTransferSimulateResponse`].*/ @@ -13,37 +11,72 @@ pub struct SandboxTransferSimulateRequest { pub failure_reason: Option, pub test_clock_id: Option, pub transfer_id: String, + pub webhook: Option, } -impl SandboxTransferSimulateRequest {} impl FluentRequest<'_, SandboxTransferSimulateRequest> { + ///Set the value of the failure_reason field. pub fn failure_reason(mut self, failure_reason: TransferFailure) -> Self { self.params.failure_reason = Some(failure_reason); self } + ///Set the value of the test_clock_id field. pub fn test_clock_id(mut self, test_clock_id: &str) -> Self { self.params.test_clock_id = Some(test_clock_id.to_owned()); self } + ///Set the value of the webhook field. + pub fn webhook(mut self, webhook: &str) -> Self { + self.params.webhook = Some(webhook.to_owned()); + self + } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferSimulateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxTransferSimulateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/simulate"; let mut r = self.client.client.post(url); - r = r.json(json!({ "event_type" : self.params.event_type })); + r = r.json(serde_json::json!({ "event_type" : self.params.event_type })); if let Some(ref unwrapped) = self.params.failure_reason { - r = r.json(json!({ "failure_reason" : unwrapped })); + r = r.json(serde_json::json!({ "failure_reason" : unwrapped })); } if let Some(ref unwrapped) = self.params.test_clock_id { - r = r.json(json!({ "test_clock_id" : unwrapped })); + r = r.json(serde_json::json!({ "test_clock_id" : unwrapped })); + } + r = r.json(serde_json::json!({ "transfer_id" : self.params.transfer_id })); + if let Some(ref unwrapped) = self.params.webhook { + r = r.json(serde_json::json!({ "webhook" : unwrapped })); } - r = r.json(json!({ "transfer_id" : self.params.transfer_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Simulate a transfer event in Sandbox + +Use the `/sandbox/transfer/simulate` endpoint to simulate a transfer event in the Sandbox environment. Note that while an event will be simulated and will appear when using endpoints such as `/transfer/event/sync` or `/transfer/event/list`, no transactions will actually take place and funds will not move between accounts, even within the Sandbox. + +See endpoint docs at .*/ + pub fn sandbox_transfer_simulate( + &self, + event_type: &str, + transfer_id: &str, + ) -> FluentRequest<'_, SandboxTransferSimulateRequest> { + FluentRequest { + client: self, + params: SandboxTransferSimulateRequest { + event_type: event_type.to_owned(), + failure_reason: None, + test_clock_id: None, + transfer_id: transfer_id.to_owned(), + webhook: None, + }, + } + } +} diff --git a/src/request/sandbox_transfer_sweep_simulate.rs b/src/request/sandbox_transfer_sweep_simulate.rs index aab49493..47c60c56 100644 --- a/src/request/sandbox_transfer_sweep_simulate.rs +++ b/src/request/sandbox_transfer_sweep_simulate.rs @@ -1,37 +1,63 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_transfer_sweep_simulate`]. On request success, this will return a [`SandboxTransferSweepSimulateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SandboxTransferSweepSimulateRequest { pub test_clock_id: Option, + pub webhook: Option, } -impl SandboxTransferSweepSimulateRequest {} impl FluentRequest<'_, SandboxTransferSweepSimulateRequest> { + ///Set the value of the test_clock_id field. pub fn test_clock_id(mut self, test_clock_id: &str) -> Self { self.params.test_clock_id = Some(test_clock_id.to_owned()); self } + ///Set the value of the webhook field. + pub fn webhook(mut self, webhook: &str) -> Self { + self.params.webhook = Some(webhook.to_owned()); + self + } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferSweepSimulateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxTransferSweepSimulateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/sweep/simulate"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.test_clock_id { - r = r.json(json!({ "test_clock_id" : unwrapped })); + r = r.json(serde_json::json!({ "test_clock_id" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.webhook { + r = r.json(serde_json::json!({ "webhook" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Simulate creating a sweep + +Use the `/sandbox/transfer/sweep/simulate` endpoint to create a sweep and associated events in the Sandbox environment. Upon calling this endpoint, all transfers with a sweep status of `swept` will become `swept_settled`, all `posted` or `pending` transfers with a sweep status of `unswept` will become `swept`, and all `returned` transfers with a sweep status of `swept` will become `return_swept`. + +See endpoint docs at .*/ + pub fn sandbox_transfer_sweep_simulate( + &self, + ) -> FluentRequest<'_, SandboxTransferSweepSimulateRequest> { + FluentRequest { + client: self, + params: SandboxTransferSweepSimulateRequest { + test_clock_id: None, + webhook: None, + }, + } + } +} diff --git a/src/request/sandbox_transfer_test_clock_advance.rs b/src/request/sandbox_transfer_test_clock_advance.rs index e6311449..a0d3a51f 100644 --- a/src/request/sandbox_transfer_test_clock_advance.rs +++ b/src/request/sandbox_transfer_test_clock_advance.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_transfer_test_clock_advance`]. On request success, this will return a [`SandboxTransferTestClockAdvanceResponse`].*/ @@ -12,21 +9,60 @@ pub struct SandboxTransferTestClockAdvanceRequest { pub new_virtual_time: chrono::DateTime, pub test_clock_id: String, } -impl SandboxTransferTestClockAdvanceRequest {} impl FluentRequest<'_, SandboxTransferTestClockAdvanceRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferTestClockAdvanceRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxTransferTestClockAdvanceResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/test_clock/advance"; let mut r = self.client.client.post(url); - r = r.json(json!({ "new_virtual_time" : self.params.new_virtual_time })); - r = r.json(json!({ "test_clock_id" : self.params.test_clock_id })); + r = r + .json( + serde_json::json!( + { "new_virtual_time" : self.params.new_virtual_time } + ), + ); + r = r + .json( + serde_json::json!({ "test_clock_id" : self.params.test_clock_id }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Advance a test clock + +Use the `/sandbox/transfer/test_clock/advance` endpoint to advance a `test_clock` in the Sandbox environment. + +A test clock object represents an independent timeline and has a `virtual_time` field indicating the current timestamp of the timeline. A test clock can be advanced by incrementing `virtual_time`, but may never go back to a lower `virtual_time`. + +If a test clock is advanced, we will simulate the changes that ought to occur during the time that elapsed. + +For example, a client creates a weekly recurring transfer with a test clock set at t. When the client advances the test clock by setting `virtual_time` = t + 15 days, 2 new originations should be created, along with the webhook events. + +The advancement of the test clock from its current `virtual_time` should be limited such that there are no more than 20 originations resulting from the advance operation on each `recurring_transfer` associated with the `test_clock`. + +For example, if the recurring transfer associated with this test clock originates once every 4 weeks, you can advance the `virtual_time` up to 80 weeks on each API call. + +See endpoint docs at .*/ + pub fn sandbox_transfer_test_clock_advance( + &self, + new_virtual_time: chrono::DateTime, + test_clock_id: &str, + ) -> FluentRequest<'_, SandboxTransferTestClockAdvanceRequest> { + FluentRequest { + client: self, + params: SandboxTransferTestClockAdvanceRequest { + new_virtual_time, + test_clock_id: test_clock_id.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_transfer_test_clock_create.rs b/src/request/sandbox_transfer_test_clock_create.rs index d385acaf..4b527b98 100644 --- a/src/request/sandbox_transfer_test_clock_create.rs +++ b/src/request/sandbox_transfer_test_clock_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_transfer_test_clock_create`]. On request success, this will return a [`SandboxTransferTestClockCreateResponse`].*/ @@ -11,8 +8,8 @@ On request success, this will return a [`SandboxTransferTestClockCreateResponse` pub struct SandboxTransferTestClockCreateRequest { pub virtual_time: Option>, } -impl SandboxTransferTestClockCreateRequest {} impl FluentRequest<'_, SandboxTransferTestClockCreateRequest> { + ///Set the value of the virtual_time field. pub fn virtual_time(mut self, virtual_time: chrono::DateTime) -> Self { self.params.virtual_time = Some(virtual_time); self @@ -20,18 +17,41 @@ impl FluentRequest<'_, SandboxTransferTestClockCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferTestClockCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxTransferTestClockCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/test_clock/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.virtual_time { - r = r.json(json!({ "virtual_time" : unwrapped })); + r = r.json(serde_json::json!({ "virtual_time" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a test clock + +Use the `/sandbox/transfer/test_clock/create` endpoint to create a `test_clock` in the Sandbox environment. + +A test clock object represents an independent timeline and has a `virtual_time` field indicating the current timestamp of the timeline. Test clocks are used for testing recurring transfers in Sandbox. + +A test clock can be associated with up to 5 recurring transfers. + +See endpoint docs at .*/ + pub fn sandbox_transfer_test_clock_create( + &self, + ) -> FluentRequest<'_, SandboxTransferTestClockCreateRequest> { + FluentRequest { + client: self, + params: SandboxTransferTestClockCreateRequest { + virtual_time: None, + }, + } + } +} diff --git a/src/request/sandbox_transfer_test_clock_get.rs b/src/request/sandbox_transfer_test_clock_get.rs index 387da102..591de372 100644 --- a/src/request/sandbox_transfer_test_clock_get.rs +++ b/src/request/sandbox_transfer_test_clock_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_transfer_test_clock_get`]. On request success, this will return a [`SandboxTransferTestClockGetResponse`].*/ @@ -11,20 +8,42 @@ On request success, this will return a [`SandboxTransferTestClockGetResponse`].* pub struct SandboxTransferTestClockGetRequest { pub test_clock_id: String, } -impl SandboxTransferTestClockGetRequest {} impl FluentRequest<'_, SandboxTransferTestClockGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferTestClockGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxTransferTestClockGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/test_clock/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "test_clock_id" : self.params.test_clock_id })); + r = r + .json( + serde_json::json!({ "test_clock_id" : self.params.test_clock_id }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get a test clock + +Use the `/sandbox/transfer/test_clock/get` endpoint to get a `test_clock` in the Sandbox environment. + +See endpoint docs at .*/ + pub fn sandbox_transfer_test_clock_get( + &self, + test_clock_id: &str, + ) -> FluentRequest<'_, SandboxTransferTestClockGetRequest> { + FluentRequest { + client: self, + params: SandboxTransferTestClockGetRequest { + test_clock_id: test_clock_id.to_owned(), + }, + } + } +} diff --git a/src/request/sandbox_transfer_test_clock_list.rs b/src/request/sandbox_transfer_test_clock_list.rs index a7330d29..37daf4e9 100644 --- a/src/request/sandbox_transfer_test_clock_list.rs +++ b/src/request/sandbox_transfer_test_clock_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::sandbox_transfer_test_clock_list`]. On request success, this will return a [`SandboxTransferTestClockListResponse`].*/ @@ -14,12 +11,13 @@ pub struct SandboxTransferTestClockListRequest { pub offset: Option, pub start_virtual_time: Option>, } -impl SandboxTransferTestClockListRequest {} impl FluentRequest<'_, SandboxTransferTestClockListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the end_virtual_time field. pub fn end_virtual_time( mut self, end_virtual_time: chrono::DateTime, @@ -27,10 +25,12 @@ impl FluentRequest<'_, SandboxTransferTestClockListRequest> { self.params.end_virtual_time = Some(end_virtual_time); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self } + ///Set the value of the start_virtual_time field. pub fn start_virtual_time( mut self, start_virtual_time: chrono::DateTime, @@ -41,27 +41,49 @@ impl FluentRequest<'_, SandboxTransferTestClockListRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxTransferTestClockListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::SandboxTransferTestClockListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/sandbox/transfer/test_clock/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.end_virtual_time { - r = r.json(json!({ "end_virtual_time" : unwrapped })); + r = r.json(serde_json::json!({ "end_virtual_time" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } if let Some(ref unwrapped) = self.params.start_virtual_time { - r = r.json(json!({ "start_virtual_time" : unwrapped })); + r = r.json(serde_json::json!({ "start_virtual_time" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List test clocks + +Use the `/sandbox/transfer/test_clock/list` endpoint to see a list of all your test clocks in the Sandbox environment, by ascending `virtual_time`. Results are paginated; use the `count` and `offset` query parameters to retrieve the desired test clocks. + +See endpoint docs at .*/ + pub fn sandbox_transfer_test_clock_list( + &self, + ) -> FluentRequest<'_, SandboxTransferTestClockListRequest> { + FluentRequest { + client: self, + params: SandboxTransferTestClockListRequest { + count: None, + end_virtual_time: None, + offset: None, + start_virtual_time: None, + }, + } + } +} diff --git a/src/request/sandbox_user_reset_login.rs b/src/request/sandbox_user_reset_login.rs new file mode 100644 index 00000000..5943f169 --- /dev/null +++ b/src/request/sandbox_user_reset_login.rs @@ -0,0 +1,66 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::sandbox_user_reset_login`]. + +On request success, this will return a [`SandboxUserResetLoginResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SandboxUserResetLoginRequest { + pub item_ids: Option>, + pub user_token: String, +} +impl FluentRequest<'_, SandboxUserResetLoginRequest> { + ///Set the value of the item_ids field. + pub fn item_ids( + mut self, + item_ids: impl IntoIterator>, + ) -> Self { + self + .params + .item_ids = Some( + item_ids.into_iter().map(|s| s.as_ref().to_owned()).collect(), + ); + self + } +} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SandboxUserResetLoginRequest> { + type Output = httpclient::InMemoryResult< + crate::model::SandboxUserResetLoginResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/sandbox/user/reset_login"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.item_ids { + r = r.json(serde_json::json!({ "item_ids" : unwrapped })); + } + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Force item(s) for a Sandbox User into an error state + +`/sandbox/user/reset_login/` functions the same as `/sandbox/item/reset_login`, but will modify Items related to a User. This endpoint forces each Item into an `ITEM_LOGIN_REQUIRED` state in order to simulate an Item whose login is no longer valid. This makes it easy to test Link's [update mode](https://plaid.com/docs/link/update-mode) flow in the Sandbox environment. After calling `/sandbox/user/reset_login`, You can then use Plaid Link update mode to restore Items associated with the User to a good state. An `ITEM_LOGIN_REQUIRED` webhook will also be fired after a call to this endpoint, if one is associated with the Item. + + +In the Sandbox, Items will transition to an `ITEM_LOGIN_REQUIRED` error state automatically after 30 days, even if this endpoint is not called. + +See endpoint docs at .*/ + pub fn sandbox_user_reset_login( + &self, + user_token: &str, + ) -> FluentRequest<'_, SandboxUserResetLoginRequest> { + FluentRequest { + client: self, + params: SandboxUserResetLoginRequest { + item_ids: None, + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/signal_decision_report.rs b/src/request/signal_decision_report.rs index 7b0e930f..33362942 100644 --- a/src/request/signal_decision_report.rs +++ b/src/request/signal_decision_report.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{SignalDecisionOutcome, SignalPaymentMethod}; /**You should use this struct via [`PlaidClient::signal_decision_report`]. On request success, this will return a [`SignalDecisionReportResponse`].*/ @@ -12,12 +10,12 @@ pub struct SignalDecisionReportRequest { pub amount_instantly_available: Option, pub client_transaction_id: String, pub days_funds_on_hold: Option, - pub decision_outcome: Option, + pub decision_outcome: Option, pub initiated: bool, - pub payment_method: Option, + pub payment_method: Option, } -impl SignalDecisionReportRequest {} impl FluentRequest<'_, SignalDecisionReportRequest> { + ///Set the value of the amount_instantly_available field. pub fn amount_instantly_available( mut self, amount_instantly_available: f64, @@ -25,48 +23,78 @@ impl FluentRequest<'_, SignalDecisionReportRequest> { self.params.amount_instantly_available = Some(amount_instantly_available); self } + ///Set the value of the days_funds_on_hold field. pub fn days_funds_on_hold(mut self, days_funds_on_hold: i64) -> Self { self.params.days_funds_on_hold = Some(days_funds_on_hold); self } - pub fn decision_outcome(mut self, decision_outcome: &str) -> Self { - self.params.decision_outcome = Some(decision_outcome.to_owned()); + ///Set the value of the decision_outcome field. + pub fn decision_outcome(mut self, decision_outcome: SignalDecisionOutcome) -> Self { + self.params.decision_outcome = Some(decision_outcome); self } - pub fn payment_method(mut self, payment_method: &str) -> Self { - self.params.payment_method = Some(payment_method.to_owned()); + ///Set the value of the payment_method field. + pub fn payment_method(mut self, payment_method: SignalPaymentMethod) -> Self { + self.params.payment_method = Some(payment_method); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SignalDecisionReportRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/signal/decision/report"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.amount_instantly_available { - r = r.json(json!({ "amount_instantly_available" : unwrapped })); + r = r + .json( + serde_json::json!({ "amount_instantly_available" : unwrapped }), + ); } r = r .json( - json!( + serde_json::json!( { "client_transaction_id" : self.params.client_transaction_id } ), ); if let Some(ref unwrapped) = self.params.days_funds_on_hold { - r = r.json(json!({ "days_funds_on_hold" : unwrapped })); + r = r.json(serde_json::json!({ "days_funds_on_hold" : unwrapped })); } if let Some(ref unwrapped) = self.params.decision_outcome { - r = r.json(json!({ "decision_outcome" : unwrapped })); + r = r.json(serde_json::json!({ "decision_outcome" : unwrapped })); } - r = r.json(json!({ "initiated" : self.params.initiated })); + r = r.json(serde_json::json!({ "initiated" : self.params.initiated })); if let Some(ref unwrapped) = self.params.payment_method { - r = r.json(json!({ "payment_method" : unwrapped })); + r = r.json(serde_json::json!({ "payment_method" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Report whether you initiated an ACH transaction + +After calling `/signal/evaluate`, call `/signal/decision/report` to report whether the transaction was initiated. + +See endpoint docs at .*/ + pub fn signal_decision_report( + &self, + client_transaction_id: &str, + initiated: bool, + ) -> FluentRequest<'_, SignalDecisionReportRequest> { + FluentRequest { + client: self, + params: SignalDecisionReportRequest { + amount_instantly_available: None, + client_transaction_id: client_transaction_id.to_owned(), + days_funds_on_hold: None, + decision_outcome: None, + initiated, + payment_method: None, + }, + } + } +} diff --git a/src/request/signal_evaluate.rs b/src/request/signal_evaluate.rs index c0909b71..36a94aac 100644 --- a/src/request/signal_evaluate.rs +++ b/src/request/signal_evaluate.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{SignalDevice, SignalUser}; /**You should use this struct via [`PlaidClient::signal_evaluate`]. On request success, this will return a [`SignalEvaluateResponse`].*/ @@ -18,87 +16,134 @@ pub struct SignalEvaluateRequest { pub device: Option, pub is_recurring: Option, pub risk_profile_key: Option, + pub ruleset_key: Option, pub user: Option, pub user_present: Option, } -impl SignalEvaluateRequest {} pub struct SignalEvaluateRequired<'a> { pub access_token: &'a str, pub account_id: &'a str, pub amount: f64, pub client_transaction_id: &'a str, } -impl<'a> SignalEvaluateRequired<'a> {} impl FluentRequest<'_, SignalEvaluateRequest> { + ///Set the value of the client_user_id field. pub fn client_user_id(mut self, client_user_id: &str) -> Self { self.params.client_user_id = Some(client_user_id.to_owned()); self } + ///Set the value of the default_payment_method field. pub fn default_payment_method(mut self, default_payment_method: &str) -> Self { self.params.default_payment_method = Some(default_payment_method.to_owned()); self } + ///Set the value of the device field. pub fn device(mut self, device: SignalDevice) -> Self { self.params.device = Some(device); self } + ///Set the value of the is_recurring field. pub fn is_recurring(mut self, is_recurring: bool) -> Self { self.params.is_recurring = Some(is_recurring); self } + ///Set the value of the risk_profile_key field. pub fn risk_profile_key(mut self, risk_profile_key: &str) -> Self { self.params.risk_profile_key = Some(risk_profile_key.to_owned()); self } + ///Set the value of the ruleset_key field. + pub fn ruleset_key(mut self, ruleset_key: &str) -> Self { + self.params.ruleset_key = Some(ruleset_key.to_owned()); + self + } + ///Set the value of the user field. pub fn user(mut self, user: SignalUser) -> Self { self.params.user = Some(user); self } + ///Set the value of the user_present field. pub fn user_present(mut self, user_present: bool) -> Self { self.params.user_present = Some(user_present); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SignalEvaluateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/signal/evaluate"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); - r = r.json(json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); r = r .json( - json!( + serde_json::json!( { "client_transaction_id" : self.params.client_transaction_id } ), ); if let Some(ref unwrapped) = self.params.client_user_id { - r = r.json(json!({ "client_user_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.default_payment_method { - r = r.json(json!({ "default_payment_method" : unwrapped })); + r = r.json(serde_json::json!({ "default_payment_method" : unwrapped })); } if let Some(ref unwrapped) = self.params.device { - r = r.json(json!({ "device" : unwrapped })); + r = r.json(serde_json::json!({ "device" : unwrapped })); } if let Some(ref unwrapped) = self.params.is_recurring { - r = r.json(json!({ "is_recurring" : unwrapped })); + r = r.json(serde_json::json!({ "is_recurring" : unwrapped })); } if let Some(ref unwrapped) = self.params.risk_profile_key { - r = r.json(json!({ "risk_profile_key" : unwrapped })); + r = r.json(serde_json::json!({ "risk_profile_key" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.ruleset_key { + r = r.json(serde_json::json!({ "ruleset_key" : unwrapped })); } if let Some(ref unwrapped) = self.params.user { - r = r.json(json!({ "user" : unwrapped })); + r = r.json(serde_json::json!({ "user" : unwrapped })); } if let Some(ref unwrapped) = self.params.user_present { - r = r.json(json!({ "user_present" : unwrapped })); + r = r.json(serde_json::json!({ "user_present" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Evaluate a planned ACH transaction + +Use `/signal/evaluate` to evaluate a planned ACH transaction to get a return risk assessment (such as a risk score and risk tier) and additional risk signals. + +In order to obtain a valid score for an ACH transaction, Plaid must have an access token for the account, and the Item must be healthy (receiving product updates) or have recently been in a healthy state. If the transaction does not meet eligibility requirements, an error will be returned corresponding to the underlying cause. If `/signal/evaluate` is called on the same transaction multiple times within a 24-hour period, cached results may be returned. For more information please refer to the error documentation on [Item errors](/docs/errors/item/) and [Link in Update Mode](/docs/link/update-mode/). + +Note: This request may take some time to complete if Signal is being added to an existing Item. This is because Plaid must communicate directly with the institution when retrieving the data for the first time. + +See endpoint docs at .*/ + pub fn signal_evaluate( + &self, + args: SignalEvaluateRequired, + ) -> FluentRequest<'_, SignalEvaluateRequest> { + FluentRequest { + client: self, + params: SignalEvaluateRequest { + access_token: args.access_token.to_owned(), + account_id: args.account_id.to_owned(), + amount: args.amount, + client_transaction_id: args.client_transaction_id.to_owned(), + client_user_id: None, + default_payment_method: None, + device: None, + is_recurring: None, + risk_profile_key: None, + ruleset_key: None, + user: None, + user_present: None, + }, + } + } +} diff --git a/src/request/signal_prepare.rs b/src/request/signal_prepare.rs index 6063d8a3..6d1ddfa0 100644 --- a/src/request/signal_prepare.rs +++ b/src/request/signal_prepare.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::signal_prepare`]. On request success, this will return a [`SignalPrepareResponse`].*/ @@ -11,19 +8,38 @@ On request success, this will return a [`SignalPrepareResponse`].*/ pub struct SignalPrepareRequest { pub access_token: String, } -impl SignalPrepareRequest {} impl FluentRequest<'_, SignalPrepareRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SignalPrepareRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/signal/prepare"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Opt-in an Item to Signal + +When an Item is not initialized with Signal, call `/signal/prepare` to opt-in that Item to the Signal data collection process, developing a Signal score. This should be done on Items where Signal was added in the `additional_consented_products` array but not in the `products`, `optional_products`, or `required_if_supported_products` array. If `/signal/prepare` is skipped on an Item that is not initialized with Signal, the initial call to `/signal/evaluate` on that Item will be less accurate, because Signal will have access to less data for computing the Signal score. + +If run on an Item that is already initialized with Signal, this endpoint will return a 200 response and will not modify the Item. + +See endpoint docs at .*/ + pub fn signal_prepare( + &self, + access_token: &str, + ) -> FluentRequest<'_, SignalPrepareRequest> { + FluentRequest { + client: self, + params: SignalPrepareRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/signal_return_report.rs b/src/request/signal_return_report.rs index f94399e7..90ef64c9 100644 --- a/src/request/signal_return_report.rs +++ b/src/request/signal_return_report.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::signal_return_report`]. On request success, this will return a [`SignalReturnReportResponse`].*/ @@ -13,15 +10,15 @@ pub struct SignalReturnReportRequest { pub return_code: String, pub returned_at: Option>, } -impl SignalReturnReportRequest {} impl FluentRequest<'_, SignalReturnReportRequest> { + ///Set the value of the returned_at field. pub fn returned_at(mut self, returned_at: chrono::DateTime) -> Self { self.params.returned_at = Some(returned_at); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SignalReturnReportRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -29,17 +26,38 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, SignalReturnReportReque let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "client_transaction_id" : self.params.client_transaction_id } ), ); - r = r.json(json!({ "return_code" : self.params.return_code })); + r = r.json(serde_json::json!({ "return_code" : self.params.return_code })); if let Some(ref unwrapped) = self.params.returned_at { - r = r.json(json!({ "returned_at" : unwrapped })); + r = r.json(serde_json::json!({ "returned_at" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Report a return for an ACH transaction + +Call the `/signal/return/report` endpoint to report a returned transaction that was previously sent to the `/signal/evaluate` endpoint. Your feedback will be used by the model to incorporate the latest risk trend in your portfolio. + +See endpoint docs at .*/ + pub fn signal_return_report( + &self, + client_transaction_id: &str, + return_code: &str, + ) -> FluentRequest<'_, SignalReturnReportRequest> { + FluentRequest { + client: self, + params: SignalReturnReportRequest { + client_transaction_id: client_transaction_id.to_owned(), + return_code: return_code.to_owned(), + returned_at: None, + }, + } + } +} diff --git a/src/request/statements_download.rs b/src/request/statements_download.rs index afa95ac9..f764da91 100644 --- a/src/request/statements_download.rs +++ b/src/request/statements_download.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::statements_download`]. On request success, this will return a [`String`].*/ @@ -12,7 +9,6 @@ pub struct StatementsDownloadRequest { pub access_token: String, pub statement_id: String, } -impl StatementsDownloadRequest {} impl FluentRequest<'_, StatementsDownloadRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, StatementsDownloadRequest> { type Output = httpclient::InMemoryResult; @@ -21,11 +17,31 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, StatementsDownloadReque Box::pin(async move { let url = "/statements/download"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "statement_id" : self.params.statement_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "statement_id" : self.params.statement_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a single statement. + +The `/statements/download` endpoint retrieves a single statement PDF in binary format. The response will contain a `Plaid-Content-Hash` header containing a SHA 256 checksum of the statement. This can be used to verify that the file being sent by Plaid is the same file that was downloaded to your system. + +See endpoint docs at .*/ + pub fn statements_download( + &self, + access_token: &str, + statement_id: &str, + ) -> FluentRequest<'_, StatementsDownloadRequest> { + FluentRequest { + client: self, + params: StatementsDownloadRequest { + access_token: access_token.to_owned(), + statement_id: statement_id.to_owned(), + }, + } + } +} diff --git a/src/request/statements_list.rs b/src/request/statements_list.rs index a8a05168..73c04d60 100644 --- a/src/request/statements_list.rs +++ b/src/request/statements_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::statements_list`]. On request success, this will return a [`StatementsListResponse`].*/ @@ -11,19 +8,36 @@ On request success, this will return a [`StatementsListResponse`].*/ pub struct StatementsListRequest { pub access_token: String, } -impl StatementsListRequest {} impl FluentRequest<'_, StatementsListRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, StatementsListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/statements/list"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a list of all statements associated with an item. + +The `/statements/list` endpoint retrieves a list of all statements associated with an item. + +See endpoint docs at .*/ + pub fn statements_list( + &self, + access_token: &str, + ) -> FluentRequest<'_, StatementsListRequest> { + FluentRequest { + client: self, + params: StatementsListRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/statements_refresh.rs b/src/request/statements_refresh.rs index 2e381891..bfa0d35b 100644 --- a/src/request/statements_refresh.rs +++ b/src/request/statements_refresh.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::statements_refresh`]. On request success, this will return a [`StatementsRefreshResponse`].*/ @@ -13,21 +10,42 @@ pub struct StatementsRefreshRequest { pub end_date: chrono::NaiveDate, pub start_date: chrono::NaiveDate, } -impl StatementsRefreshRequest {} impl FluentRequest<'_, StatementsRefreshRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, StatementsRefreshRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/statements/refresh"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "end_date" : self.params.end_date })); - r = r.json(json!({ "start_date" : self.params.start_date })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "end_date" : self.params.end_date })); + r = r.json(serde_json::json!({ "start_date" : self.params.start_date })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Refresh statements data. + +`/statements/refresh` initiates an on-demand extraction to fetch the statements for the provided dates. + +See endpoint docs at .*/ + pub fn statements_refresh( + &self, + access_token: &str, + end_date: chrono::NaiveDate, + start_date: chrono::NaiveDate, + ) -> FluentRequest<'_, StatementsRefreshRequest> { + FluentRequest { + client: self, + params: StatementsRefreshRequest { + access_token: access_token.to_owned(), + end_date, + start_date, + }, + } + } +} diff --git a/src/request/transactions_enhance.rs b/src/request/transactions_enhance.rs index 54a38b05..a815006c 100644 --- a/src/request/transactions_enhance.rs +++ b/src/request/transactions_enhance.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::ClientProvidedRawTransaction; /**You should use this struct via [`PlaidClient::transactions_enhance`]. On request success, this will return a [`TransactionsEnhanceGetResponse`].*/ @@ -12,20 +10,41 @@ pub struct TransactionsEnhanceRequest { pub account_type: String, pub transactions: Vec, } -impl TransactionsEnhanceRequest {} impl FluentRequest<'_, TransactionsEnhanceRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsEnhanceRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransactionsEnhanceGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beta/transactions/v1/enhance"; let mut r = self.client.client.post(url); - r = r.json(json!({ "account_type" : self.params.account_type })); - r = r.json(json!({ "transactions" : self.params.transactions })); + r = r.json(serde_json::json!({ "account_type" : self.params.account_type })); + r = r.json(serde_json::json!({ "transactions" : self.params.transactions })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**enhance locally-held transaction data + +The `/beta/transactions/v1/enhance` endpoint enriches raw transaction data provided directly by clients. + +The product is currently in beta.*/ + pub fn transactions_enhance( + &self, + account_type: &str, + transactions: Vec, + ) -> FluentRequest<'_, TransactionsEnhanceRequest> { + FluentRequest { + client: self, + params: TransactionsEnhanceRequest { + account_type: account_type.to_owned(), + transactions, + }, + } + } +} diff --git a/src/request/transactions_enrich.rs b/src/request/transactions_enrich.rs index ce95df75..99e80b30 100644 --- a/src/request/transactions_enrich.rs +++ b/src/request/transactions_enrich.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{TransactionsEnrichRequestOptions, ClientProvidedTransaction}; /**You should use this struct via [`PlaidClient::transactions_enrich`]. On request success, this will return a [`TransactionsEnrichResponse`].*/ @@ -13,28 +11,49 @@ pub struct TransactionsEnrichRequest { pub options: Option, pub transactions: Vec, } -impl TransactionsEnrichRequest {} impl FluentRequest<'_, TransactionsEnrichRequest> { + ///Set the value of the options field. pub fn options(mut self, options: TransactionsEnrichRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsEnrichRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transactions/enrich"; let mut r = self.client.client.post(url); - r = r.json(json!({ "account_type" : self.params.account_type })); + r = r.json(serde_json::json!({ "account_type" : self.params.account_type })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "transactions" : self.params.transactions })); + r = r.json(serde_json::json!({ "transactions" : self.params.transactions })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Enrich locally-held transaction data + +The `/transactions/enrich` endpoint enriches raw transaction data generated by your own banking products or retrieved from other non-Plaid sources. + +See endpoint docs at .*/ + pub fn transactions_enrich( + &self, + account_type: &str, + transactions: Vec, + ) -> FluentRequest<'_, TransactionsEnrichRequest> { + FluentRequest { + client: self, + params: TransactionsEnrichRequest { + account_type: account_type.to_owned(), + options: None, + transactions, + }, + } + } +} diff --git a/src/request/transactions_get.rs b/src/request/transactions_get.rs index 377c69ee..36ea6a2b 100644 --- a/src/request/transactions_get.rs +++ b/src/request/transactions_get.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransactionsGetRequestOptions; /**You should use this struct via [`PlaidClient::transactions_get`]. On request success, this will return a [`TransactionsGetResponse`].*/ @@ -14,29 +12,62 @@ pub struct TransactionsGetRequest { pub options: Option, pub start_date: chrono::NaiveDate, } -impl TransactionsGetRequest {} impl FluentRequest<'_, TransactionsGetRequest> { + ///Set the value of the options field. pub fn options(mut self, options: TransactionsGetRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transactions/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "end_date" : self.params.end_date })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "end_date" : self.params.end_date })); if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "start_date" : self.params.start_date })); + r = r.json(serde_json::json!({ "start_date" : self.params.start_date })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get transaction data + +Note: All new implementations are encouraged to use `/transactions/sync` rather than `/transactions/get`. `/transactions/sync` provides the same functionality as `/transactions/get` and improves developer ease-of-use for handling transactions updates. + +The `/transactions/get` endpoint allows developers to receive user-authorized transaction data for credit, depository, and some loan-type accounts (only those with account subtype `student`; coverage may be limited). For transaction history from investments accounts, use the [Investments endpoint](https://plaid.com/docs/api/products/investments/) instead. Transaction data is standardized across financial institutions, and in many cases transactions are linked to a clean name, entity type, location, and category. Similarly, account data is standardized and returned with a clean name, number, balance, and other meta information where available. + +Transactions are returned in reverse-chronological order, and the sequence of transaction ordering is stable and will not shift. Transactions are not immutable and can also be removed altogether by the institution; a removed transaction will no longer appear in `/transactions/get`. For more details, see [Pending and posted transactions](https://plaid.com/docs/transactions/transactions-data/#pending-and-posted-transactions). + +Due to the potentially large number of transactions associated with an Item, results are paginated. Manipulate the `count` and `offset` parameters in conjunction with the `total_transactions` response body field to fetch all available transactions. + +Data returned by `/transactions/get` will be the data available for the Item as of the most recent successful check for new transactions. Plaid typically checks for new data multiple times a day, but these checks may occur less frequently, such as once a day, depending on the institution. To find out when the Item was last updated, use the [Item Debugger](https://plaid.com/docs/account/activity/#troubleshooting-with-item-debugger) or call `/item/get`; the `item.status.transactions.last_successful_update` field will show the timestamp of the most recent successful update. To force Plaid to check for new transactions, you can use the `/transactions/refresh` endpoint. + +Note that data may not be immediately available to `/transactions/get`. Plaid will begin to prepare transactions data upon Item link, if Link was initialized with `transactions`, or upon the first call to `/transactions/get`, if it wasn't. To be alerted when transaction data is ready to be fetched, listen for the [`INITIAL_UPDATE`](https://plaid.com/docs/api/products/transactions/#initial_update) and [`HISTORICAL_UPDATE`](https://plaid.com/docs/api/products/transactions/#historical_update) webhooks. If no transaction history is ready when `/transactions/get` is called, it will return a `PRODUCT_NOT_READY` error. + +See endpoint docs at .*/ + pub fn transactions_get( + &self, + access_token: &str, + end_date: chrono::NaiveDate, + start_date: chrono::NaiveDate, + ) -> FluentRequest<'_, TransactionsGetRequest> { + FluentRequest { + client: self, + params: TransactionsGetRequest { + access_token: access_token.to_owned(), + end_date, + options: None, + start_date, + }, + } + } +} diff --git a/src/request/transactions_recurring_get.rs b/src/request/transactions_recurring_get.rs index 4f80f455..ddaf98c8 100644 --- a/src/request/transactions_recurring_get.rs +++ b/src/request/transactions_recurring_get.rs @@ -1,20 +1,30 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransactionsRecurringGetRequestOptions; /**You should use this struct via [`PlaidClient::transactions_recurring_get`]. On request success, this will return a [`TransactionsRecurringGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionsRecurringGetRequest { pub access_token: String, - pub account_ids: Vec, + pub account_ids: Option>, pub options: Option, } -impl TransactionsRecurringGetRequest {} impl FluentRequest<'_, TransactionsRecurringGetRequest> { + ///Set the value of the account_ids field. + pub fn account_ids( + mut self, + account_ids: impl IntoIterator>, + ) -> Self { + self + .params + .account_ids = Some( + account_ids.into_iter().map(|s| s.as_ref().to_owned()).collect(), + ); + self + } + ///Set the value of the options field. pub fn options(mut self, options: TransactionsRecurringGetRequestOptions) -> Self { self.params.options = Some(options); self @@ -22,20 +32,52 @@ impl FluentRequest<'_, TransactionsRecurringGetRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsRecurringGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransactionsRecurringGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transactions/recurring/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_ids" : self.params.account_ids })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + if let Some(ref unwrapped) = self.params.account_ids { + r = r.json(serde_json::json!({ "account_ids" : unwrapped })); + } if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Fetch recurring transaction streams + +The `/transactions/recurring/get` endpoint allows developers to receive a summary of the recurring outflow and inflow streams (expenses and deposits) from a user’s checking, savings or credit card accounts. Additionally, Plaid provides key insights about each recurring stream including the category, merchant, last amount, and more. Developers can use these insights to build tools and experiences that help their users better manage cash flow, monitor subscriptions, reduce spend, and stay on track with bill payments. + +This endpoint is offered as an add-on to Transactions. To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. + +This endpoint can only be called on an Item that has already been initialized with Transactions (either during Link, by specifying it in `/link/token/create`; or after Link, by calling `/transactions/get` or `/transactions/sync`). + +When using Recurring Transactions, for best results, make sure to use the [`days_requested`](https://plaid.com/docs/api/link/#link-token-create-request-transactions-days-requested) parameter to request at least 180 days of history when initializing Items with Transactions. Once all historical transactions have been fetched, call `/transactions/recurring/get` to receive the Recurring Transactions streams and subscribe to the [`RECURRING_TRANSACTIONS_UPDATE`](https://plaid.com/docs/api/products/transactions/#recurring_transactions_update) webhook. To know when historical transactions have been fetched, if you are using `/transactions/sync` listen for the [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#SyncUpdatesAvailableWebhook-historical-update-complete) webhook and check that the `historical_update_complete` field in the payload is `true`. If using `/transactions/get`, listen for the [`HISTORICAL_UPDATE`](https://plaid.com/docs/api/products/transactions/#historical_update) webhook. + +After the initial call, you can call `/transactions/recurring/get` endpoint at any point in the future to retrieve the latest summary of recurring streams. Listen to the [`RECURRING_TRANSACTIONS_UPDATE`](https://plaid.com/docs/api/products/transactions/#recurring_transactions_update) webhook to be notified when new updates are available. + +See endpoint docs at .*/ + pub fn transactions_recurring_get( + &self, + access_token: &str, + ) -> FluentRequest<'_, TransactionsRecurringGetRequest> { + FluentRequest { + client: self, + params: TransactionsRecurringGetRequest { + access_token: access_token.to_owned(), + account_ids: None, + options: None, + }, + } + } +} diff --git a/src/request/transactions_refresh.rs b/src/request/transactions_refresh.rs index eb99fd69..8ea3dbba 100644 --- a/src/request/transactions_refresh.rs +++ b/src/request/transactions_refresh.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transactions_refresh`]. On request success, this will return a [`TransactionsRefreshResponse`].*/ @@ -11,19 +8,44 @@ On request success, this will return a [`TransactionsRefreshResponse`].*/ pub struct TransactionsRefreshRequest { pub access_token: String, } -impl TransactionsRefreshRequest {} impl FluentRequest<'_, TransactionsRefreshRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsRefreshRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transactions/refresh"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Refresh transaction data + +`/transactions/refresh` is an optional endpoint that initiates an on-demand extraction to fetch the newest transactions for an Item. The on-demand extraction takes place in addition to the periodic extractions that automatically occur one or more times per day for any Transactions-enabled Item. The Item must already have Transactions added as a product in order to call `/transactions/refresh`. + +If changes to transactions are discovered after calling `/transactions/refresh`, Plaid will fire a webhook: for `/transactions/sync` users, [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#sync_updates_available) will be fired if there are any transactions updated, added, or removed. For users of both `/transactions/sync` and `/transactions/get`, [`TRANSACTIONS_REMOVED`](https://plaid.com/docs/api/products/transactions/#transactions_removed) will be fired if any removed transactions are detected, and [`DEFAULT_UPDATE`](https://plaid.com/docs/api/products/transactions/#default_update) will be fired if any new transactions are detected. New transactions can be fetched by calling `/transactions/get` or `/transactions/sync`. + +Note that the `/transactions/refresh` endpoint is not supported for Capital One (`ins_128026`) non-depository accounts and will result in a `PRODUCTS_NOT_SUPPORTED` error if called on an Item that contains only non-depository accounts from that institution. + +As this endpoint triggers a synchronous request for fresh data, latency may be higher than for other Plaid endpoints (typically less than 10 seconds, but occasionally up to 30 seconds or more); if you encounter errors, you may find it necessary to adjust your timeout period when making requests. + +`/transactions/refresh` is offered as an optional add-on to Transactions and has a separate [fee model](/docs/account/billing/#per-request-flat-fee). To request access to this endpoint, submit a [product access request](https://dashboard.plaid.com/team/products) or contact your Plaid account manager. + +See endpoint docs at .*/ + pub fn transactions_refresh( + &self, + access_token: &str, + ) -> FluentRequest<'_, TransactionsRefreshRequest> { + FluentRequest { + client: self, + params: TransactionsRefreshRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/transactions_rules_create.rs b/src/request/transactions_rules_create.rs index 0ffd91ca..5d7c4a31 100644 --- a/src/request/transactions_rules_create.rs +++ b/src/request/transactions_rules_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransactionsRuleDetails; /**You should use this struct via [`PlaidClient::transactions_rules_create`]. On request success, this will return a [`TransactionsRulesCreateResponse`].*/ @@ -13,28 +11,53 @@ pub struct TransactionsRulesCreateRequest { pub personal_finance_category: String, pub rule_details: TransactionsRuleDetails, } -impl TransactionsRulesCreateRequest {} impl FluentRequest<'_, TransactionsRulesCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsRulesCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransactionsRulesCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beta/transactions/rules/v1/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = r .json( - json!( + serde_json::json!( { "personal_finance_category" : self.params .personal_finance_category } ), ); - r = r.json(json!({ "rule_details" : self.params.rule_details })); + r = r.json(serde_json::json!({ "rule_details" : self.params.rule_details })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create transaction category rule + +The `/transactions/rules/v1/create` endpoint creates transaction categorization rules. + +Rules will be applied on the Item's transactions returned in `/transactions/get` response. + +The product is currently in beta. To request access, contact transactions-feedback@plaid.com.*/ + pub fn transactions_rules_create( + &self, + access_token: &str, + personal_finance_category: &str, + rule_details: TransactionsRuleDetails, + ) -> FluentRequest<'_, TransactionsRulesCreateRequest> { + FluentRequest { + client: self, + params: TransactionsRulesCreateRequest { + access_token: access_token.to_owned(), + personal_finance_category: personal_finance_category.to_owned(), + rule_details, + }, + } + } +} diff --git a/src/request/transactions_rules_list.rs b/src/request/transactions_rules_list.rs index 1b885f15..efb71727 100644 --- a/src/request/transactions_rules_list.rs +++ b/src/request/transactions_rules_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transactions_rules_list`]. On request success, this will return a [`TransactionsRulesListResponse`].*/ @@ -11,19 +8,36 @@ On request success, this will return a [`TransactionsRulesListResponse`].*/ pub struct TransactionsRulesListRequest { pub access_token: String, } -impl TransactionsRulesListRequest {} impl FluentRequest<'_, TransactionsRulesListRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsRulesListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransactionsRulesListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beta/transactions/rules/v1/list"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Return a list of rules created for the Item associated with the access token. + +The `/transactions/rules/v1/list` returns a list of transaction rules created for the Item associated with the access token.*/ + pub fn transactions_rules_list( + &self, + access_token: &str, + ) -> FluentRequest<'_, TransactionsRulesListRequest> { + FluentRequest { + client: self, + params: TransactionsRulesListRequest { + access_token: access_token.to_owned(), + }, + } + } +} diff --git a/src/request/transactions_rules_remove.rs b/src/request/transactions_rules_remove.rs index 8bf2163e..c75f7f0a 100644 --- a/src/request/transactions_rules_remove.rs +++ b/src/request/transactions_rules_remove.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transactions_rules_remove`]. On request success, this will return a [`TransactionsRulesRemoveResponse`].*/ @@ -12,21 +9,40 @@ pub struct TransactionsRulesRemoveRequest { pub access_token: String, pub rule_id: String, } -impl TransactionsRulesRemoveRequest {} impl FluentRequest<'_, TransactionsRulesRemoveRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsRulesRemoveRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransactionsRulesRemoveResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beta/transactions/rules/v1/remove"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "rule_id" : self.params.rule_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "rule_id" : self.params.rule_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Remove transaction rule + +The `/transactions/rules/v1/remove` endpoint is used to remove a transaction rule.*/ + pub fn transactions_rules_remove( + &self, + access_token: &str, + rule_id: &str, + ) -> FluentRequest<'_, TransactionsRulesRemoveRequest> { + FluentRequest { + client: self, + params: TransactionsRulesRemoveRequest { + access_token: access_token.to_owned(), + rule_id: rule_id.to_owned(), + }, + } + } +} diff --git a/src/request/transactions_sync.rs b/src/request/transactions_sync.rs index 00581487..b990adad 100644 --- a/src/request/transactions_sync.rs +++ b/src/request/transactions_sync.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransactionsSyncRequestOptions; /**You should use this struct via [`PlaidClient::transactions_sync`]. On request success, this will return a [`TransactionsSyncResponse`].*/ @@ -14,41 +12,82 @@ pub struct TransactionsSyncRequest { pub cursor: Option, pub options: Option, } -impl TransactionsSyncRequest {} impl FluentRequest<'_, TransactionsSyncRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self } + ///Set the value of the options field. pub fn options(mut self, options: TransactionsSyncRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsSyncRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transactions/sync"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get incremental transaction updates on an Item + +The `/transactions/sync` endpoint allows developers to subscribe to all transactions associated with an Item and get updates synchronously in a stream-like manner, using a cursor to track which updates have already been seen. + +`/transactions/sync` provides the same functionality as `/transactions/get` and can be used instead of `/transactions/get` to simplify the process of tracking transactions updates. To learn more about migrating from `/transactions/get`, see the [Transactions Sync migration guide](https://plaid.com/docs/transactions/sync-migration/). + +This endpoint provides user-authorized transaction data for `credit`, `depository`, and some loan-type accounts (only those with account subtype `student`; coverage may be limited). For transaction history from `investments` accounts, use `/investments/transactions/get` instead. + +Returned transactions data is grouped into three types of update, indicating whether the transaction was added, removed, or modified since the last call to the API. + +In the first call to `/transactions/sync` for an Item, the endpoint will return all historical transactions data associated with that Item up until the time of the API call (as "adds"), which then generates a `next_cursor` for that Item. In subsequent calls, send the `next_cursor` to receive only the changes that have occurred since the previous call. + +Due to the potentially large number of transactions associated with an Item, results are paginated. The `has_more` field specifies if additional calls are necessary to fetch all available transaction updates. Call `/transactions/sync` with the new cursor, pulling all updates, until `has_more` is `false`. + +When retrieving paginated updates, track both the `next_cursor` from the latest response and the original cursor from the first call in which `has_more` was `true`; if a call to `/transactions/sync` fails due to the [`TRANSACTIONS_SYNC_MUTATION_DURING_PAGINATION`](https://plaid.com/docs/errors/transactions/#transactions_sync_mutation_during_pagination) error, the entire pagination request loop must be restarted beginning with the cursor for the first page of the update, rather than retrying only the single request that failed. + +Whenever new or updated transaction data becomes available, `/transactions/sync` will provide these updates. Plaid typically checks for new data multiple times a day, but these checks may occur less frequently, such as once a day, depending on the institution. To find out when the Item was last updated, use the [Item Debugger](https://plaid.com/docs/account/activity/#troubleshooting-with-item-debugger) or call `/item/get`; the `item.status.transactions.last_successful_update` field will show the timestamp of the most recent successful update. To force Plaid to check for new transactions, use the `/transactions/refresh` endpoint. + +For newly created Items, data may not be immediately available to `/transactions/sync`. Plaid begins preparing transactions data when the Item is created, but the process can take anywhere from a few seconds to several minutes to complete, depending on the number of transactions available. + +To be alerted when new data is available, listen for the [`SYNC_UPDATES_AVAILABLE`](https://plaid.com/docs/api/products/transactions/#sync_updates_available) webhook. + +See endpoint docs at .*/ + pub fn transactions_sync( + &self, + access_token: &str, + ) -> FluentRequest<'_, TransactionsSyncRequest> { + FluentRequest { + client: self, + params: TransactionsSyncRequest { + access_token: access_token.to_owned(), + count: None, + cursor: None, + options: None, + }, + } + } +} diff --git a/src/request/transactions_user_insights_get.rs b/src/request/transactions_user_insights_get.rs index 9120ba6a..9fd66177 100644 --- a/src/request/transactions_user_insights_get.rs +++ b/src/request/transactions_user_insights_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transactions_user_insights_get`]. On request success, this will return a [`TransactionsUserInsightsGetResponse`].*/ @@ -11,20 +8,44 @@ On request success, this will return a [`TransactionsUserInsightsGetResponse`].* pub struct TransactionsUserInsightsGetRequest { pub client_user_id: String, } -impl TransactionsUserInsightsGetRequest {} impl FluentRequest<'_, TransactionsUserInsightsGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransactionsUserInsightsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransactionsUserInsightsGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/beta/transactions/user_insights/v1/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "client_user_id" : self.params.client_user_id })); + r = r + .json( + serde_json::json!({ "client_user_id" : self.params.client_user_id }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Obtain user insights based on transactions sent through /transactions/enrich + +The `/beta/transactions/user_insights/v1/get` gets user insights for clients who have enriched data with `/transactions/enrich`. + +The product is currently in beta. + +See endpoint docs at .*/ + pub fn transactions_user_insights_get( + &self, + client_user_id: &str, + ) -> FluentRequest<'_, TransactionsUserInsightsGetRequest> { + FluentRequest { + client: self, + params: TransactionsUserInsightsGetRequest { + client_user_id: client_user_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_authorization_cancel.rs b/src/request/transfer_authorization_cancel.rs new file mode 100644 index 00000000..3999d072 --- /dev/null +++ b/src/request/transfer_authorization_cancel.rs @@ -0,0 +1,51 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::transfer_authorization_cancel`]. + +On request success, this will return a [`TransferAuthorizationCancelResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TransferAuthorizationCancelRequest { + pub authorization_id: String, +} +impl FluentRequest<'_, TransferAuthorizationCancelRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, TransferAuthorizationCancelRequest> { + type Output = httpclient::InMemoryResult< + crate::model::TransferAuthorizationCancelResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/transfer/authorization/cancel"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!( + { "authorization_id" : self.params.authorization_id } + ), + ); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Cancel a transfer authorization + +Use the `/transfer/authorization/cancel` endpoint to cancel a transfer authorization. A transfer authorization is eligible for cancellation if it has not yet been used to create a transfer. + +See endpoint docs at .*/ + pub fn transfer_authorization_cancel( + &self, + authorization_id: &str, + ) -> FluentRequest<'_, TransferAuthorizationCancelRequest> { + FluentRequest { + client: self, + params: TransferAuthorizationCancelRequest { + authorization_id: authorization_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_authorization_create.rs b/src/request/transfer_authorization_create.rs index a5a87f75..7935b171 100644 --- a/src/request/transfer_authorization_create.rs +++ b/src/request/transfer_authorization_create.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + ACHClass, TransferCreditFundsSource, TransferAuthorizationDevice, TransferNetwork, + TransferType, TransferAuthorizationUserInRequest, TransferWireDetails, +}; /**You should use this struct via [`PlaidClient::transfer_authorization_create`]. On request success, this will return a [`TransferAuthorizationCreateResponse`].*/ @@ -11,7 +12,7 @@ On request success, this will return a [`TransferAuthorizationCreateResponse`].* pub struct TransferAuthorizationCreateRequest { pub access_token: String, pub account_id: String, - pub ach_class: Option, + pub ach_class: Option, pub amount: String, pub beacon_session_id: Option, pub credit_funds_source: Option, @@ -19,35 +20,38 @@ pub struct TransferAuthorizationCreateRequest { pub funding_account_id: Option, pub idempotency_key: Option, pub iso_currency_code: Option, - pub network: String, + pub ledger_id: Option, + pub network: TransferNetwork, pub origination_account_id: Option, pub originator_client_id: Option, pub payment_profile_token: Option, pub test_clock_id: Option, - pub type_: String, + pub type_: TransferType, pub user: TransferAuthorizationUserInRequest, pub user_present: Option, + pub wire_details: Option, pub with_guarantee: Option, } -impl TransferAuthorizationCreateRequest {} pub struct TransferAuthorizationCreateRequired<'a> { pub access_token: &'a str, pub account_id: &'a str, pub amount: &'a str, - pub network: &'a str, - pub type_: &'a str, + pub network: TransferNetwork, + pub type_: TransferType, pub user: TransferAuthorizationUserInRequest, } -impl<'a> TransferAuthorizationCreateRequired<'a> {} impl FluentRequest<'_, TransferAuthorizationCreateRequest> { - pub fn ach_class(mut self, ach_class: &str) -> Self { - self.params.ach_class = Some(ach_class.to_owned()); + ///Set the value of the ach_class field. + pub fn ach_class(mut self, ach_class: AchClass) -> Self { + self.params.ach_class = Some(ach_class); self } + ///Set the value of the beacon_session_id field. pub fn beacon_session_id(mut self, beacon_session_id: &str) -> Self { self.params.beacon_session_id = Some(beacon_session_id.to_owned()); self } + ///Set the value of the credit_funds_source field. pub fn credit_funds_source( mut self, credit_funds_source: TransferCreditFundsSource, @@ -55,42 +59,62 @@ impl FluentRequest<'_, TransferAuthorizationCreateRequest> { self.params.credit_funds_source = Some(credit_funds_source); self } + ///Set the value of the device field. pub fn device(mut self, device: TransferAuthorizationDevice) -> Self { self.params.device = Some(device); self } + ///Set the value of the funding_account_id field. pub fn funding_account_id(mut self, funding_account_id: &str) -> Self { self.params.funding_account_id = Some(funding_account_id.to_owned()); self } + ///Set the value of the idempotency_key field. pub fn idempotency_key(mut self, idempotency_key: &str) -> Self { self.params.idempotency_key = Some(idempotency_key.to_owned()); self } + ///Set the value of the iso_currency_code field. pub fn iso_currency_code(mut self, iso_currency_code: &str) -> Self { self.params.iso_currency_code = Some(iso_currency_code.to_owned()); self } + ///Set the value of the ledger_id field. + pub fn ledger_id(mut self, ledger_id: &str) -> Self { + self.params.ledger_id = Some(ledger_id.to_owned()); + self + } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } + ///Set the value of the payment_profile_token field. pub fn payment_profile_token(mut self, payment_profile_token: &str) -> Self { self.params.payment_profile_token = Some(payment_profile_token.to_owned()); self } + ///Set the value of the test_clock_id field. pub fn test_clock_id(mut self, test_clock_id: &str) -> Self { self.params.test_clock_id = Some(test_clock_id.to_owned()); self } + ///Set the value of the user_present field. pub fn user_present(mut self, user_present: bool) -> Self { self.params.user_present = Some(user_present); self } + ///Set the value of the wire_details field. + pub fn wire_details(mut self, wire_details: TransferWireDetails) -> Self { + self.params.wire_details = Some(wire_details); + self + } + ///Set the value of the with_guarantee field. pub fn with_guarantee(mut self, with_guarantee: bool) -> Self { self.params.with_guarantee = Some(with_guarantee); self @@ -98,60 +122,128 @@ impl FluentRequest<'_, TransferAuthorizationCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferAuthorizationCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferAuthorizationCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/authorization/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); if let Some(ref unwrapped) = self.params.ach_class { - r = r.json(json!({ "ach_class" : unwrapped })); + r = r.json(serde_json::json!({ "ach_class" : unwrapped })); } - r = r.json(json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); if let Some(ref unwrapped) = self.params.beacon_session_id { - r = r.json(json!({ "beacon_session_id" : unwrapped })); + r = r.json(serde_json::json!({ "beacon_session_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.credit_funds_source { - r = r.json(json!({ "credit_funds_source" : unwrapped })); + r = r.json(serde_json::json!({ "credit_funds_source" : unwrapped })); } if let Some(ref unwrapped) = self.params.device { - r = r.json(json!({ "device" : unwrapped })); + r = r.json(serde_json::json!({ "device" : unwrapped })); } if let Some(ref unwrapped) = self.params.funding_account_id { - r = r.json(json!({ "funding_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "funding_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.idempotency_key { - r = r.json(json!({ "idempotency_key" : unwrapped })); + r = r.json(serde_json::json!({ "idempotency_key" : unwrapped })); } if let Some(ref unwrapped) = self.params.iso_currency_code { - r = r.json(json!({ "iso_currency_code" : unwrapped })); + r = r.json(serde_json::json!({ "iso_currency_code" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.ledger_id { + r = r.json(serde_json::json!({ "ledger_id" : unwrapped })); } - r = r.json(json!({ "network" : self.params.network })); + r = r.json(serde_json::json!({ "network" : self.params.network })); if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.payment_profile_token { - r = r.json(json!({ "payment_profile_token" : unwrapped })); + r = r.json(serde_json::json!({ "payment_profile_token" : unwrapped })); } if let Some(ref unwrapped) = self.params.test_clock_id { - r = r.json(json!({ "test_clock_id" : unwrapped })); + r = r.json(serde_json::json!({ "test_clock_id" : unwrapped })); } - r = r.json(json!({ "type" : self.params.type_ })); - r = r.json(json!({ "user" : self.params.user })); + r = r.json(serde_json::json!({ "type" : self.params.type_ })); + r = r.json(serde_json::json!({ "user" : self.params.user })); if let Some(ref unwrapped) = self.params.user_present { - r = r.json(json!({ "user_present" : unwrapped })); + r = r.json(serde_json::json!({ "user_present" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.wire_details { + r = r.json(serde_json::json!({ "wire_details" : unwrapped })); } if let Some(ref unwrapped) = self.params.with_guarantee { - r = r.json(json!({ "with_guarantee" : unwrapped })); + r = r.json(serde_json::json!({ "with_guarantee" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a transfer authorization + +Use the `/transfer/authorization/create` endpoint to authorize a transfer. This endpoint must be called prior to calling `/transfer/create`. The transfer authorization will expire if not used after one hour. (You can contact your account manager to change the default authorization lifetime.) + +There are four possible outcomes to calling this endpoint: + + - If the `authorization.decision` in the response is `declined`, the proposed transfer has failed the risk check and you cannot proceed with the transfer. + + - If the `authorization.decision` is `user_action_required`, additional user input is needed, usually to fix a broken bank connection, before Plaid can properly assess the risk. You need to launch Link in update mode to complete the required user action. When calling `/link/token/create` to get a new Link token, instead of providing `access_token` in the request, you should set [`transfer.authorization_id`](https://plaid.com/docs/api/link/#link-token-create-request-transfer-authorization-id) as the `authorization.id`. After the Link flow is completed, you may re-attempt the authorization. + + - If the `authorization.decision` is `approved`, and the `authorization.rationale_code` is `null`, the transfer has passed the risk check and you can proceed to call `/transfer/create`. + + - If the `authorization.decision` is `approved` and the `authorization.rationale_code` is non-`null`, the risk check could not be run: you may proceed with the transfer, but should perform your own risk evaluation. For more details, see the response schema. + +In Plaid's Sandbox environment the decisions will be returned as follows: + + - To approve a transfer with `null` rationale code, make an authorization request with an `amount` less than the available balance in the account. + + - To approve a transfer with the rationale code `MANUALLY_VERIFIED_ITEM`, create an Item in Link through the [Same Day Micro-deposits flow](https://plaid.com/docs/auth/coverage/testing/#testing-same-day-micro-deposits). + + - To get an authorization decision of `user_action_required`, [reset the login for an Item](https://plaid.com/docs/sandbox/#item_login_required). + + - To decline a transfer with the rationale code `NSF`, the available balance on the account must be less than the authorization `amount`. See [Create Sandbox test data](https://plaid.com/docs/sandbox/user-custom/) for details on how to customize data in Sandbox. + + - To decline a transfer with the rationale code `RISK`, the available balance on the account must be exactly $0. See [Create Sandbox test data](https://plaid.com/docs/sandbox/user-custom/) for details on how to customize data in Sandbox. + +See endpoint docs at .*/ + pub fn transfer_authorization_create( + &self, + args: TransferAuthorizationCreateRequired, + ) -> FluentRequest<'_, TransferAuthorizationCreateRequest> { + FluentRequest { + client: self, + params: TransferAuthorizationCreateRequest { + access_token: args.access_token.to_owned(), + account_id: args.account_id.to_owned(), + ach_class: None, + amount: args.amount.to_owned(), + beacon_session_id: None, + credit_funds_source: None, + device: None, + funding_account_id: None, + idempotency_key: None, + iso_currency_code: None, + ledger_id: None, + network: args.network, + origination_account_id: None, + originator_client_id: None, + payment_profile_token: None, + test_clock_id: None, + type_: args.type_, + user: args.user, + user_present: None, + wire_details: None, + with_guarantee: None, + }, + } + } +} diff --git a/src/request/transfer_balance_get.rs b/src/request/transfer_balance_get.rs index f830a8ff..43bd76ea 100644 --- a/src/request/transfer_balance_get.rs +++ b/src/request/transfer_balance_get.rs @@ -1,44 +1,59 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransferBalanceType; /**You should use this struct via [`PlaidClient::transfer_balance_get`]. On request success, this will return a [`TransferBalanceGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferBalanceGetRequest { pub originator_client_id: Option, - pub type_: Option, + pub type_: Option, } -impl TransferBalanceGetRequest {} impl FluentRequest<'_, TransferBalanceGetRequest> { + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } - pub fn type_(mut self, type_: &str) -> Self { - self.params.type_ = Some(type_.to_owned()); + ///Set the value of the type_ field. + pub fn type_(mut self, type_: TransferBalanceType) -> Self { + self.params.type_ = Some(type_); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferBalanceGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/balance/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.type_ { - r = r.json(json!({ "type" : unwrapped })); + r = r.json(serde_json::json!({ "type" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**(Deprecated) Retrieve a balance held with Plaid + +(Deprecated) Use the `/transfer/balance/get` endpoint to view a balance held with Plaid. + +See endpoint docs at .*/ + pub fn transfer_balance_get(&self) -> FluentRequest<'_, TransferBalanceGetRequest> { + FluentRequest { + client: self, + params: TransferBalanceGetRequest { + originator_client_id: None, + type_: None, + }, + } + } +} diff --git a/src/request/transfer_cancel.rs b/src/request/transfer_cancel.rs index 08d51ffb..f8a23002 100644 --- a/src/request/transfer_cancel.rs +++ b/src/request/transfer_cancel.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_cancel`]. On request success, this will return a [`TransferCancelResponse`].*/ @@ -12,27 +9,46 @@ pub struct TransferCancelRequest { pub originator_client_id: Option, pub transfer_id: String, } -impl TransferCancelRequest {} impl FluentRequest<'_, TransferCancelRequest> { + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferCancelRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/cancel"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } - r = r.json(json!({ "transfer_id" : self.params.transfer_id })); + r = r.json(serde_json::json!({ "transfer_id" : self.params.transfer_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Cancel a transfer + +Use the `/transfer/cancel` endpoint to cancel a transfer. A transfer is eligible for cancellation if the `cancellable` property returned by `/transfer/get` is `true`. + +See endpoint docs at .*/ + pub fn transfer_cancel( + &self, + transfer_id: &str, + ) -> FluentRequest<'_, TransferCancelRequest> { + FluentRequest { + client: self, + params: TransferCancelRequest { + originator_client_id: None, + transfer_id: transfer_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_capabilities_get.rs b/src/request/transfer_capabilities_get.rs index 3f1d6390..0b822a05 100644 --- a/src/request/transfer_capabilities_get.rs +++ b/src/request/transfer_capabilities_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_capabilities_get`]. On request success, this will return a [`TransferCapabilitiesGetResponse`].*/ @@ -13,8 +10,8 @@ pub struct TransferCapabilitiesGetRequest { pub account_id: String, pub payment_profile_token: Option, } -impl TransferCapabilitiesGetRequest {} impl FluentRequest<'_, TransferCapabilitiesGetRequest> { + ///Set the value of the payment_profile_token field. pub fn payment_profile_token(mut self, payment_profile_token: &str) -> Self { self.params.payment_profile_token = Some(payment_profile_token.to_owned()); self @@ -22,20 +19,43 @@ impl FluentRequest<'_, TransferCapabilitiesGetRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferCapabilitiesGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferCapabilitiesGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/capabilities/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); if let Some(ref unwrapped) = self.params.payment_profile_token { - r = r.json(json!({ "payment_profile_token" : unwrapped })); + r = r.json(serde_json::json!({ "payment_profile_token" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get RTP eligibility information of a transfer + +Use the `/transfer/capabilities/get` endpoint to determine the RTP eligibility information of an account to be used with Transfer. This endpoint works on all Transfer-capable Items, including those created by `/transfer/migrate_account`. To simulate RTP eligibility in Sandbox, log in using the username `user_good` and password `pass_good` and use the first two checking and savings accounts in the "First Platypus Bank" institution (ending in 0000 or 1111), which will return `true`. Any other account will return `false`. + +See endpoint docs at .*/ + pub fn transfer_capabilities_get( + &self, + access_token: &str, + account_id: &str, + ) -> FluentRequest<'_, TransferCapabilitiesGetRequest> { + FluentRequest { + client: self, + params: TransferCapabilitiesGetRequest { + access_token: access_token.to_owned(), + account_id: account_id.to_owned(), + payment_profile_token: None, + }, + } + } +} diff --git a/src/request/transfer_configuration_get.rs b/src/request/transfer_configuration_get.rs index c734c32d..a8834f62 100644 --- a/src/request/transfer_configuration_get.rs +++ b/src/request/transfer_configuration_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_configuration_get`]. On request success, this will return a [`TransferConfigurationGetResponse`].*/ @@ -11,8 +8,8 @@ On request success, this will return a [`TransferConfigurationGetResponse`].*/ pub struct TransferConfigurationGetRequest { pub originator_client_id: Option, } -impl TransferConfigurationGetRequest {} impl FluentRequest<'_, TransferConfigurationGetRequest> { + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self @@ -20,18 +17,37 @@ impl FluentRequest<'_, TransferConfigurationGetRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferConfigurationGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferConfigurationGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/configuration/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get transfer product configuration + +Use the `/transfer/configuration/get` endpoint to view your transfer product configurations. + +See endpoint docs at .*/ + pub fn transfer_configuration_get( + &self, + ) -> FluentRequest<'_, TransferConfigurationGetRequest> { + FluentRequest { + client: self, + params: TransferConfigurationGetRequest { + originator_client_id: None, + }, + } + } +} diff --git a/src/request/transfer_create.rs b/src/request/transfer_create.rs index 261552c0..6c2de135 100644 --- a/src/request/transfer_create.rs +++ b/src/request/transfer_create.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + ACHClass, TransferMetadata, TransferNetwork, TransferType, + TransferUserInRequestDeprecated, +}; /**You should use this struct via [`PlaidClient::transfer_create`]. On request success, this will return a [`TransferCreateResponse`].*/ @@ -11,7 +12,7 @@ On request success, this will return a [`TransferCreateResponse`].*/ pub struct TransferCreateRequest { pub access_token: String, pub account_id: String, - pub ach_class: Option, + pub ach_class: Option, pub amount: Option, pub authorization_id: String, pub description: String, @@ -19,113 +20,159 @@ pub struct TransferCreateRequest { pub idempotency_key: Option, pub iso_currency_code: Option, pub metadata: Option, - pub network: Option, + pub network: Option, pub origination_account_id: Option, pub test_clock_id: Option, - pub type_: Option, + pub type_: Option, pub user: Option, } -impl TransferCreateRequest {} pub struct TransferCreateRequired<'a> { pub access_token: &'a str, pub account_id: &'a str, pub authorization_id: &'a str, pub description: &'a str, } -impl<'a> TransferCreateRequired<'a> {} impl FluentRequest<'_, TransferCreateRequest> { - pub fn ach_class(mut self, ach_class: &str) -> Self { - self.params.ach_class = Some(ach_class.to_owned()); + ///Set the value of the ach_class field. + pub fn ach_class(mut self, ach_class: AchClass) -> Self { + self.params.ach_class = Some(ach_class); self } + ///Set the value of the amount field. pub fn amount(mut self, amount: &str) -> Self { self.params.amount = Some(amount.to_owned()); self } + ///Set the value of the facilitator_fee field. pub fn facilitator_fee(mut self, facilitator_fee: &str) -> Self { self.params.facilitator_fee = Some(facilitator_fee.to_owned()); self } + ///Set the value of the idempotency_key field. pub fn idempotency_key(mut self, idempotency_key: &str) -> Self { self.params.idempotency_key = Some(idempotency_key.to_owned()); self } + ///Set the value of the iso_currency_code field. pub fn iso_currency_code(mut self, iso_currency_code: &str) -> Self { self.params.iso_currency_code = Some(iso_currency_code.to_owned()); self } + ///Set the value of the metadata field. pub fn metadata(mut self, metadata: TransferMetadata) -> Self { self.params.metadata = Some(metadata); self } - pub fn network(mut self, network: &str) -> Self { - self.params.network = Some(network.to_owned()); + ///Set the value of the network field. + pub fn network(mut self, network: TransferNetwork) -> Self { + self.params.network = Some(network); self } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } + ///Set the value of the test_clock_id field. pub fn test_clock_id(mut self, test_clock_id: &str) -> Self { self.params.test_clock_id = Some(test_clock_id.to_owned()); self } - pub fn type_(mut self, type_: &str) -> Self { - self.params.type_ = Some(type_.to_owned()); + ///Set the value of the type_ field. + pub fn type_(mut self, type_: TransferType) -> Self { + self.params.type_ = Some(type_); self } + ///Set the value of the user field. pub fn user(mut self, user: TransferUserInRequestDeprecated) -> Self { self.params.user = Some(user); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); if let Some(ref unwrapped) = self.params.ach_class { - r = r.json(json!({ "ach_class" : unwrapped })); + r = r.json(serde_json::json!({ "ach_class" : unwrapped })); } if let Some(ref unwrapped) = self.params.amount { - r = r.json(json!({ "amount" : unwrapped })); + r = r.json(serde_json::json!({ "amount" : unwrapped })); } - r = r.json(json!({ "authorization_id" : self.params.authorization_id })); - r = r.json(json!({ "description" : self.params.description })); + r = r + .json( + serde_json::json!( + { "authorization_id" : self.params.authorization_id } + ), + ); + r = r.json(serde_json::json!({ "description" : self.params.description })); if let Some(ref unwrapped) = self.params.facilitator_fee { - r = r.json(json!({ "facilitator_fee" : unwrapped })); + r = r.json(serde_json::json!({ "facilitator_fee" : unwrapped })); } if let Some(ref unwrapped) = self.params.idempotency_key { - r = r.json(json!({ "idempotency_key" : unwrapped })); + r = r.json(serde_json::json!({ "idempotency_key" : unwrapped })); } if let Some(ref unwrapped) = self.params.iso_currency_code { - r = r.json(json!({ "iso_currency_code" : unwrapped })); + r = r.json(serde_json::json!({ "iso_currency_code" : unwrapped })); } if let Some(ref unwrapped) = self.params.metadata { - r = r.json(json!({ "metadata" : unwrapped })); + r = r.json(serde_json::json!({ "metadata" : unwrapped })); } if let Some(ref unwrapped) = self.params.network { - r = r.json(json!({ "network" : unwrapped })); + r = r.json(serde_json::json!({ "network" : unwrapped })); } if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.test_clock_id { - r = r.json(json!({ "test_clock_id" : unwrapped })); + r = r.json(serde_json::json!({ "test_clock_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.type_ { - r = r.json(json!({ "type" : unwrapped })); + r = r.json(serde_json::json!({ "type" : unwrapped })); } if let Some(ref unwrapped) = self.params.user { - r = r.json(json!({ "user" : unwrapped })); + r = r.json(serde_json::json!({ "user" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a transfer + +Use the `/transfer/create` endpoint to initiate a new transfer. This endpoint is retryable and idempotent; if a transfer with the provided `transfer_id` has already been created, it will return the transfer details without creating a new transfer. A transfer may still be created if a 500 error is returned; to detect this scenario, use [Transfer events](https://plaid.com/docs/transfer/reconciling-transfers/). + +See endpoint docs at .*/ + pub fn transfer_create( + &self, + args: TransferCreateRequired, + ) -> FluentRequest<'_, TransferCreateRequest> { + FluentRequest { + client: self, + params: TransferCreateRequest { + access_token: args.access_token.to_owned(), + account_id: args.account_id.to_owned(), + ach_class: None, + amount: None, + authorization_id: args.authorization_id.to_owned(), + description: args.description.to_owned(), + facilitator_fee: None, + idempotency_key: None, + iso_currency_code: None, + metadata: None, + network: None, + origination_account_id: None, + test_clock_id: None, + type_: None, + user: None, + }, + } + } +} diff --git a/src/request/transfer_diligence_document_upload.rs b/src/request/transfer_diligence_document_upload.rs index 87d06f16..f9a5aeff 100644 --- a/src/request/transfer_diligence_document_upload.rs +++ b/src/request/transfer_diligence_document_upload.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransferDocumentPurpose; /**You should use this struct via [`PlaidClient::transfer_diligence_document_upload`]. On request success, this will return a [`TransferDiligenceDocumentUploadResponse`].*/ @@ -11,27 +9,53 @@ On request success, this will return a [`TransferDiligenceDocumentUploadResponse pub struct TransferDiligenceDocumentUploadRequest { pub file: String, pub originator_client_id: String, - pub purpose: String, + pub purpose: TransferDocumentPurpose, } -impl TransferDiligenceDocumentUploadRequest {} impl FluentRequest<'_, TransferDiligenceDocumentUploadRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferDiligenceDocumentUploadRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferDiligenceDocumentUploadResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/diligence/document/upload"; let mut r = self.client.client.post(url); - r = r.json(json!({ "file" : self.params.file })); + r = r.json(serde_json::json!({ "file" : self.params.file })); r = r .json( - json!({ "originator_client_id" : self.params.originator_client_id }), + serde_json::json!( + { "originator_client_id" : self.params.originator_client_id } + ), ); - r = r.json(json!({ "purpose" : self.params.purpose })); + r = r.json(serde_json::json!({ "purpose" : self.params.purpose })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Upload transfer diligence document on behalf of the originator + +Third-party sender customers can use `/transfer/diligence/document/upload` endpoint to upload a document on behalf of its end customer (i.e. originator) to Plaid. You’ll need to send a request of type multipart/form-data. +You must provide the `client_id` in the `PLAID-CLIENT-ID` header and `secret` in the `PLAID-SECRET` header. + +See endpoint docs at .*/ + pub fn transfer_diligence_document_upload( + &self, + file: &str, + originator_client_id: &str, + purpose: TransferDocumentPurpose, + ) -> FluentRequest<'_, TransferDiligenceDocumentUploadRequest> { + FluentRequest { + client: self, + params: TransferDiligenceDocumentUploadRequest { + file: file.to_owned(), + originator_client_id: originator_client_id.to_owned(), + purpose, + }, + } + } +} diff --git a/src/request/transfer_diligence_submit.rs b/src/request/transfer_diligence_submit.rs index 3b15ff6a..93eba131 100644 --- a/src/request/transfer_diligence_submit.rs +++ b/src/request/transfer_diligence_submit.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransferOriginatorDiligence; /**You should use this struct via [`PlaidClient::transfer_diligence_submit`]. On request success, this will return a [`TransferDiligenceSubmitResponse`].*/ @@ -12,11 +10,12 @@ pub struct TransferDiligenceSubmitRequest { pub originator_client_id: String, pub originator_diligence: TransferOriginatorDiligence, } -impl TransferDiligenceSubmitRequest {} impl FluentRequest<'_, TransferDiligenceSubmitRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferDiligenceSubmitRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferDiligenceSubmitResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -24,15 +23,39 @@ for FluentRequest<'a, TransferDiligenceSubmitRequest> { let mut r = self.client.client.post(url); r = r .json( - json!({ "originator_client_id" : self.params.originator_client_id }), + serde_json::json!( + { "originator_client_id" : self.params.originator_client_id } + ), ); r = r .json( - json!({ "originator_diligence" : self.params.originator_diligence }), + serde_json::json!( + { "originator_diligence" : self.params.originator_diligence } + ), ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Submit transfer diligence on behalf of the originator + +Use the `/transfer/diligence/submit` endpoint to submit transfer diligence on behalf of the originator (i.e., the end customer). + +See endpoint docs at .*/ + pub fn transfer_diligence_submit( + &self, + originator_client_id: &str, + originator_diligence: TransferOriginatorDiligence, + ) -> FluentRequest<'_, TransferDiligenceSubmitRequest> { + FluentRequest { + client: self, + params: TransferDiligenceSubmitRequest { + originator_client_id: originator_client_id.to_owned(), + originator_diligence, + }, + } + } +} diff --git a/src/request/transfer_event_list.rs b/src/request/transfer_event_list.rs index 55ab5f25..c8969c79 100644 --- a/src/request/transfer_event_list.rs +++ b/src/request/transfer_event_list.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{TransferEventType, TransferEventListTransferType}; /**You should use this struct via [`PlaidClient::transfer_event_list`]. On request success, this will return a [`TransferEventListResponse`].*/ @@ -12,7 +10,7 @@ pub struct TransferEventListRequest { pub account_id: Option, pub count: Option, pub end_date: Option>, - pub event_types: Option>, + pub event_types: Option>, pub funding_account_id: Option, pub offset: Option, pub origination_account_id: Option, @@ -22,59 +20,63 @@ pub struct TransferEventListRequest { pub transfer_id: Option, pub transfer_type: Option, } -impl TransferEventListRequest {} impl FluentRequest<'_, TransferEventListRequest> { + ///Set the value of the account_id field. pub fn account_id(mut self, account_id: &str) -> Self { self.params.account_id = Some(account_id.to_owned()); self } + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the end_date field. pub fn end_date(mut self, end_date: chrono::DateTime) -> Self { self.params.end_date = Some(end_date); self } - pub fn event_types( - mut self, - event_types: impl IntoIterator>, - ) -> Self { - self - .params - .event_types = Some( - event_types.into_iter().map(|s| s.as_ref().to_owned()).collect(), - ); + ///Set the value of the event_types field. + pub fn event_types(mut self, event_types: Vec) -> Self { + self.params.event_types = Some(event_types); self } + ///Set the value of the funding_account_id field. pub fn funding_account_id(mut self, funding_account_id: &str) -> Self { self.params.funding_account_id = Some(funding_account_id.to_owned()); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } + ///Set the value of the start_date field. pub fn start_date(mut self, start_date: chrono::DateTime) -> Self { self.params.start_date = Some(start_date); self } + ///Set the value of the sweep_id field. pub fn sweep_id(mut self, sweep_id: &str) -> Self { self.params.sweep_id = Some(sweep_id.to_owned()); self } + ///Set the value of the transfer_id field. pub fn transfer_id(mut self, transfer_id: &str) -> Self { self.params.transfer_id = Some(transfer_id.to_owned()); self } + ///Set the value of the transfer_type field. pub fn transfer_type( mut self, transfer_type: TransferEventListTransferType, @@ -84,51 +86,77 @@ impl FluentRequest<'_, TransferEventListRequest> { } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferEventListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/event/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.account_id { - r = r.json(json!({ "account_id" : unwrapped })); + r = r.json(serde_json::json!({ "account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.end_date { - r = r.json(json!({ "end_date" : unwrapped })); + r = r.json(serde_json::json!({ "end_date" : unwrapped })); } if let Some(ref unwrapped) = self.params.event_types { - r = r.json(json!({ "event_types" : unwrapped })); + r = r.json(serde_json::json!({ "event_types" : unwrapped })); } if let Some(ref unwrapped) = self.params.funding_account_id { - r = r.json(json!({ "funding_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "funding_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.start_date { - r = r.json(json!({ "start_date" : unwrapped })); + r = r.json(serde_json::json!({ "start_date" : unwrapped })); } if let Some(ref unwrapped) = self.params.sweep_id { - r = r.json(json!({ "sweep_id" : unwrapped })); + r = r.json(serde_json::json!({ "sweep_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.transfer_id { - r = r.json(json!({ "transfer_id" : unwrapped })); + r = r.json(serde_json::json!({ "transfer_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.transfer_type { - r = r.json(json!({ "transfer_type" : unwrapped })); + r = r.json(serde_json::json!({ "transfer_type" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List transfer events + +Use the `/transfer/event/list` endpoint to get a list of transfer events based on specified filter criteria. + +See endpoint docs at .*/ + pub fn transfer_event_list(&self) -> FluentRequest<'_, TransferEventListRequest> { + FluentRequest { + client: self, + params: TransferEventListRequest { + account_id: None, + count: None, + end_date: None, + event_types: None, + funding_account_id: None, + offset: None, + origination_account_id: None, + originator_client_id: None, + start_date: None, + sweep_id: None, + transfer_id: None, + transfer_type: None, + }, + } + } +} diff --git a/src/request/transfer_event_sync.rs b/src/request/transfer_event_sync.rs index b3adfd16..3b8f21c9 100644 --- a/src/request/transfer_event_sync.rs +++ b/src/request/transfer_event_sync.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_event_sync`]. On request success, this will return a [`TransferEventSyncResponse`].*/ @@ -12,27 +9,46 @@ pub struct TransferEventSyncRequest { pub after_id: i64, pub count: Option, } -impl TransferEventSyncRequest {} impl FluentRequest<'_, TransferEventSyncRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferEventSyncRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/event/sync"; let mut r = self.client.client.post(url); - r = r.json(json!({ "after_id" : self.params.after_id })); + r = r.json(serde_json::json!({ "after_id" : self.params.after_id })); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Sync transfer events + +`/transfer/event/sync` allows you to request up to the next 25 transfer events that happened after a specific `event_id`. Use the `/transfer/event/sync` endpoint to guarantee you have seen all transfer events. + +See endpoint docs at .*/ + pub fn transfer_event_sync( + &self, + after_id: i64, + ) -> FluentRequest<'_, TransferEventSyncRequest> { + FluentRequest { + client: self, + params: TransferEventSyncRequest { + after_id, + count: None, + }, + } + } +} diff --git a/src/request/transfer_get.rs b/src/request/transfer_get.rs index e59f8c73..6794fd73 100644 --- a/src/request/transfer_get.rs +++ b/src/request/transfer_get.rs @@ -1,38 +1,68 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_get`]. On request success, this will return a [`TransferGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferGetRequest { + pub authorization_id: Option, pub originator_client_id: Option, - pub transfer_id: String, + pub transfer_id: Option, } -impl TransferGetRequest {} impl FluentRequest<'_, TransferGetRequest> { + ///Set the value of the authorization_id field. + pub fn authorization_id(mut self, authorization_id: &str) -> Self { + self.params.authorization_id = Some(authorization_id.to_owned()); + self + } + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } + ///Set the value of the transfer_id field. + pub fn transfer_id(mut self, transfer_id: &str) -> Self { + self.params.transfer_id = Some(transfer_id.to_owned()); + self + } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/get"; let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.authorization_id { + r = r.json(serde_json::json!({ "authorization_id" : unwrapped })); + } if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.transfer_id { + r = r.json(serde_json::json!({ "transfer_id" : unwrapped })); } - r = r.json(json!({ "transfer_id" : self.params.transfer_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a transfer + +The `/transfer/get` endpoint fetches information about the transfer corresponding to the given `transfer_id` or `authorization_id`. One of `transfer_id` or `authorization_id` must be populated but not both. + +See endpoint docs at .*/ + pub fn transfer_get(&self) -> FluentRequest<'_, TransferGetRequest> { + FluentRequest { + client: self, + params: TransferGetRequest { + authorization_id: None, + originator_client_id: None, + transfer_id: None, + }, + } + } +} diff --git a/src/request/transfer_intent_create.rs b/src/request/transfer_intent_create.rs index 212b405e..f1680ec2 100644 --- a/src/request/transfer_intent_create.rs +++ b/src/request/transfer_intent_create.rs @@ -1,107 +1,143 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + ACHClass, TransferMetadata, TransferIntentCreateMode, TransferIntentCreateNetwork, + TransferUserInRequest, +}; /**You should use this struct via [`PlaidClient::transfer_intent_create`]. On request success, this will return a [`TransferIntentCreateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferIntentCreateRequest { pub account_id: Option, - pub ach_class: Option, + pub ach_class: Option, pub amount: String, pub description: String, pub funding_account_id: Option, pub iso_currency_code: Option, pub metadata: Option, - pub mode: String, - pub network: Option, + pub mode: TransferIntentCreateMode, + pub network: Option, pub origination_account_id: Option, pub require_guarantee: Option, pub user: TransferUserInRequest, } -impl TransferIntentCreateRequest {} pub struct TransferIntentCreateRequired<'a> { pub amount: &'a str, pub description: &'a str, - pub mode: &'a str, + pub mode: TransferIntentCreateMode, pub user: TransferUserInRequest, } -impl<'a> TransferIntentCreateRequired<'a> {} impl FluentRequest<'_, TransferIntentCreateRequest> { + ///Set the value of the account_id field. pub fn account_id(mut self, account_id: &str) -> Self { self.params.account_id = Some(account_id.to_owned()); self } - pub fn ach_class(mut self, ach_class: &str) -> Self { - self.params.ach_class = Some(ach_class.to_owned()); + ///Set the value of the ach_class field. + pub fn ach_class(mut self, ach_class: AchClass) -> Self { + self.params.ach_class = Some(ach_class); self } + ///Set the value of the funding_account_id field. pub fn funding_account_id(mut self, funding_account_id: &str) -> Self { self.params.funding_account_id = Some(funding_account_id.to_owned()); self } + ///Set the value of the iso_currency_code field. pub fn iso_currency_code(mut self, iso_currency_code: &str) -> Self { self.params.iso_currency_code = Some(iso_currency_code.to_owned()); self } + ///Set the value of the metadata field. pub fn metadata(mut self, metadata: TransferMetadata) -> Self { self.params.metadata = Some(metadata); self } - pub fn network(mut self, network: &str) -> Self { - self.params.network = Some(network.to_owned()); + ///Set the value of the network field. + pub fn network(mut self, network: TransferIntentCreateNetwork) -> Self { + self.params.network = Some(network); self } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } + ///Set the value of the require_guarantee field. pub fn require_guarantee(mut self, require_guarantee: bool) -> Self { self.params.require_guarantee = Some(require_guarantee); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferIntentCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/intent/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.account_id { - r = r.json(json!({ "account_id" : unwrapped })); + r = r.json(serde_json::json!({ "account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.ach_class { - r = r.json(json!({ "ach_class" : unwrapped })); + r = r.json(serde_json::json!({ "ach_class" : unwrapped })); } - r = r.json(json!({ "amount" : self.params.amount })); - r = r.json(json!({ "description" : self.params.description })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "description" : self.params.description })); if let Some(ref unwrapped) = self.params.funding_account_id { - r = r.json(json!({ "funding_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "funding_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.iso_currency_code { - r = r.json(json!({ "iso_currency_code" : unwrapped })); + r = r.json(serde_json::json!({ "iso_currency_code" : unwrapped })); } if let Some(ref unwrapped) = self.params.metadata { - r = r.json(json!({ "metadata" : unwrapped })); + r = r.json(serde_json::json!({ "metadata" : unwrapped })); } - r = r.json(json!({ "mode" : self.params.mode })); + r = r.json(serde_json::json!({ "mode" : self.params.mode })); if let Some(ref unwrapped) = self.params.network { - r = r.json(json!({ "network" : unwrapped })); + r = r.json(serde_json::json!({ "network" : unwrapped })); } if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.require_guarantee { - r = r.json(json!({ "require_guarantee" : unwrapped })); + r = r.json(serde_json::json!({ "require_guarantee" : unwrapped })); } - r = r.json(json!({ "user" : self.params.user })); + r = r.json(serde_json::json!({ "user" : self.params.user })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a transfer intent object to invoke the Transfer UI + +Use the `/transfer/intent/create` endpoint to generate a transfer intent object and invoke the Transfer UI. + +See endpoint docs at .*/ + pub fn transfer_intent_create( + &self, + args: TransferIntentCreateRequired, + ) -> FluentRequest<'_, TransferIntentCreateRequest> { + FluentRequest { + client: self, + params: TransferIntentCreateRequest { + account_id: None, + ach_class: None, + amount: args.amount.to_owned(), + description: args.description.to_owned(), + funding_account_id: None, + iso_currency_code: None, + metadata: None, + mode: args.mode, + network: None, + origination_account_id: None, + require_guarantee: None, + user: args.user, + }, + } + } +} diff --git a/src/request/transfer_intent_get.rs b/src/request/transfer_intent_get.rs index 670d92c5..03f1b594 100644 --- a/src/request/transfer_intent_get.rs +++ b/src/request/transfer_intent_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_intent_get`]. On request success, this will return a [`TransferIntentGetResponse`].*/ @@ -11,19 +8,41 @@ On request success, this will return a [`TransferIntentGetResponse`].*/ pub struct TransferIntentGetRequest { pub transfer_intent_id: String, } -impl TransferIntentGetRequest {} impl FluentRequest<'_, TransferIntentGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferIntentGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/intent/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "transfer_intent_id" : self.params.transfer_intent_id })); + r = r + .json( + serde_json::json!( + { "transfer_intent_id" : self.params.transfer_intent_id } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve more information about a transfer intent + +Use the `/transfer/intent/get` endpoint to retrieve more information about a transfer intent. + +See endpoint docs at .*/ + pub fn transfer_intent_get( + &self, + transfer_intent_id: &str, + ) -> FluentRequest<'_, TransferIntentGetRequest> { + FluentRequest { + client: self, + params: TransferIntentGetRequest { + transfer_intent_id: transfer_intent_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_ledger_deposit.rs b/src/request/transfer_ledger_deposit.rs index b49af420..0167ffea 100644 --- a/src/request/transfer_ledger_deposit.rs +++ b/src/request/transfer_ledger_deposit.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransferACHNetwork; /**You should use this struct via [`PlaidClient::transfer_ledger_deposit`]. On request success, this will return a [`TransferLedgerDepositResponse`].*/ @@ -13,46 +11,90 @@ pub struct TransferLedgerDepositRequest { pub description: Option, pub funding_account_id: Option, pub idempotency_key: String, - pub network: String, + pub ledger_id: Option, + pub network: TransferAchNetwork, pub originator_client_id: Option, } -impl TransferLedgerDepositRequest {} impl FluentRequest<'_, TransferLedgerDepositRequest> { + ///Set the value of the description field. pub fn description(mut self, description: &str) -> Self { self.params.description = Some(description.to_owned()); self } + ///Set the value of the funding_account_id field. pub fn funding_account_id(mut self, funding_account_id: &str) -> Self { self.params.funding_account_id = Some(funding_account_id.to_owned()); self } + ///Set the value of the ledger_id field. + pub fn ledger_id(mut self, ledger_id: &str) -> Self { + self.params.ledger_id = Some(ledger_id.to_owned()); + self + } + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferLedgerDepositRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferLedgerDepositResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/ledger/deposit"; let mut r = self.client.client.post(url); - r = r.json(json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); if let Some(ref unwrapped) = self.params.description { - r = r.json(json!({ "description" : unwrapped })); + r = r.json(serde_json::json!({ "description" : unwrapped })); } if let Some(ref unwrapped) = self.params.funding_account_id { - r = r.json(json!({ "funding_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "funding_account_id" : unwrapped })); } - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); - r = r.json(json!({ "network" : self.params.network })); + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); + if let Some(ref unwrapped) = self.params.ledger_id { + r = r.json(serde_json::json!({ "ledger_id" : unwrapped })); + } + r = r.json(serde_json::json!({ "network" : self.params.network })); if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Deposit funds into a Plaid Ledger balance + +Use the `/transfer/ledger/deposit` endpoint to deposit funds into Plaid Ledger. + +See endpoint docs at .*/ + pub fn transfer_ledger_deposit( + &self, + amount: &str, + idempotency_key: &str, + network: TransferAchNetwork, + ) -> FluentRequest<'_, TransferLedgerDepositRequest> { + FluentRequest { + client: self, + params: TransferLedgerDepositRequest { + amount: amount.to_owned(), + description: None, + funding_account_id: None, + idempotency_key: idempotency_key.to_owned(), + ledger_id: None, + network, + originator_client_id: None, + }, + } + } +} diff --git a/src/request/transfer_ledger_distribute.rs b/src/request/transfer_ledger_distribute.rs index 73a78f17..038f8ca8 100644 --- a/src/request/transfer_ledger_distribute.rs +++ b/src/request/transfer_ledger_distribute.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_ledger_distribute`]. On request success, this will return a [`TransferLedgerDistributeResponse`].*/ @@ -11,19 +8,18 @@ On request success, this will return a [`TransferLedgerDistributeResponse`].*/ pub struct TransferLedgerDistributeRequest { pub amount: String, pub description: Option, - pub from_client_id: String, + pub from_ledger_id: String, pub idempotency_key: String, - pub to_client_id: String, + pub to_ledger_id: String, } -impl TransferLedgerDistributeRequest {} pub struct TransferLedgerDistributeRequired<'a> { pub amount: &'a str, - pub from_client_id: &'a str, + pub from_ledger_id: &'a str, pub idempotency_key: &'a str, - pub to_client_id: &'a str, + pub to_ledger_id: &'a str, } -impl<'a> TransferLedgerDistributeRequired<'a> {} impl FluentRequest<'_, TransferLedgerDistributeRequest> { + ///Set the value of the description field. pub fn description(mut self, description: &str) -> Self { self.params.description = Some(description.to_owned()); self @@ -31,22 +27,54 @@ impl FluentRequest<'_, TransferLedgerDistributeRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferLedgerDistributeRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferLedgerDistributeResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/ledger/distribute"; let mut r = self.client.client.post(url); - r = r.json(json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); if let Some(ref unwrapped) = self.params.description { - r = r.json(json!({ "description" : unwrapped })); + r = r.json(serde_json::json!({ "description" : unwrapped })); } - r = r.json(json!({ "from_client_id" : self.params.from_client_id })); - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); - r = r.json(json!({ "to_client_id" : self.params.to_client_id })); + r = r + .json( + serde_json::json!({ "from_ledger_id" : self.params.from_ledger_id }), + ); + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); + r = r.json(serde_json::json!({ "to_ledger_id" : self.params.to_ledger_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Move available balance between the ledgers of the platform and one of its originators + +Use the `/transfer/ledger/distribute` endpoint to move available balance between the ledgers of the platform and one of its originators. + +See endpoint docs at .*/ + pub fn transfer_ledger_distribute( + &self, + args: TransferLedgerDistributeRequired, + ) -> FluentRequest<'_, TransferLedgerDistributeRequest> { + FluentRequest { + client: self, + params: TransferLedgerDistributeRequest { + amount: args.amount.to_owned(), + description: None, + from_ledger_id: args.from_ledger_id.to_owned(), + idempotency_key: args.idempotency_key.to_owned(), + to_ledger_id: args.to_ledger_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_ledger_get.rs b/src/request/transfer_ledger_get.rs index ad2fe8f3..af01ce5a 100644 --- a/src/request/transfer_ledger_get.rs +++ b/src/request/transfer_ledger_get.rs @@ -1,36 +1,58 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_ledger_get`]. On request success, this will return a [`TransferLedgerGetResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransferLedgerGetRequest { + pub ledger_id: Option, pub originator_client_id: Option, } -impl TransferLedgerGetRequest {} impl FluentRequest<'_, TransferLedgerGetRequest> { + ///Set the value of the ledger_id field. + pub fn ledger_id(mut self, ledger_id: &str) -> Self { + self.params.ledger_id = Some(ledger_id.to_owned()); + self + } + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferLedgerGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/ledger/get"; let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.ledger_id { + r = r.json(serde_json::json!({ "ledger_id" : unwrapped })); + } if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve Plaid Ledger balance + +Use the `/transfer/ledger/get` endpoint to view a balance on the ledger held with Plaid. + +See endpoint docs at .*/ + pub fn transfer_ledger_get(&self) -> FluentRequest<'_, TransferLedgerGetRequest> { + FluentRequest { + client: self, + params: TransferLedgerGetRequest { + ledger_id: None, + originator_client_id: None, + }, + } + } +} diff --git a/src/request/transfer_ledger_withdraw.rs b/src/request/transfer_ledger_withdraw.rs index c68510a0..9a15f3fd 100644 --- a/src/request/transfer_ledger_withdraw.rs +++ b/src/request/transfer_ledger_withdraw.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransferNetwork; /**You should use this struct via [`PlaidClient::transfer_ledger_withdraw`]. On request success, this will return a [`TransferLedgerWithdrawResponse`].*/ @@ -13,46 +11,90 @@ pub struct TransferLedgerWithdrawRequest { pub description: Option, pub funding_account_id: Option, pub idempotency_key: String, - pub network: String, + pub ledger_id: Option, + pub network: TransferNetwork, pub originator_client_id: Option, } -impl TransferLedgerWithdrawRequest {} impl FluentRequest<'_, TransferLedgerWithdrawRequest> { + ///Set the value of the description field. pub fn description(mut self, description: &str) -> Self { self.params.description = Some(description.to_owned()); self } + ///Set the value of the funding_account_id field. pub fn funding_account_id(mut self, funding_account_id: &str) -> Self { self.params.funding_account_id = Some(funding_account_id.to_owned()); self } + ///Set the value of the ledger_id field. + pub fn ledger_id(mut self, ledger_id: &str) -> Self { + self.params.ledger_id = Some(ledger_id.to_owned()); + self + } + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferLedgerWithdrawRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferLedgerWithdrawResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/ledger/withdraw"; let mut r = self.client.client.post(url); - r = r.json(json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); if let Some(ref unwrapped) = self.params.description { - r = r.json(json!({ "description" : unwrapped })); + r = r.json(serde_json::json!({ "description" : unwrapped })); } if let Some(ref unwrapped) = self.params.funding_account_id { - r = r.json(json!({ "funding_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "funding_account_id" : unwrapped })); } - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); - r = r.json(json!({ "network" : self.params.network })); + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); + if let Some(ref unwrapped) = self.params.ledger_id { + r = r.json(serde_json::json!({ "ledger_id" : unwrapped })); + } + r = r.json(serde_json::json!({ "network" : self.params.network })); if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Withdraw funds from a Plaid Ledger balance + +Use the `/transfer/ledger/withdraw` endpoint to withdraw funds from a Plaid Ledger balance. + +See endpoint docs at .*/ + pub fn transfer_ledger_withdraw( + &self, + amount: &str, + idempotency_key: &str, + network: TransferNetwork, + ) -> FluentRequest<'_, TransferLedgerWithdrawRequest> { + FluentRequest { + client: self, + params: TransferLedgerWithdrawRequest { + amount: amount.to_owned(), + description: None, + funding_account_id: None, + idempotency_key: idempotency_key.to_owned(), + ledger_id: None, + network, + originator_client_id: None, + }, + } + } +} diff --git a/src/request/transfer_list.rs b/src/request/transfer_list.rs index e46b466b..108f80fe 100644 --- a/src/request/transfer_list.rs +++ b/src/request/transfer_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_list`]. On request success, this will return a [`TransferListResponse`].*/ @@ -17,68 +14,96 @@ pub struct TransferListRequest { pub originator_client_id: Option, pub start_date: Option>, } -impl TransferListRequest {} impl FluentRequest<'_, TransferListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the end_date field. pub fn end_date(mut self, end_date: chrono::DateTime) -> Self { self.params.end_date = Some(end_date); self } + ///Set the value of the funding_account_id field. pub fn funding_account_id(mut self, funding_account_id: &str) -> Self { self.params.funding_account_id = Some(funding_account_id.to_owned()); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self } + ///Set the value of the origination_account_id field. pub fn origination_account_id(mut self, origination_account_id: &str) -> Self { self.params.origination_account_id = Some(origination_account_id.to_owned()); self } + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } + ///Set the value of the start_date field. pub fn start_date(mut self, start_date: chrono::DateTime) -> Self { self.params.start_date = Some(start_date); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.end_date { - r = r.json(json!({ "end_date" : unwrapped })); + r = r.json(serde_json::json!({ "end_date" : unwrapped })); } if let Some(ref unwrapped) = self.params.funding_account_id { - r = r.json(json!({ "funding_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "funding_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } if let Some(ref unwrapped) = self.params.origination_account_id { - r = r.json(json!({ "origination_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "origination_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.start_date { - r = r.json(json!({ "start_date" : unwrapped })); + r = r.json(serde_json::json!({ "start_date" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List transfers + +Use the `/transfer/list` endpoint to see a list of all your transfers and their statuses. Results are paginated; use the `count` and `offset` query parameters to retrieve the desired transfers. + + +See endpoint docs at .*/ + pub fn transfer_list(&self) -> FluentRequest<'_, TransferListRequest> { + FluentRequest { + client: self, + params: TransferListRequest { + count: None, + end_date: None, + funding_account_id: None, + offset: None, + origination_account_id: None, + originator_client_id: None, + start_date: None, + }, + } + } +} diff --git a/src/request/transfer_metrics_get.rs b/src/request/transfer_metrics_get.rs index 7de6d18f..f8498fc1 100644 --- a/src/request/transfer_metrics_get.rs +++ b/src/request/transfer_metrics_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_metrics_get`]. On request success, this will return a [`TransferMetricsGetResponse`].*/ @@ -11,26 +8,41 @@ On request success, this will return a [`TransferMetricsGetResponse`].*/ pub struct TransferMetricsGetRequest { pub originator_client_id: Option, } -impl TransferMetricsGetRequest {} impl FluentRequest<'_, TransferMetricsGetRequest> { + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferMetricsGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/metrics/get"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get transfer product usage metrics + +Use the `/transfer/metrics/get` endpoint to view your transfer product usage metrics. + +See endpoint docs at .*/ + pub fn transfer_metrics_get(&self) -> FluentRequest<'_, TransferMetricsGetRequest> { + FluentRequest { + client: self, + params: TransferMetricsGetRequest { + originator_client_id: None, + }, + } + } +} diff --git a/src/request/transfer_migrate_account.rs b/src/request/transfer_migrate_account.rs index e2e3ab3b..a928a875 100644 --- a/src/request/transfer_migrate_account.rs +++ b/src/request/transfer_migrate_account.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_migrate_account`]. On request success, this will return a [`TransferMigrateAccountResponse`].*/ @@ -14,29 +11,60 @@ pub struct TransferMigrateAccountRequest { pub routing_number: String, pub wire_routing_number: Option, } -impl TransferMigrateAccountRequest {} impl FluentRequest<'_, TransferMigrateAccountRequest> { + ///Set the value of the wire_routing_number field. pub fn wire_routing_number(mut self, wire_routing_number: &str) -> Self { self.params.wire_routing_number = Some(wire_routing_number.to_owned()); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferMigrateAccountRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferMigrateAccountResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/migrate_account"; let mut r = self.client.client.post(url); - r = r.json(json!({ "account_number" : self.params.account_number })); - r = r.json(json!({ "account_type" : self.params.account_type })); - r = r.json(json!({ "routing_number" : self.params.routing_number })); + r = r + .json( + serde_json::json!({ "account_number" : self.params.account_number }), + ); + r = r.json(serde_json::json!({ "account_type" : self.params.account_type })); + r = r + .json( + serde_json::json!({ "routing_number" : self.params.routing_number }), + ); if let Some(ref unwrapped) = self.params.wire_routing_number { - r = r.json(json!({ "wire_routing_number" : unwrapped })); + r = r.json(serde_json::json!({ "wire_routing_number" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Migrate account into Transfers + +As an alternative to adding Items via Link, you can also use the `/transfer/migrate_account` endpoint to migrate known account and routing numbers to Plaid Items. This endpoint is also required when adding an Item for use with wire transfers; if you intend to create wire transfers on this account, you must provide `wire_routing_number`. Note that Items created in this way are not compatible with endpoints for other products, such as `/accounts/balance/get`, and can only be used with Transfer endpoints. If you require access to other endpoints, create the Item through Link instead. Access to `/transfer/migrate_account` is not enabled by default; to obtain access, contact your Plaid Account Manager. + +See endpoint docs at .*/ + pub fn transfer_migrate_account( + &self, + account_number: &str, + account_type: &str, + routing_number: &str, + ) -> FluentRequest<'_, TransferMigrateAccountRequest> { + FluentRequest { + client: self, + params: TransferMigrateAccountRequest { + account_number: account_number.to_owned(), + account_type: account_type.to_owned(), + routing_number: routing_number.to_owned(), + wire_routing_number: None, + }, + } + } +} diff --git a/src/request/transfer_originator_create.rs b/src/request/transfer_originator_create.rs index 7d5802e4..60616a92 100644 --- a/src/request/transfer_originator_create.rs +++ b/src/request/transfer_originator_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_originator_create`]. On request success, this will return a [`TransferOriginatorCreateResponse`].*/ @@ -11,20 +8,39 @@ On request success, this will return a [`TransferOriginatorCreateResponse`].*/ pub struct TransferOriginatorCreateRequest { pub company_name: String, } -impl TransferOriginatorCreateRequest {} impl FluentRequest<'_, TransferOriginatorCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferOriginatorCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferOriginatorCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/originator/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "company_name" : self.params.company_name })); + r = r.json(serde_json::json!({ "company_name" : self.params.company_name })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a new originator + +Use the `/transfer/originator/create` endpoint to create a new originator and return an `originator_client_id`. + +See endpoint docs at .*/ + pub fn transfer_originator_create( + &self, + company_name: &str, + ) -> FluentRequest<'_, TransferOriginatorCreateRequest> { + FluentRequest { + client: self, + params: TransferOriginatorCreateRequest { + company_name: company_name.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_originator_funding_account_update.rs b/src/request/transfer_originator_funding_account_update.rs index bae441da..bd83c9e8 100644 --- a/src/request/transfer_originator_funding_account_update.rs +++ b/src/request/transfer_originator_funding_account_update.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::TransferFundingAccount; /**You should use this struct via [`PlaidClient::transfer_originator_funding_account_update`]. On request success, this will return a [`TransferOriginatorFundingAccountUpdateResponse`].*/ @@ -12,26 +10,52 @@ pub struct TransferOriginatorFundingAccountUpdateRequest { pub funding_account: TransferFundingAccount, pub originator_client_id: String, } -impl TransferOriginatorFundingAccountUpdateRequest {} impl FluentRequest<'_, TransferOriginatorFundingAccountUpdateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferOriginatorFundingAccountUpdateRequest> { type Output = httpclient::InMemoryResult< - TransferOriginatorFundingAccountUpdateResponse, + crate::model::TransferOriginatorFundingAccountUpdateResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/originator/funding_account/update"; let mut r = self.client.client.post(url); - r = r.json(json!({ "funding_account" : self.params.funding_account })); r = r .json( - json!({ "originator_client_id" : self.params.originator_client_id }), + serde_json::json!( + { "funding_account" : self.params.funding_account } + ), + ); + r = r + .json( + serde_json::json!( + { "originator_client_id" : self.params.originator_client_id } + ), ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update the funding account associated with the originator + +Use the `/transfer/originator/funding_account/update` endpoint to update the funding account associated with the originator. + +See endpoint docs at .*/ + pub fn transfer_originator_funding_account_update( + &self, + funding_account: TransferFundingAccount, + originator_client_id: &str, + ) -> FluentRequest<'_, TransferOriginatorFundingAccountUpdateRequest> { + FluentRequest { + client: self, + params: TransferOriginatorFundingAccountUpdateRequest { + funding_account, + originator_client_id: originator_client_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_originator_get.rs b/src/request/transfer_originator_get.rs index a01a6402..1a3d2e64 100644 --- a/src/request/transfer_originator_get.rs +++ b/src/request/transfer_originator_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_originator_get`]. On request success, this will return a [`TransferOriginatorGetResponse`].*/ @@ -11,10 +8,11 @@ On request success, this will return a [`TransferOriginatorGetResponse`].*/ pub struct TransferOriginatorGetRequest { pub originator_client_id: String, } -impl TransferOriginatorGetRequest {} impl FluentRequest<'_, TransferOriginatorGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferOriginatorGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferOriginatorGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -22,11 +20,31 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferOriginatorGetRe let mut r = self.client.client.post(url); r = r .json( - json!({ "originator_client_id" : self.params.originator_client_id }), + serde_json::json!( + { "originator_client_id" : self.params.originator_client_id } + ), ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get status of an originator's onboarding + +The `/transfer/originator/get` endpoint gets status updates for an originator's onboarding process. This information is also available via the Transfer page on the Plaid dashboard. + +See endpoint docs at .*/ + pub fn transfer_originator_get( + &self, + originator_client_id: &str, + ) -> FluentRequest<'_, TransferOriginatorGetRequest> { + FluentRequest { + client: self, + params: TransferOriginatorGetRequest { + originator_client_id: originator_client_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_originator_list.rs b/src/request/transfer_originator_list.rs index f659895f..c2f200e1 100644 --- a/src/request/transfer_originator_list.rs +++ b/src/request/transfer_originator_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_originator_list`]. On request success, this will return a [`TransferOriginatorListResponse`].*/ @@ -12,33 +9,54 @@ pub struct TransferOriginatorListRequest { pub count: Option, pub offset: Option, } -impl TransferOriginatorListRequest {} impl FluentRequest<'_, TransferOriginatorListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferOriginatorListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferOriginatorListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/originator/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get status of all originators' onboarding + +The `/transfer/originator/list` endpoint gets status updates for all of your originators' onboarding. This information is also available via the Plaid dashboard. + +See endpoint docs at .*/ + pub fn transfer_originator_list( + &self, + ) -> FluentRequest<'_, TransferOriginatorListRequest> { + FluentRequest { + client: self, + params: TransferOriginatorListRequest { + count: None, + offset: None, + }, + } + } +} diff --git a/src/request/transfer_platform_originator_create.rs b/src/request/transfer_platform_originator_create.rs new file mode 100644 index 00000000..51353247 --- /dev/null +++ b/src/request/transfer_platform_originator_create.rs @@ -0,0 +1,71 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::TransferPlatformTOSAcceptanceMetadata; +/**You should use this struct via [`PlaidClient::transfer_platform_originator_create`]. + +On request success, this will return a [`TransferPlatformOriginatorCreateResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TransferPlatformOriginatorCreateRequest { + pub originator_client_id: String, + pub originator_reviewed_at: chrono::DateTime, + pub tos_acceptance_metadata: TransferPlatformTosAcceptanceMetadata, +} +impl FluentRequest<'_, TransferPlatformOriginatorCreateRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, TransferPlatformOriginatorCreateRequest> { + type Output = httpclient::InMemoryResult< + crate::model::TransferPlatformOriginatorCreateResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/transfer/platform/originator/create"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!( + { "originator_client_id" : self.params.originator_client_id } + ), + ); + r = r + .json( + serde_json::json!( + { "originator_reviewed_at" : self.params.originator_reviewed_at } + ), + ); + r = r + .json( + serde_json::json!( + { "tos_acceptance_metadata" : self.params.tos_acceptance_metadata + } + ), + ); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Create an originator for scaled platform customers + +The `/transfer/platform/originator/create` endpoint allows gathering information about the originator specific to the Scaled Platform Transfer offering, including the originator's agreement to legal terms required before accepting any further information related to the originator. + +See endpoint docs at .*/ + pub fn transfer_platform_originator_create( + &self, + originator_client_id: &str, + originator_reviewed_at: chrono::DateTime, + tos_acceptance_metadata: TransferPlatformTosAcceptanceMetadata, + ) -> FluentRequest<'_, TransferPlatformOriginatorCreateRequest> { + FluentRequest { + client: self, + params: TransferPlatformOriginatorCreateRequest { + originator_client_id: originator_client_id.to_owned(), + originator_reviewed_at, + tos_acceptance_metadata, + }, + } + } +} diff --git a/src/request/transfer_platform_person_create.rs b/src/request/transfer_platform_person_create.rs new file mode 100644 index 00000000..121aabd1 --- /dev/null +++ b/src/request/transfer_platform_person_create.rs @@ -0,0 +1,134 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::{ + TransferPlatformPersonAddress, TransferPlatformPersonIDNumber, + TransferPlatformPersonName, +}; +/**You should use this struct via [`PlaidClient::transfer_platform_person_create`]. + +On request success, this will return a [`TransferPlatformPersonCreateResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TransferPlatformPersonCreateRequest { + pub address: Option, + pub date_of_birth: Option, + pub email_address: Option, + pub id_number: Option, + pub name: Option, + pub originator_client_id: String, + pub phone_number: Option, + pub relationship_to_originator: Option, +} +impl FluentRequest<'_, TransferPlatformPersonCreateRequest> { + ///Set the value of the address field. + pub fn address(mut self, address: TransferPlatformPersonAddress) -> Self { + self.params.address = Some(address); + self + } + ///Set the value of the date_of_birth field. + pub fn date_of_birth(mut self, date_of_birth: chrono::NaiveDate) -> Self { + self.params.date_of_birth = Some(date_of_birth); + self + } + ///Set the value of the email_address field. + pub fn email_address(mut self, email_address: &str) -> Self { + self.params.email_address = Some(email_address.to_owned()); + self + } + ///Set the value of the id_number field. + pub fn id_number(mut self, id_number: TransferPlatformPersonIdNumber) -> Self { + self.params.id_number = Some(id_number); + self + } + ///Set the value of the name field. + pub fn name(mut self, name: TransferPlatformPersonName) -> Self { + self.params.name = Some(name); + self + } + ///Set the value of the phone_number field. + pub fn phone_number(mut self, phone_number: &str) -> Self { + self.params.phone_number = Some(phone_number.to_owned()); + self + } + ///Set the value of the relationship_to_originator field. + pub fn relationship_to_originator( + mut self, + relationship_to_originator: &str, + ) -> Self { + self + .params + .relationship_to_originator = Some(relationship_to_originator.to_owned()); + self + } +} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, TransferPlatformPersonCreateRequest> { + type Output = httpclient::InMemoryResult< + crate::model::TransferPlatformPersonCreateResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/transfer/platform/person/create"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.address { + r = r.json(serde_json::json!({ "address" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.date_of_birth { + r = r.json(serde_json::json!({ "date_of_birth" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.email_address { + r = r.json(serde_json::json!({ "email_address" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.id_number { + r = r.json(serde_json::json!({ "id_number" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.name { + r = r.json(serde_json::json!({ "name" : unwrapped })); + } + r = r + .json( + serde_json::json!( + { "originator_client_id" : self.params.originator_client_id } + ), + ); + if let Some(ref unwrapped) = self.params.phone_number { + r = r.json(serde_json::json!({ "phone_number" : unwrapped })); + } + if let Some(ref unwrapped) = self.params.relationship_to_originator { + r = r + .json( + serde_json::json!({ "relationship_to_originator" : unwrapped }), + ); + } + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Create a person associated with an originator + +Use the `/transfer/platform/person/create` endpoint to create a person record associated with an originator and optionally submit person-specific requirements. + +See endpoint docs at .*/ + pub fn transfer_platform_person_create( + &self, + originator_client_id: &str, + ) -> FluentRequest<'_, TransferPlatformPersonCreateRequest> { + FluentRequest { + client: self, + params: TransferPlatformPersonCreateRequest { + address: None, + date_of_birth: None, + email_address: None, + id_number: None, + name: None, + originator_client_id: originator_client_id.to_owned(), + phone_number: None, + relationship_to_originator: None, + }, + } + } +} diff --git a/src/request/transfer_platform_requirement_submit.rs b/src/request/transfer_platform_requirement_submit.rs new file mode 100644 index 00000000..569812f7 --- /dev/null +++ b/src/request/transfer_platform_requirement_submit.rs @@ -0,0 +1,62 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +use crate::model::TransferPlatformRequirementSubmission; +/**You should use this struct via [`PlaidClient::transfer_platform_requirement_submit`]. + +On request success, this will return a [`TransferPlatformRequirementSubmitResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct TransferPlatformRequirementSubmitRequest { + pub originator_client_id: String, + pub requirement_submissions: Vec, +} +impl FluentRequest<'_, TransferPlatformRequirementSubmitRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, TransferPlatformRequirementSubmitRequest> { + type Output = httpclient::InMemoryResult< + crate::model::TransferPlatformRequirementSubmitResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/transfer/platform/requirement/submit"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!( + { "originator_client_id" : self.params.originator_client_id } + ), + ); + r = r + .json( + serde_json::json!( + { "requirement_submissions" : self.params.requirement_submissions + } + ), + ); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Submit onboarding requirements for Scaled Platform originators + +The `/transfer/platform/requirement/submit` endpoint allows platforms to submit onboarding requirements for an originator as part of the Scaled Platform Transfer offering. + +See endpoint docs at .*/ + pub fn transfer_platform_requirement_submit( + &self, + originator_client_id: &str, + requirement_submissions: Vec, + ) -> FluentRequest<'_, TransferPlatformRequirementSubmitRequest> { + FluentRequest { + client: self, + params: TransferPlatformRequirementSubmitRequest { + originator_client_id: originator_client_id.to_owned(), + requirement_submissions, + }, + } + } +} diff --git a/src/request/transfer_questionnaire_create.rs b/src/request/transfer_questionnaire_create.rs index c9cebc98..12199970 100644 --- a/src/request/transfer_questionnaire_create.rs +++ b/src/request/transfer_questionnaire_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_questionnaire_create`]. On request success, this will return a [`TransferQuestionnaireCreateResponse`].*/ @@ -12,11 +9,12 @@ pub struct TransferQuestionnaireCreateRequest { pub originator_client_id: String, pub redirect_uri: String, } -impl TransferQuestionnaireCreateRequest {} impl FluentRequest<'_, TransferQuestionnaireCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferQuestionnaireCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferQuestionnaireCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -24,12 +22,34 @@ for FluentRequest<'a, TransferQuestionnaireCreateRequest> { let mut r = self.client.client.post(url); r = r .json( - json!({ "originator_client_id" : self.params.originator_client_id }), + serde_json::json!( + { "originator_client_id" : self.params.originator_client_id } + ), ); - r = r.json(json!({ "redirect_uri" : self.params.redirect_uri })); + r = r.json(serde_json::json!({ "redirect_uri" : self.params.redirect_uri })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Generate a Plaid-hosted onboarding UI URL. + +The `/transfer/questionnaire/create` endpoint generates a Plaid-hosted onboarding UI URL. Redirect the originator to this URL to provide their due diligence information and agree to Plaid’s terms for ACH money movement. + +See endpoint docs at .*/ + pub fn transfer_questionnaire_create( + &self, + originator_client_id: &str, + redirect_uri: &str, + ) -> FluentRequest<'_, TransferQuestionnaireCreateRequest> { + FluentRequest { + client: self, + params: TransferQuestionnaireCreateRequest { + originator_client_id: originator_client_id.to_owned(), + redirect_uri: redirect_uri.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_recurring_cancel.rs b/src/request/transfer_recurring_cancel.rs index ec1f2dac..13f3fe34 100644 --- a/src/request/transfer_recurring_cancel.rs +++ b/src/request/transfer_recurring_cancel.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_recurring_cancel`]. On request success, this will return a [`TransferRecurringCancelResponse`].*/ @@ -11,11 +8,12 @@ On request success, this will return a [`TransferRecurringCancelResponse`].*/ pub struct TransferRecurringCancelRequest { pub recurring_transfer_id: String, } -impl TransferRecurringCancelRequest {} impl FluentRequest<'_, TransferRecurringCancelRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRecurringCancelRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferRecurringCancelResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,7 +21,7 @@ for FluentRequest<'a, TransferRecurringCancelRequest> { let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "recurring_transfer_id" : self.params.recurring_transfer_id } ), ); @@ -32,4 +30,22 @@ for FluentRequest<'a, TransferRecurringCancelRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Cancel a recurring transfer. + +Use the `/transfer/recurring/cancel` endpoint to cancel a recurring transfer. Scheduled transfer that hasn't been submitted to bank will be cancelled. + +See endpoint docs at .*/ + pub fn transfer_recurring_cancel( + &self, + recurring_transfer_id: &str, + ) -> FluentRequest<'_, TransferRecurringCancelRequest> { + FluentRequest { + client: self, + params: TransferRecurringCancelRequest { + recurring_transfer_id: recurring_transfer_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_recurring_create.rs b/src/request/transfer_recurring_create.rs index 1b51cc92..dae4e885 100644 --- a/src/request/transfer_recurring_create.rs +++ b/src/request/transfer_recurring_create.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + ACHClass, TransferDevice, TransferRecurringNetwork, TransferRecurringSchedule, + TransferType, TransferUserInRequest, +}; /**You should use this struct via [`PlaidClient::transfer_recurring_create`]. On request success, this will return a [`TransferRecurringCreateResponse`].*/ @@ -11,54 +12,58 @@ On request success, this will return a [`TransferRecurringCreateResponse`].*/ pub struct TransferRecurringCreateRequest { pub access_token: String, pub account_id: String, - pub ach_class: Option, + pub ach_class: Option, pub amount: String, pub description: String, pub device: Option, pub funding_account_id: Option, pub idempotency_key: String, pub iso_currency_code: Option, - pub network: String, + pub network: TransferRecurringNetwork, pub schedule: TransferRecurringSchedule, pub test_clock_id: Option, - pub type_: String, + pub type_: TransferType, pub user: TransferUserInRequest, pub user_present: Option, } -impl TransferRecurringCreateRequest {} pub struct TransferRecurringCreateRequired<'a> { pub access_token: &'a str, pub account_id: &'a str, pub amount: &'a str, pub description: &'a str, pub idempotency_key: &'a str, - pub network: &'a str, + pub network: TransferRecurringNetwork, pub schedule: TransferRecurringSchedule, - pub type_: &'a str, + pub type_: TransferType, pub user: TransferUserInRequest, } -impl<'a> TransferRecurringCreateRequired<'a> {} impl FluentRequest<'_, TransferRecurringCreateRequest> { - pub fn ach_class(mut self, ach_class: &str) -> Self { - self.params.ach_class = Some(ach_class.to_owned()); + ///Set the value of the ach_class field. + pub fn ach_class(mut self, ach_class: AchClass) -> Self { + self.params.ach_class = Some(ach_class); self } + ///Set the value of the device field. pub fn device(mut self, device: TransferDevice) -> Self { self.params.device = Some(device); self } + ///Set the value of the funding_account_id field. pub fn funding_account_id(mut self, funding_account_id: &str) -> Self { self.params.funding_account_id = Some(funding_account_id.to_owned()); self } + ///Set the value of the iso_currency_code field. pub fn iso_currency_code(mut self, iso_currency_code: &str) -> Self { self.params.iso_currency_code = Some(iso_currency_code.to_owned()); self } + ///Set the value of the test_clock_id field. pub fn test_clock_id(mut self, test_clock_id: &str) -> Self { self.params.test_clock_id = Some(test_clock_id.to_owned()); self } + ///Set the value of the user_present field. pub fn user_present(mut self, user_present: bool) -> Self { self.params.user_present = Some(user_present); self @@ -66,42 +71,81 @@ impl FluentRequest<'_, TransferRecurringCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRecurringCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferRecurringCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/recurring/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "access_token" : self.params.access_token })); - r = r.json(json!({ "account_id" : self.params.account_id })); + r = r.json(serde_json::json!({ "access_token" : self.params.access_token })); + r = r.json(serde_json::json!({ "account_id" : self.params.account_id })); if let Some(ref unwrapped) = self.params.ach_class { - r = r.json(json!({ "ach_class" : unwrapped })); + r = r.json(serde_json::json!({ "ach_class" : unwrapped })); } - r = r.json(json!({ "amount" : self.params.amount })); - r = r.json(json!({ "description" : self.params.description })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "description" : self.params.description })); if let Some(ref unwrapped) = self.params.device { - r = r.json(json!({ "device" : unwrapped })); + r = r.json(serde_json::json!({ "device" : unwrapped })); } if let Some(ref unwrapped) = self.params.funding_account_id { - r = r.json(json!({ "funding_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "funding_account_id" : unwrapped })); } - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); if let Some(ref unwrapped) = self.params.iso_currency_code { - r = r.json(json!({ "iso_currency_code" : unwrapped })); + r = r.json(serde_json::json!({ "iso_currency_code" : unwrapped })); } - r = r.json(json!({ "network" : self.params.network })); - r = r.json(json!({ "schedule" : self.params.schedule })); + r = r.json(serde_json::json!({ "network" : self.params.network })); + r = r.json(serde_json::json!({ "schedule" : self.params.schedule })); if let Some(ref unwrapped) = self.params.test_clock_id { - r = r.json(json!({ "test_clock_id" : unwrapped })); + r = r.json(serde_json::json!({ "test_clock_id" : unwrapped })); } - r = r.json(json!({ "type" : self.params.type_ })); - r = r.json(json!({ "user" : self.params.user })); + r = r.json(serde_json::json!({ "type" : self.params.type_ })); + r = r.json(serde_json::json!({ "user" : self.params.user })); if let Some(ref unwrapped) = self.params.user_present { - r = r.json(json!({ "user_present" : unwrapped })); + r = r.json(serde_json::json!({ "user_present" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a recurring transfer + +Use the `/transfer/recurring/create` endpoint to initiate a new recurring transfer. This capability is not currently supported for Transfer UI or Platform Payments (beta) customers. + +See endpoint docs at .*/ + pub fn transfer_recurring_create( + &self, + args: TransferRecurringCreateRequired, + ) -> FluentRequest<'_, TransferRecurringCreateRequest> { + FluentRequest { + client: self, + params: TransferRecurringCreateRequest { + access_token: args.access_token.to_owned(), + account_id: args.account_id.to_owned(), + ach_class: None, + amount: args.amount.to_owned(), + description: args.description.to_owned(), + device: None, + funding_account_id: None, + idempotency_key: args.idempotency_key.to_owned(), + iso_currency_code: None, + network: args.network, + schedule: args.schedule, + test_clock_id: None, + type_: args.type_, + user: args.user, + user_present: None, + }, + } + } +} diff --git a/src/request/transfer_recurring_get.rs b/src/request/transfer_recurring_get.rs index a002d569..0c4876e9 100644 --- a/src/request/transfer_recurring_get.rs +++ b/src/request/transfer_recurring_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_recurring_get`]. On request success, this will return a [`TransferRecurringGetResponse`].*/ @@ -11,10 +8,9 @@ On request success, this will return a [`TransferRecurringGetResponse`].*/ pub struct TransferRecurringGetRequest { pub recurring_transfer_id: String, } -impl TransferRecurringGetRequest {} impl FluentRequest<'_, TransferRecurringGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRecurringGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -22,7 +18,7 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRecurringGetReq let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "recurring_transfer_id" : self.params.recurring_transfer_id } ), ); @@ -31,4 +27,22 @@ impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRecurringGetReq res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a recurring transfer + +The `/transfer/recurring/get` fetches information about the recurring transfer corresponding to the given `recurring_transfer_id`. + +See endpoint docs at .*/ + pub fn transfer_recurring_get( + &self, + recurring_transfer_id: &str, + ) -> FluentRequest<'_, TransferRecurringGetRequest> { + FluentRequest { + client: self, + params: TransferRecurringGetRequest { + recurring_transfer_id: recurring_transfer_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_recurring_list.rs b/src/request/transfer_recurring_list.rs index 15cc9430..ac0d4006 100644 --- a/src/request/transfer_recurring_list.rs +++ b/src/request/transfer_recurring_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_recurring_list`]. On request success, this will return a [`TransferRecurringListResponse`].*/ @@ -15,54 +12,82 @@ pub struct TransferRecurringListRequest { pub offset: Option, pub start_time: Option>, } -impl TransferRecurringListRequest {} impl FluentRequest<'_, TransferRecurringListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the end_time field. pub fn end_time(mut self, end_time: chrono::DateTime) -> Self { self.params.end_time = Some(end_time); self } + ///Set the value of the funding_account_id field. pub fn funding_account_id(mut self, funding_account_id: &str) -> Self { self.params.funding_account_id = Some(funding_account_id.to_owned()); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self } + ///Set the value of the start_time field. pub fn start_time(mut self, start_time: chrono::DateTime) -> Self { self.params.start_time = Some(start_time); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRecurringListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferRecurringListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/recurring/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.end_time { - r = r.json(json!({ "end_time" : unwrapped })); + r = r.json(serde_json::json!({ "end_time" : unwrapped })); } if let Some(ref unwrapped) = self.params.funding_account_id { - r = r.json(json!({ "funding_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "funding_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } if let Some(ref unwrapped) = self.params.start_time { - r = r.json(json!({ "start_time" : unwrapped })); + r = r.json(serde_json::json!({ "start_time" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List recurring transfers + +Use the `/transfer/recurring/list` endpoint to see a list of all your recurring transfers and their statuses. Results are paginated; use the `count` and `offset` query parameters to retrieve the desired recurring transfers. + + +See endpoint docs at .*/ + pub fn transfer_recurring_list( + &self, + ) -> FluentRequest<'_, TransferRecurringListRequest> { + FluentRequest { + client: self, + params: TransferRecurringListRequest { + count: None, + end_time: None, + funding_account_id: None, + offset: None, + start_time: None, + }, + } + } +} diff --git a/src/request/transfer_refund_cancel.rs b/src/request/transfer_refund_cancel.rs index ffb34e44..f17c678d 100644 --- a/src/request/transfer_refund_cancel.rs +++ b/src/request/transfer_refund_cancel.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_refund_cancel`]. On request success, this will return a [`TransferRefundCancelResponse`].*/ @@ -11,19 +8,36 @@ On request success, this will return a [`TransferRefundCancelResponse`].*/ pub struct TransferRefundCancelRequest { pub refund_id: String, } -impl TransferRefundCancelRequest {} impl FluentRequest<'_, TransferRefundCancelRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRefundCancelRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/refund/cancel"; let mut r = self.client.client.post(url); - r = r.json(json!({ "refund_id" : self.params.refund_id })); + r = r.json(serde_json::json!({ "refund_id" : self.params.refund_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Cancel a refund + +Use the `/transfer/refund/cancel` endpoint to cancel a refund. A refund is eligible for cancellation if it has not yet been submitted to the payment network. + +See endpoint docs at .*/ + pub fn transfer_refund_cancel( + &self, + refund_id: &str, + ) -> FluentRequest<'_, TransferRefundCancelRequest> { + FluentRequest { + client: self, + params: TransferRefundCancelRequest { + refund_id: refund_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_refund_create.rs b/src/request/transfer_refund_create.rs index 16c5d6ec..2fd8934c 100644 --- a/src/request/transfer_refund_create.rs +++ b/src/request/transfer_refund_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_refund_create`]. On request success, this will return a [`TransferRefundCreateResponse`].*/ @@ -13,21 +10,49 @@ pub struct TransferRefundCreateRequest { pub idempotency_key: String, pub transfer_id: String, } -impl TransferRefundCreateRequest {} impl FluentRequest<'_, TransferRefundCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRefundCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/refund/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "amount" : self.params.amount })); - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); - r = r.json(json!({ "transfer_id" : self.params.transfer_id })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); + r = r.json(serde_json::json!({ "transfer_id" : self.params.transfer_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a refund + +Use the `/transfer/refund/create` endpoint to create a refund for a transfer. A transfer can be refunded if the transfer was initiated in the past 180 days. + +Processing of the refund will not occur until at least 4 business days following the transfer's settlement date, plus any hold/settlement delays. This 3-day window helps better protect your business from regular ACH returns. Consumer initiated returns (unauthorized returns) could still happen for about 60 days from the settlement date. If the original transfer is canceled, returned or failed, all pending refunds will automatically be canceled. Processed refunds cannot be revoked. + +See endpoint docs at .*/ + pub fn transfer_refund_create( + &self, + amount: &str, + idempotency_key: &str, + transfer_id: &str, + ) -> FluentRequest<'_, TransferRefundCreateRequest> { + FluentRequest { + client: self, + params: TransferRefundCreateRequest { + amount: amount.to_owned(), + idempotency_key: idempotency_key.to_owned(), + transfer_id: transfer_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_refund_get.rs b/src/request/transfer_refund_get.rs index fd454f47..f67a583a 100644 --- a/src/request/transfer_refund_get.rs +++ b/src/request/transfer_refund_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_refund_get`]. On request success, this will return a [`TransferRefundGetResponse`].*/ @@ -11,19 +8,36 @@ On request success, this will return a [`TransferRefundGetResponse`].*/ pub struct TransferRefundGetRequest { pub refund_id: String, } -impl TransferRefundGetRequest {} impl FluentRequest<'_, TransferRefundGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRefundGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/refund/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "refund_id" : self.params.refund_id })); + r = r.json(serde_json::json!({ "refund_id" : self.params.refund_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a refund + +The `/transfer/refund/get` endpoint fetches information about the refund corresponding to the given `refund_id`. + +See endpoint docs at .*/ + pub fn transfer_refund_get( + &self, + refund_id: &str, + ) -> FluentRequest<'_, TransferRefundGetRequest> { + FluentRequest { + client: self, + params: TransferRefundGetRequest { + refund_id: refund_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_repayment_list.rs b/src/request/transfer_repayment_list.rs index 6d903c24..8fe41727 100644 --- a/src/request/transfer_repayment_list.rs +++ b/src/request/transfer_repayment_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_repayment_list`]. On request success, this will return a [`TransferRepaymentListResponse`].*/ @@ -14,47 +11,72 @@ pub struct TransferRepaymentListRequest { pub offset: Option, pub start_date: Option>, } -impl TransferRepaymentListRequest {} impl FluentRequest<'_, TransferRepaymentListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the end_date field. pub fn end_date(mut self, end_date: chrono::DateTime) -> Self { self.params.end_date = Some(end_date); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self } + ///Set the value of the start_date field. pub fn start_date(mut self, start_date: chrono::DateTime) -> Self { self.params.start_date = Some(start_date); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRepaymentListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferRepaymentListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/repayment/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.end_date { - r = r.json(json!({ "end_date" : unwrapped })); + r = r.json(serde_json::json!({ "end_date" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } if let Some(ref unwrapped) = self.params.start_date { - r = r.json(json!({ "start_date" : unwrapped })); + r = r.json(serde_json::json!({ "start_date" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Lists historical repayments + +The `/transfer/repayment/list` endpoint fetches repayments matching the given filters. Repayments are returned in reverse-chronological order (most recent first) starting at the given `start_time`. + +See endpoint docs at .*/ + pub fn transfer_repayment_list( + &self, + ) -> FluentRequest<'_, TransferRepaymentListRequest> { + FluentRequest { + client: self, + params: TransferRepaymentListRequest { + count: None, + end_date: None, + offset: None, + start_date: None, + }, + } + } +} diff --git a/src/request/transfer_repayment_return_list.rs b/src/request/transfer_repayment_return_list.rs index 88718a1f..9e5fd12f 100644 --- a/src/request/transfer_repayment_return_list.rs +++ b/src/request/transfer_repayment_return_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_repayment_return_list`]. On request success, this will return a [`TransferRepaymentReturnListResponse`].*/ @@ -13,12 +10,13 @@ pub struct TransferRepaymentReturnListRequest { pub offset: Option, pub repayment_id: String, } -impl TransferRepaymentReturnListRequest {} impl FluentRequest<'_, TransferRepaymentReturnListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self @@ -26,22 +24,44 @@ impl FluentRequest<'_, TransferRepaymentReturnListRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferRepaymentReturnListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::TransferRepaymentReturnListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/repayment/return/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } - r = r.json(json!({ "repayment_id" : self.params.repayment_id })); + r = r.json(serde_json::json!({ "repayment_id" : self.params.repayment_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List the returns included in a repayment + +The `/transfer/repayment/return/list` endpoint retrieves the set of returns that were batched together into the specified repayment. The sum of amounts of returns retrieved by this request equals the amount of the repayment. + +See endpoint docs at .*/ + pub fn transfer_repayment_return_list( + &self, + repayment_id: &str, + ) -> FluentRequest<'_, TransferRepaymentReturnListRequest> { + FluentRequest { + client: self, + params: TransferRepaymentReturnListRequest { + count: None, + offset: None, + repayment_id: repayment_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_sweep_get.rs b/src/request/transfer_sweep_get.rs index b3b3209e..3b158ede 100644 --- a/src/request/transfer_sweep_get.rs +++ b/src/request/transfer_sweep_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::transfer_sweep_get`]. On request success, this will return a [`TransferSweepGetResponse`].*/ @@ -11,19 +8,36 @@ On request success, this will return a [`TransferSweepGetResponse`].*/ pub struct TransferSweepGetRequest { pub sweep_id: String, } -impl TransferSweepGetRequest {} impl FluentRequest<'_, TransferSweepGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferSweepGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/sweep/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "sweep_id" : self.params.sweep_id })); + r = r.json(serde_json::json!({ "sweep_id" : self.params.sweep_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve a sweep + +The `/transfer/sweep/get` endpoint fetches a sweep corresponding to the given `sweep_id`. + +See endpoint docs at .*/ + pub fn transfer_sweep_get( + &self, + sweep_id: &str, + ) -> FluentRequest<'_, TransferSweepGetRequest> { + FluentRequest { + client: self, + params: TransferSweepGetRequest { + sweep_id: sweep_id.to_owned(), + }, + } + } +} diff --git a/src/request/transfer_sweep_list.rs b/src/request/transfer_sweep_list.rs index bed7d0b5..652339a6 100644 --- a/src/request/transfer_sweep_list.rs +++ b/src/request/transfer_sweep_list.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{SweepStatus, SweepTrigger}; /**You should use this struct via [`PlaidClient::transfer_sweep_list`]. On request success, this will return a [`TransferSweepListResponse`].*/ @@ -18,91 +16,124 @@ pub struct TransferSweepListRequest { pub start_date: Option>, pub status: Option, pub transfer_id: Option, - pub trigger: Option, + pub trigger: Option, } -impl TransferSweepListRequest {} impl FluentRequest<'_, TransferSweepListRequest> { + ///Set the value of the amount field. pub fn amount(mut self, amount: &str) -> Self { self.params.amount = Some(amount.to_owned()); self } + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the end_date field. pub fn end_date(mut self, end_date: chrono::DateTime) -> Self { self.params.end_date = Some(end_date); self } + ///Set the value of the funding_account_id field. pub fn funding_account_id(mut self, funding_account_id: &str) -> Self { self.params.funding_account_id = Some(funding_account_id.to_owned()); self } + ///Set the value of the offset field. pub fn offset(mut self, offset: i64) -> Self { self.params.offset = Some(offset); self } + ///Set the value of the originator_client_id field. pub fn originator_client_id(mut self, originator_client_id: &str) -> Self { self.params.originator_client_id = Some(originator_client_id.to_owned()); self } + ///Set the value of the start_date field. pub fn start_date(mut self, start_date: chrono::DateTime) -> Self { self.params.start_date = Some(start_date); self } + ///Set the value of the status field. pub fn status(mut self, status: SweepStatus) -> Self { self.params.status = Some(status); self } + ///Set the value of the transfer_id field. pub fn transfer_id(mut self, transfer_id: &str) -> Self { self.params.transfer_id = Some(transfer_id.to_owned()); self } - pub fn trigger(mut self, trigger: &str) -> Self { - self.params.trigger = Some(trigger.to_owned()); + ///Set the value of the trigger field. + pub fn trigger(mut self, trigger: SweepTrigger) -> Self { + self.params.trigger = Some(trigger); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, TransferSweepListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/transfer/sweep/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.amount { - r = r.json(json!({ "amount" : unwrapped })); + r = r.json(serde_json::json!({ "amount" : unwrapped })); } if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.end_date { - r = r.json(json!({ "end_date" : unwrapped })); + r = r.json(serde_json::json!({ "end_date" : unwrapped })); } if let Some(ref unwrapped) = self.params.funding_account_id { - r = r.json(json!({ "funding_account_id" : unwrapped })); + r = r.json(serde_json::json!({ "funding_account_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.offset { - r = r.json(json!({ "offset" : unwrapped })); + r = r.json(serde_json::json!({ "offset" : unwrapped })); } if let Some(ref unwrapped) = self.params.originator_client_id { - r = r.json(json!({ "originator_client_id" : unwrapped })); + r = r.json(serde_json::json!({ "originator_client_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.start_date { - r = r.json(json!({ "start_date" : unwrapped })); + r = r.json(serde_json::json!({ "start_date" : unwrapped })); } if let Some(ref unwrapped) = self.params.status { - r = r.json(json!({ "status" : unwrapped })); + r = r.json(serde_json::json!({ "status" : unwrapped })); } if let Some(ref unwrapped) = self.params.transfer_id { - r = r.json(json!({ "transfer_id" : unwrapped })); + r = r.json(serde_json::json!({ "transfer_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.trigger { - r = r.json(json!({ "trigger" : unwrapped })); + r = r.json(serde_json::json!({ "trigger" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List sweeps + +The `/transfer/sweep/list` endpoint fetches sweeps matching the given filters. + +See endpoint docs at .*/ + pub fn transfer_sweep_list(&self) -> FluentRequest<'_, TransferSweepListRequest> { + FluentRequest { + client: self, + params: TransferSweepListRequest { + amount: None, + count: None, + end_date: None, + funding_account_id: None, + offset: None, + originator_client_id: None, + start_date: None, + status: None, + transfer_id: None, + trigger: None, + }, + } + } +} diff --git a/src/request/user_account_session_get.rs b/src/request/user_account_session_get.rs new file mode 100644 index 00000000..9b8e5deb --- /dev/null +++ b/src/request/user_account_session_get.rs @@ -0,0 +1,45 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::user_account_session_get`]. + +On request success, this will return a [`UserAccountSessionGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct UserAccountSessionGetRequest { + pub public_token: String, +} +impl FluentRequest<'_, UserAccountSessionGetRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, UserAccountSessionGetRequest> { + type Output = httpclient::InMemoryResult< + crate::model::UserAccountSessionGetResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/user_account/session/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "public_token" : self.params.public_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Retrieve User Account + +Returns user permissioned account data including identity and Item access tokens. + +See endpoint docs at .*/ + pub fn user_account_session_get( + &self, + public_token: &str, + ) -> FluentRequest<'_, UserAccountSessionGetRequest> { + FluentRequest { + client: self, + params: UserAccountSessionGetRequest { + public_token: public_token.to_owned(), + }, + } + } +} diff --git a/src/request/user_create.rs b/src/request/user_create.rs index 92fb5a7c..9b62f6ba 100644 --- a/src/request/user_create.rs +++ b/src/request/user_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::ConsumerReportUserIdentity; /**You should use this struct via [`PlaidClient::user_create`]. On request success, this will return a [`UserCreateResponse`].*/ @@ -11,9 +9,10 @@ On request success, this will return a [`UserCreateResponse`].*/ pub struct UserCreateRequest { pub client_user_id: String, pub consumer_report_user_identity: Option, + pub end_customer: Option, } -impl UserCreateRequest {} impl FluentRequest<'_, UserCreateRequest> { + ///Set the value of the consumer_report_user_identity field. pub fn consumer_report_user_identity( mut self, consumer_report_user_identity: ConsumerReportUserIdentity, @@ -21,21 +20,63 @@ impl FluentRequest<'_, UserCreateRequest> { self.params.consumer_report_user_identity = Some(consumer_report_user_identity); self } + ///Set the value of the end_customer field. + pub fn end_customer(mut self, end_customer: &str) -> Self { + self.params.end_customer = Some(end_customer.to_owned()); + self + } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, UserCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/user/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "client_user_id" : self.params.client_user_id })); + r = r + .json( + serde_json::json!({ "client_user_id" : self.params.client_user_id }), + ); if let Some(ref unwrapped) = self.params.consumer_report_user_identity { - r = r.json(json!({ "consumer_report_user_identity" : unwrapped })); + r = r + .json( + serde_json::json!( + { "consumer_report_user_identity" : unwrapped } + ), + ); + } + if let Some(ref unwrapped) = self.params.end_customer { + r = r.json(serde_json::json!({ "end_customer" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create user + +This endpoint should be called for each of your end users before they begin a Plaid Check or Income flow, or a Multi-Item Link flow. This provides you a single token to access all data associated with the user. You should only create one per end user. + +The `consumer_report_user_identity` object must be present in order to create a Plaid Check Consumer Report for a user. If it is not provided during the `/user/create` call, it can be added later by calling `/user/update`. + +If you call the endpoint multiple times with the same `client_user_id`, the first creation call will succeed and the rest will fail with an error message indicating that the user has been created for the given `client_user_id`. + +Ensure that you store the `user_token` along with your user's identifier in your database, as it is not possible to retrieve a previously created `user_token`. + +See endpoint docs at .*/ + pub fn user_create( + &self, + client_user_id: &str, + ) -> FluentRequest<'_, UserCreateRequest> { + FluentRequest { + client: self, + params: UserCreateRequest { + client_user_id: client_user_id.to_owned(), + consumer_report_user_identity: None, + end_customer: None, + }, + } + } +} diff --git a/src/request/user_items_get.rs b/src/request/user_items_get.rs new file mode 100644 index 00000000..d73a554f --- /dev/null +++ b/src/request/user_items_get.rs @@ -0,0 +1,43 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::user_items_get`]. + +On request success, this will return a [`UserItemsGetResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct UserItemsGetRequest { + pub user_token: String, +} +impl FluentRequest<'_, UserItemsGetRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, UserItemsGetRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/user/items/get"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Get Items associated with a User + +Returns Items associated with a User along with their corresponding statuses. + +See endpoint docs at .*/ + pub fn user_items_get( + &self, + user_token: &str, + ) -> FluentRequest<'_, UserItemsGetRequest> { + FluentRequest { + client: self, + params: UserItemsGetRequest { + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/user_remove.rs b/src/request/user_remove.rs new file mode 100644 index 00000000..e58b43c7 --- /dev/null +++ b/src/request/user_remove.rs @@ -0,0 +1,41 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::user_remove`]. + +On request success, this will return a [`UserRemoveResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct UserRemoveRequest { + pub user_token: String, +} +impl FluentRequest<'_, UserRemoveRequest> {} +impl<'a> ::std::future::IntoFuture for FluentRequest<'a, UserRemoveRequest> { + type Output = httpclient::InMemoryResult; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/user/remove"; + let mut r = self.client.client.post(url); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Remove user + +`/user/remove` deletes a user token and and associated information, including any Items associated with the token. +Any subsequent calls to retrieve information using the same user token will result in an error stating the user does not exist. + +See endpoint docs at .*/ + pub fn user_remove(&self, user_token: &str) -> FluentRequest<'_, UserRemoveRequest> { + FluentRequest { + client: self, + params: UserRemoveRequest { + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/user_third_party_token_create.rs b/src/request/user_third_party_token_create.rs new file mode 100644 index 00000000..72c5b998 --- /dev/null +++ b/src/request/user_third_party_token_create.rs @@ -0,0 +1,71 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::user_third_party_token_create`]. + +On request success, this will return a [`UserThirdPartyTokenCreateResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct UserThirdPartyTokenCreateRequest { + pub expiration_time: Option>, + pub third_party_client_id: String, + pub user_token: String, +} +impl FluentRequest<'_, UserThirdPartyTokenCreateRequest> { + ///Set the value of the expiration_time field. + pub fn expiration_time( + mut self, + expiration_time: chrono::DateTime, + ) -> Self { + self.params.expiration_time = Some(expiration_time); + self + } +} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, UserThirdPartyTokenCreateRequest> { + type Output = httpclient::InMemoryResult< + crate::model::UserThirdPartyTokenCreateResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/user/third_party_token/create"; + let mut r = self.client.client.post(url); + if let Some(ref unwrapped) = self.params.expiration_time { + r = r.json(serde_json::json!({ "expiration_time" : unwrapped })); + } + r = r + .json( + serde_json::json!( + { "third_party_client_id" : self.params.third_party_client_id } + ), + ); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Create a third-party user token + +This endpoint is used to create a third-party user token. This token can be shared with and used by a specified third-party client to access data associated with the user through supported endpoints. + +Ensure you store the `third_party_user_token` along with the `user_token` and `third_party_client_id`, as it is not possible to retrieve a previously created `third_party_user_token`. + +See endpoint docs at .*/ + pub fn user_third_party_token_create( + &self, + third_party_client_id: &str, + user_token: &str, + ) -> FluentRequest<'_, UserThirdPartyTokenCreateRequest> { + FluentRequest { + client: self, + params: UserThirdPartyTokenCreateRequest { + expiration_time: None, + third_party_client_id: third_party_client_id.to_owned(), + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/user_third_party_token_remove.rs b/src/request/user_third_party_token_remove.rs new file mode 100644 index 00000000..6c71a1a5 --- /dev/null +++ b/src/request/user_third_party_token_remove.rs @@ -0,0 +1,53 @@ +use crate::FluentRequest; +use serde::{Serialize, Deserialize}; +use httpclient::InMemoryResponseExt; +/**You should use this struct via [`PlaidClient::user_third_party_token_remove`]. + +On request success, this will return a [`UserThirdPartyTokenRemoveResponse`].*/ +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct UserThirdPartyTokenRemoveRequest { + pub third_party_user_token: String, +} +impl FluentRequest<'_, UserThirdPartyTokenRemoveRequest> {} +impl<'a> ::std::future::IntoFuture +for FluentRequest<'a, UserThirdPartyTokenRemoveRequest> { + type Output = httpclient::InMemoryResult< + crate::model::UserThirdPartyTokenRemoveResponse, + >; + type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; + fn into_future(self) -> Self::IntoFuture { + Box::pin(async move { + let url = "/user/third_party_token/remove"; + let mut r = self.client.client.post(url); + r = r + .json( + serde_json::json!( + { "third_party_user_token" : self.params.third_party_user_token } + ), + ); + r = self.client.authenticate(r); + let res = r.await?; + res.json().map_err(Into::into) + }) + } +} +impl crate::PlaidClient { + /**Remove a third-party user token + +This endpoint is used to delete a third-party user token. Once removed, the token can longer be used to access data associated with the user. + +Any subsequent calls to retrieve information using the same third-party user token will result in an error stating the third-party user token does not exist. + +See endpoint docs at .*/ + pub fn user_third_party_token_remove( + &self, + third_party_user_token: &str, + ) -> FluentRequest<'_, UserThirdPartyTokenRemoveRequest> { + FluentRequest { + client: self, + params: UserThirdPartyTokenRemoveRequest { + third_party_user_token: third_party_user_token.to_owned(), + }, + } + } +} diff --git a/src/request/user_update.rs b/src/request/user_update.rs index 4f401b87..1532f573 100644 --- a/src/request/user_update.rs +++ b/src/request/user_update.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::ConsumerReportUserIdentity; /**You should use this struct via [`PlaidClient::user_update`]. On request success, this will return a [`UserUpdateResponse`].*/ @@ -12,8 +10,8 @@ pub struct UserUpdateRequest { pub consumer_report_user_identity: Option, pub user_token: String, } -impl UserUpdateRequest {} impl FluentRequest<'_, UserUpdateRequest> { + ///Set the value of the consumer_report_user_identity field. pub fn consumer_report_user_identity( mut self, consumer_report_user_identity: ConsumerReportUserIdentity, @@ -23,19 +21,40 @@ impl FluentRequest<'_, UserUpdateRequest> { } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, UserUpdateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/user/update"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.consumer_report_user_identity { - r = r.json(json!({ "consumer_report_user_identity" : unwrapped })); + r = r + .json( + serde_json::json!( + { "consumer_report_user_identity" : unwrapped } + ), + ); } - r = r.json(json!({ "user_token" : self.params.user_token })); + r = r.json(serde_json::json!({ "user_token" : self.params.user_token })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update user information + +This endpoint is used to update user information associated with an existing `user_token`. It can also be used to enable an existing `user_token` for use with Consumer Reports by Plaid Check, by adding a `consumer_report_user_identity` object to the user. + +See endpoint docs at .*/ + pub fn user_update(&self, user_token: &str) -> FluentRequest<'_, UserUpdateRequest> { + FluentRequest { + client: self, + params: UserUpdateRequest { + consumer_report_user_identity: None, + user_token: user_token.to_owned(), + }, + } + } +} diff --git a/src/request/wallet_create.rs b/src/request/wallet_create.rs index 8ff1a6bb..4cfdf7c9 100644 --- a/src/request/wallet_create.rs +++ b/src/request/wallet_create.rs @@ -1,29 +1,49 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::WalletISOCurrencyCode; /**You should use this struct via [`PlaidClient::wallet_create`]. On request success, this will return a [`WalletCreateResponse`].*/ #[derive(Debug, Clone, Serialize, Deserialize)] pub struct WalletCreateRequest { - pub iso_currency_code: String, + pub iso_currency_code: WalletIsoCurrencyCode, } -impl WalletCreateRequest {} impl FluentRequest<'_, WalletCreateRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WalletCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/wallet/create"; let mut r = self.client.client.post(url); - r = r.json(json!({ "iso_currency_code" : self.params.iso_currency_code })); + r = r + .json( + serde_json::json!( + { "iso_currency_code" : self.params.iso_currency_code } + ), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create an e-wallet + +Create an e-wallet. The response is the newly created e-wallet object. + +See endpoint docs at .*/ + pub fn wallet_create( + &self, + iso_currency_code: WalletIsoCurrencyCode, + ) -> FluentRequest<'_, WalletCreateRequest> { + FluentRequest { + client: self, + params: WalletCreateRequest { + iso_currency_code, + }, + } + } +} diff --git a/src/request/wallet_get.rs b/src/request/wallet_get.rs index 7ace28d6..c4586999 100644 --- a/src/request/wallet_get.rs +++ b/src/request/wallet_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::wallet_get`]. On request success, this will return a [`WalletGetResponse`].*/ @@ -11,19 +8,33 @@ On request success, this will return a [`WalletGetResponse`].*/ pub struct WalletGetRequest { pub wallet_id: String, } -impl WalletGetRequest {} impl FluentRequest<'_, WalletGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WalletGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/wallet/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "wallet_id" : self.params.wallet_id })); + r = r.json(serde_json::json!({ "wallet_id" : self.params.wallet_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Fetch an e-wallet + +Fetch an e-wallet. The response includes the current balance. + +See endpoint docs at .*/ + pub fn wallet_get(&self, wallet_id: &str) -> FluentRequest<'_, WalletGetRequest> { + FluentRequest { + client: self, + params: WalletGetRequest { + wallet_id: wallet_id.to_owned(), + }, + } + } +} diff --git a/src/request/wallet_list.rs b/src/request/wallet_list.rs index c1c0c451..98040293 100644 --- a/src/request/wallet_list.rs +++ b/src/request/wallet_list.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::WalletISOCurrencyCode; /**You should use this struct via [`PlaidClient::wallet_list`]. On request success, this will return a [`WalletListResponse`].*/ @@ -11,42 +9,64 @@ On request success, this will return a [`WalletListResponse`].*/ pub struct WalletListRequest { pub count: Option, pub cursor: Option, - pub iso_currency_code: Option, + pub iso_currency_code: Option, } -impl WalletListRequest {} impl FluentRequest<'_, WalletListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self } - pub fn iso_currency_code(mut self, iso_currency_code: &str) -> Self { - self.params.iso_currency_code = Some(iso_currency_code.to_owned()); + ///Set the value of the iso_currency_code field. + pub fn iso_currency_code( + mut self, + iso_currency_code: WalletIsoCurrencyCode, + ) -> Self { + self.params.iso_currency_code = Some(iso_currency_code); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WalletListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/wallet/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } if let Some(ref unwrapped) = self.params.iso_currency_code { - r = r.json(json!({ "iso_currency_code" : unwrapped })); + r = r.json(serde_json::json!({ "iso_currency_code" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Fetch a list of e-wallets + +This endpoint lists all e-wallets in descending order of creation. + +See endpoint docs at .*/ + pub fn wallet_list(&self) -> FluentRequest<'_, WalletListRequest> { + FluentRequest { + client: self, + params: WalletListRequest { + count: None, + cursor: None, + iso_currency_code: None, + }, + } + } +} diff --git a/src/request/wallet_transaction_execute.rs b/src/request/wallet_transaction_execute.rs index a749365a..b27dcaae 100644 --- a/src/request/wallet_transaction_execute.rs +++ b/src/request/wallet_transaction_execute.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{WalletTransactionAmount, WalletTransactionCounterparty}; /**You should use this struct via [`PlaidClient::wallet_transaction_execute`]. On request success, this will return a [`WalletTransactionExecuteResponse`].*/ @@ -15,7 +13,6 @@ pub struct WalletTransactionExecuteRequest { pub reference: String, pub wallet_id: String, } -impl WalletTransactionExecuteRequest {} pub struct WalletTransactionExecuteRequired<'a> { pub amount: WalletTransactionAmount, pub counterparty: WalletTransactionCounterparty, @@ -23,24 +20,54 @@ pub struct WalletTransactionExecuteRequired<'a> { pub reference: &'a str, pub wallet_id: &'a str, } -impl<'a> WalletTransactionExecuteRequired<'a> {} impl FluentRequest<'_, WalletTransactionExecuteRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WalletTransactionExecuteRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WalletTransactionExecuteResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/wallet/transaction/execute"; let mut r = self.client.client.post(url); - r = r.json(json!({ "amount" : self.params.amount })); - r = r.json(json!({ "counterparty" : self.params.counterparty })); - r = r.json(json!({ "idempotency_key" : self.params.idempotency_key })); - r = r.json(json!({ "reference" : self.params.reference })); - r = r.json(json!({ "wallet_id" : self.params.wallet_id })); + r = r.json(serde_json::json!({ "amount" : self.params.amount })); + r = r.json(serde_json::json!({ "counterparty" : self.params.counterparty })); + r = r + .json( + serde_json::json!( + { "idempotency_key" : self.params.idempotency_key } + ), + ); + r = r.json(serde_json::json!({ "reference" : self.params.reference })); + r = r.json(serde_json::json!({ "wallet_id" : self.params.wallet_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Execute a transaction using an e-wallet + +Execute a transaction using the specified e-wallet. +Specify the e-wallet to debit from, the counterparty to credit to, the idempotency key to prevent duplicate transactions, the amount and reference for the transaction. +Transactions will settle in seconds to several days, depending on the underlying payment rail. + +See endpoint docs at .*/ + pub fn wallet_transaction_execute( + &self, + args: WalletTransactionExecuteRequired, + ) -> FluentRequest<'_, WalletTransactionExecuteRequest> { + FluentRequest { + client: self, + params: WalletTransactionExecuteRequest { + amount: args.amount, + counterparty: args.counterparty, + idempotency_key: args.idempotency_key.to_owned(), + reference: args.reference.to_owned(), + wallet_id: args.wallet_id.to_owned(), + }, + } + } +} diff --git a/src/request/wallet_transaction_get.rs b/src/request/wallet_transaction_get.rs index 48ebbbbb..7edfc26a 100644 --- a/src/request/wallet_transaction_get.rs +++ b/src/request/wallet_transaction_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::wallet_transaction_get`]. On request success, this will return a [`WalletTransactionGetResponse`].*/ @@ -11,19 +8,39 @@ On request success, this will return a [`WalletTransactionGetResponse`].*/ pub struct WalletTransactionGetRequest { pub transaction_id: String, } -impl WalletTransactionGetRequest {} impl FluentRequest<'_, WalletTransactionGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WalletTransactionGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/wallet/transaction/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "transaction_id" : self.params.transaction_id })); + r = r + .json( + serde_json::json!({ "transaction_id" : self.params.transaction_id }), + ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Fetch an e-wallet transaction + +Fetch a specific e-wallet transaction + +See endpoint docs at .*/ + pub fn wallet_transaction_get( + &self, + transaction_id: &str, + ) -> FluentRequest<'_, WalletTransactionGetRequest> { + FluentRequest { + client: self, + params: WalletTransactionGetRequest { + transaction_id: transaction_id.to_owned(), + }, + } + } +} diff --git a/src/request/wallet_transaction_list.rs b/src/request/wallet_transaction_list.rs index 4a3b46de..9649531a 100644 --- a/src/request/wallet_transaction_list.rs +++ b/src/request/wallet_transaction_list.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::WalletTransactionListRequestOptions; /**You should use this struct via [`PlaidClient::wallet_transaction_list`]. On request success, this will return a [`WalletTransactionListResponse`].*/ @@ -14,41 +12,66 @@ pub struct WalletTransactionListRequest { pub options: Option, pub wallet_id: String, } -impl WalletTransactionListRequest {} impl FluentRequest<'_, WalletTransactionListRequest> { + ///Set the value of the count field. pub fn count(mut self, count: i64) -> Self { self.params.count = Some(count); self } + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self } + ///Set the value of the options field. pub fn options(mut self, options: WalletTransactionListRequestOptions) -> Self { self.params.options = Some(options); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WalletTransactionListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WalletTransactionListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/wallet/transaction/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.count { - r = r.json(json!({ "count" : unwrapped })); + r = r.json(serde_json::json!({ "count" : unwrapped })); } if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } if let Some(ref unwrapped) = self.params.options { - r = r.json(json!({ "options" : unwrapped })); + r = r.json(serde_json::json!({ "options" : unwrapped })); } - r = r.json(json!({ "wallet_id" : self.params.wallet_id })); + r = r.json(serde_json::json!({ "wallet_id" : self.params.wallet_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List e-wallet transactions + +This endpoint lists the latest transactions of the specified e-wallet. Transactions are returned in descending order by the `created_at` time. + +See endpoint docs at .*/ + pub fn wallet_transaction_list( + &self, + wallet_id: &str, + ) -> FluentRequest<'_, WalletTransactionListRequest> { + FluentRequest { + client: self, + params: WalletTransactionListRequest { + count: None, + cursor: None, + options: None, + wallet_id: wallet_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_create.rs b/src/request/watchlist_screening_entity_create.rs index 70dcccde..1ef1aae5 100644 --- a/src/request/watchlist_screening_entity_create.rs +++ b/src/request/watchlist_screening_entity_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::EntityWatchlistSearchTerms; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_create`]. On request success, this will return a [`WatchlistScreeningEntityCreateResponse`].*/ @@ -12,8 +10,8 @@ pub struct WatchlistScreeningEntityCreateRequest { pub client_user_id: Option, pub search_terms: EntityWatchlistSearchTerms, } -impl WatchlistScreeningEntityCreateRequest {} impl FluentRequest<'_, WatchlistScreeningEntityCreateRequest> { + ///Set the value of the client_user_id field. pub fn client_user_id(mut self, client_user_id: &str) -> Self { self.params.client_user_id = Some(client_user_id.to_owned()); self @@ -21,19 +19,40 @@ impl FluentRequest<'_, WatchlistScreeningEntityCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningEntityCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/watchlist_screening/entity/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.client_user_id { - r = r.json(json!({ "client_user_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); } - r = r.json(json!({ "search_terms" : self.params.search_terms })); + r = r.json(serde_json::json!({ "search_terms" : self.params.search_terms })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a watchlist screening for an entity + +Create a new entity watchlist screening to check your customer against watchlists defined in the associated entity watchlist program. If your associated program has ongoing screening enabled, this is the profile information that will be used to monitor your customer over time. + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_create( + &self, + search_terms: EntityWatchlistSearchTerms, + ) -> FluentRequest<'_, WatchlistScreeningEntityCreateRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityCreateRequest { + client_user_id: None, + search_terms, + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_get.rs b/src/request/watchlist_screening_entity_get.rs index 50d46add..fbc6a5df 100644 --- a/src/request/watchlist_screening_entity_get.rs +++ b/src/request/watchlist_screening_entity_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_get`]. On request success, this will return a [`WatchlistScreeningEntityGetResponse`].*/ @@ -11,11 +8,12 @@ On request success, this will return a [`WatchlistScreeningEntityGetResponse`].* pub struct WatchlistScreeningEntityGetRequest { pub entity_watchlist_screening_id: String, } -impl WatchlistScreeningEntityGetRequest {} impl FluentRequest<'_, WatchlistScreeningEntityGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningEntityGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,7 +21,7 @@ for FluentRequest<'a, WatchlistScreeningEntityGetRequest> { let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "entity_watchlist_screening_id" : self.params .entity_watchlist_screening_id } ), @@ -33,4 +31,22 @@ for FluentRequest<'a, WatchlistScreeningEntityGetRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get an entity screening + +Retrieve an entity watchlist screening. + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_get( + &self, + entity_watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningEntityGetRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityGetRequest { + entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_history_list.rs b/src/request/watchlist_screening_entity_history_list.rs index 1246e979..42a3527f 100644 --- a/src/request/watchlist_screening_entity_history_list.rs +++ b/src/request/watchlist_screening_entity_history_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_history_list`]. On request success, this will return a [`WatchlistScreeningEntityHistoryListResponse`].*/ @@ -12,8 +9,8 @@ pub struct WatchlistScreeningEntityHistoryListRequest { pub cursor: Option, pub entity_watchlist_screening_id: String, } -impl WatchlistScreeningEntityHistoryListRequest {} impl FluentRequest<'_, WatchlistScreeningEntityHistoryListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -22,7 +19,7 @@ impl FluentRequest<'_, WatchlistScreeningEntityHistoryListRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityHistoryListRequest> { type Output = httpclient::InMemoryResult< - WatchlistScreeningEntityHistoryListResponse, + crate::model::WatchlistScreeningEntityHistoryListResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -30,11 +27,11 @@ for FluentRequest<'a, WatchlistScreeningEntityHistoryListRequest> { let url = "/watchlist_screening/entity/history/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "entity_watchlist_screening_id" : self.params .entity_watchlist_screening_id } ), @@ -44,4 +41,23 @@ for FluentRequest<'a, WatchlistScreeningEntityHistoryListRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List history for entity watchlist screenings + +List all changes to the entity watchlist screening in reverse-chronological order. If the watchlist screening has not been edited, no history will be returned. + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_history_list( + &self, + entity_watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningEntityHistoryListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityHistoryListRequest { + cursor: None, + entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_hit_list.rs b/src/request/watchlist_screening_entity_hit_list.rs index a90252e2..f095dedd 100644 --- a/src/request/watchlist_screening_entity_hit_list.rs +++ b/src/request/watchlist_screening_entity_hit_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_hit_list`]. On request success, this will return a [`WatchlistScreeningEntityHitListResponse`].*/ @@ -12,8 +9,8 @@ pub struct WatchlistScreeningEntityHitListRequest { pub cursor: Option, pub entity_watchlist_screening_id: String, } -impl WatchlistScreeningEntityHitListRequest {} impl FluentRequest<'_, WatchlistScreeningEntityHitListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -21,18 +18,20 @@ impl FluentRequest<'_, WatchlistScreeningEntityHitListRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityHitListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningEntityHitListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/watchlist_screening/entity/hit/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "entity_watchlist_screening_id" : self.params .entity_watchlist_screening_id } ), @@ -42,4 +41,23 @@ for FluentRequest<'a, WatchlistScreeningEntityHitListRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List hits for entity watchlist screenings + +List all hits for the entity watchlist screening. + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_hit_list( + &self, + entity_watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningEntityHitListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityHitListRequest { + cursor: None, + entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_list.rs b/src/request/watchlist_screening_entity_list.rs index 8188ef73..e7adc97c 100644 --- a/src/request/watchlist_screening_entity_list.rs +++ b/src/request/watchlist_screening_entity_list.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::WatchlistScreeningStatus; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_list`]. On request success, this will return a [`WatchlistScreeningEntityListResponse`].*/ @@ -13,57 +11,84 @@ pub struct WatchlistScreeningEntityListRequest { pub client_user_id: Option, pub cursor: Option, pub entity_watchlist_program_id: String, - pub status: Option, + pub status: Option, } -impl WatchlistScreeningEntityListRequest {} impl FluentRequest<'_, WatchlistScreeningEntityListRequest> { + ///Set the value of the assignee field. pub fn assignee(mut self, assignee: &str) -> Self { self.params.assignee = Some(assignee.to_owned()); self } + ///Set the value of the client_user_id field. pub fn client_user_id(mut self, client_user_id: &str) -> Self { self.params.client_user_id = Some(client_user_id.to_owned()); self } + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self } - pub fn status(mut self, status: &str) -> Self { - self.params.status = Some(status.to_owned()); + ///Set the value of the status field. + pub fn status(mut self, status: WatchlistScreeningStatus) -> Self { + self.params.status = Some(status); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningEntityListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/watchlist_screening/entity/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.assignee { - r = r.json(json!({ "assignee" : unwrapped })); + r = r.json(serde_json::json!({ "assignee" : unwrapped })); } if let Some(ref unwrapped) = self.params.client_user_id { - r = r.json(json!({ "client_user_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "entity_watchlist_program_id" : self.params .entity_watchlist_program_id } ), ); if let Some(ref unwrapped) = self.params.status { - r = r.json(json!({ "status" : unwrapped })); + r = r.json(serde_json::json!({ "status" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List entity watchlist screenings + +List all entity screenings. + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_list( + &self, + entity_watchlist_program_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningEntityListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityListRequest { + assignee: None, + client_user_id: None, + cursor: None, + entity_watchlist_program_id: entity_watchlist_program_id.to_owned(), + status: None, + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_program_get.rs b/src/request/watchlist_screening_entity_program_get.rs index 41858baa..425154dd 100644 --- a/src/request/watchlist_screening_entity_program_get.rs +++ b/src/request/watchlist_screening_entity_program_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_program_get`]. On request success, this will return a [`WatchlistScreeningEntityProgramGetResponse`].*/ @@ -11,11 +8,12 @@ On request success, this will return a [`WatchlistScreeningEntityProgramGetRespo pub struct WatchlistScreeningEntityProgramGetRequest { pub entity_watchlist_program_id: String, } -impl WatchlistScreeningEntityProgramGetRequest {} impl FluentRequest<'_, WatchlistScreeningEntityProgramGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityProgramGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningEntityProgramGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,7 +21,7 @@ for FluentRequest<'a, WatchlistScreeningEntityProgramGetRequest> { let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "entity_watchlist_program_id" : self.params .entity_watchlist_program_id } ), @@ -33,4 +31,22 @@ for FluentRequest<'a, WatchlistScreeningEntityProgramGetRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get entity watchlist screening program + +Get an entity watchlist screening program + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_program_get( + &self, + entity_watchlist_program_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningEntityProgramGetRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityProgramGetRequest { + entity_watchlist_program_id: entity_watchlist_program_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_program_list.rs b/src/request/watchlist_screening_entity_program_list.rs index 484390dc..11e5d9a5 100644 --- a/src/request/watchlist_screening_entity_program_list.rs +++ b/src/request/watchlist_screening_entity_program_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_program_list`]. On request success, this will return a [`WatchlistScreeningEntityProgramListResponse`].*/ @@ -11,8 +8,8 @@ On request success, this will return a [`WatchlistScreeningEntityProgramListResp pub struct WatchlistScreeningEntityProgramListRequest { pub cursor: Option, } -impl WatchlistScreeningEntityProgramListRequest {} impl FluentRequest<'_, WatchlistScreeningEntityProgramListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -21,7 +18,7 @@ impl FluentRequest<'_, WatchlistScreeningEntityProgramListRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityProgramListRequest> { type Output = httpclient::InMemoryResult< - WatchlistScreeningEntityProgramListResponse, + crate::model::WatchlistScreeningEntityProgramListResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -29,11 +26,28 @@ for FluentRequest<'a, WatchlistScreeningEntityProgramListRequest> { let url = "/watchlist_screening/entity/program/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List entity watchlist screening programs + +List all entity watchlist screening programs + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_program_list( + &self, + ) -> FluentRequest<'_, WatchlistScreeningEntityProgramListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityProgramListRequest { + cursor: None, + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_review_create.rs b/src/request/watchlist_screening_entity_review_create.rs index 88d780ff..67bac74a 100644 --- a/src/request/watchlist_screening_entity_review_create.rs +++ b/src/request/watchlist_screening_entity_review_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_review_create`]. On request success, this will return a [`WatchlistScreeningEntityReviewCreateResponse`].*/ @@ -14,8 +11,8 @@ pub struct WatchlistScreeningEntityReviewCreateRequest { pub dismissed_hits: Vec, pub entity_watchlist_screening_id: String, } -impl WatchlistScreeningEntityReviewCreateRequest {} impl FluentRequest<'_, WatchlistScreeningEntityReviewCreateRequest> { + ///Set the value of the comment field. pub fn comment(mut self, comment: &str) -> Self { self.params.comment = Some(comment.to_owned()); self @@ -24,7 +21,7 @@ impl FluentRequest<'_, WatchlistScreeningEntityReviewCreateRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityReviewCreateRequest> { type Output = httpclient::InMemoryResult< - WatchlistScreeningEntityReviewCreateResponse, + crate::model::WatchlistScreeningEntityReviewCreateResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -32,13 +29,19 @@ for FluentRequest<'a, WatchlistScreeningEntityReviewCreateRequest> { let url = "/watchlist_screening/entity/review/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.comment { - r = r.json(json!({ "comment" : unwrapped })); + r = r.json(serde_json::json!({ "comment" : unwrapped })); } - r = r.json(json!({ "confirmed_hits" : self.params.confirmed_hits })); - r = r.json(json!({ "dismissed_hits" : self.params.dismissed_hits })); r = r .json( - json!( + serde_json::json!({ "confirmed_hits" : self.params.confirmed_hits }), + ); + r = r + .json( + serde_json::json!({ "dismissed_hits" : self.params.dismissed_hits }), + ); + r = r + .json( + serde_json::json!( { "entity_watchlist_screening_id" : self.params .entity_watchlist_screening_id } ), @@ -48,4 +51,27 @@ for FluentRequest<'a, WatchlistScreeningEntityReviewCreateRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a review for an entity watchlist screening + +Create a review for an entity watchlist screening. Reviews are compliance reports created by users in your organization regarding the relevance of potential hits found by Plaid. + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_review_create( + &self, + confirmed_hits: &[&str], + dismissed_hits: &[&str], + entity_watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningEntityReviewCreateRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityReviewCreateRequest { + comment: None, + confirmed_hits: confirmed_hits.iter().map(|&x| x.to_owned()).collect(), + dismissed_hits: dismissed_hits.iter().map(|&x| x.to_owned()).collect(), + entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_review_list.rs b/src/request/watchlist_screening_entity_review_list.rs index 74decee9..7b2d4765 100644 --- a/src/request/watchlist_screening_entity_review_list.rs +++ b/src/request/watchlist_screening_entity_review_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_review_list`]. On request success, this will return a [`WatchlistScreeningEntityReviewListResponse`].*/ @@ -12,8 +9,8 @@ pub struct WatchlistScreeningEntityReviewListRequest { pub cursor: Option, pub entity_watchlist_screening_id: String, } -impl WatchlistScreeningEntityReviewListRequest {} impl FluentRequest<'_, WatchlistScreeningEntityReviewListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -21,18 +18,20 @@ impl FluentRequest<'_, WatchlistScreeningEntityReviewListRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityReviewListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningEntityReviewListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/watchlist_screening/entity/review/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "entity_watchlist_screening_id" : self.params .entity_watchlist_screening_id } ), @@ -42,4 +41,23 @@ for FluentRequest<'a, WatchlistScreeningEntityReviewListRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List reviews for entity watchlist screenings + +List all reviews for a particular entity watchlist screening. Reviews are compliance reports created by users in your organization regarding the relevance of potential hits found by Plaid. + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_review_list( + &self, + entity_watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningEntityReviewListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityReviewListRequest { + cursor: None, + entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_entity_update.rs b/src/request/watchlist_screening_entity_update.rs index 92aff80d..ecd60ed1 100644 --- a/src/request/watchlist_screening_entity_update.rs +++ b/src/request/watchlist_screening_entity_update.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + WatchlistScreeningEntityUpdateRequestResettableFieldList, + UpdateEntityScreeningRequestSearchTerms, WatchlistScreeningStatus, +}; /**You should use this struct via [`PlaidClient::watchlist_screening_entity_update`]. On request success, this will return a [`WatchlistScreeningEntityUpdateResponse`].*/ @@ -12,31 +13,30 @@ pub struct WatchlistScreeningEntityUpdateRequest { pub assignee: Option, pub client_user_id: Option, pub entity_watchlist_screening_id: String, - pub reset_fields: Option>, + pub reset_fields: Option, pub search_terms: Option, - pub status: Option, + pub status: Option, } -impl WatchlistScreeningEntityUpdateRequest {} impl FluentRequest<'_, WatchlistScreeningEntityUpdateRequest> { + ///Set the value of the assignee field. pub fn assignee(mut self, assignee: &str) -> Self { self.params.assignee = Some(assignee.to_owned()); self } + ///Set the value of the client_user_id field. pub fn client_user_id(mut self, client_user_id: &str) -> Self { self.params.client_user_id = Some(client_user_id.to_owned()); self } + ///Set the value of the reset_fields field. pub fn reset_fields( mut self, - reset_fields: impl IntoIterator>, + reset_fields: WatchlistScreeningEntityUpdateRequestResettableFieldList, ) -> Self { - self - .params - .reset_fields = Some( - reset_fields.into_iter().map(|s| s.as_ref().to_owned()).collect(), - ); + self.params.reset_fields = Some(reset_fields); self } + ///Set the value of the search_terms field. pub fn search_terms( mut self, search_terms: UpdateEntityScreeningRequestSearchTerms, @@ -44,44 +44,70 @@ impl FluentRequest<'_, WatchlistScreeningEntityUpdateRequest> { self.params.search_terms = Some(search_terms); self } - pub fn status(mut self, status: &str) -> Self { - self.params.status = Some(status.to_owned()); + ///Set the value of the status field. + pub fn status(mut self, status: WatchlistScreeningStatus) -> Self { + self.params.status = Some(status); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningEntityUpdateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningEntityUpdateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/watchlist_screening/entity/update"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.assignee { - r = r.json(json!({ "assignee" : unwrapped })); + r = r.json(serde_json::json!({ "assignee" : unwrapped })); } if let Some(ref unwrapped) = self.params.client_user_id { - r = r.json(json!({ "client_user_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "entity_watchlist_screening_id" : self.params .entity_watchlist_screening_id } ), ); if let Some(ref unwrapped) = self.params.reset_fields { - r = r.json(json!({ "reset_fields" : unwrapped })); + r = r.json(serde_json::json!({ "reset_fields" : unwrapped })); } if let Some(ref unwrapped) = self.params.search_terms { - r = r.json(json!({ "search_terms" : unwrapped })); + r = r.json(serde_json::json!({ "search_terms" : unwrapped })); } if let Some(ref unwrapped) = self.params.status { - r = r.json(json!({ "status" : unwrapped })); + r = r.json(serde_json::json!({ "status" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update an entity screening + +Update an entity watchlist screening. + +See endpoint docs at .*/ + pub fn watchlist_screening_entity_update( + &self, + entity_watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningEntityUpdateRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningEntityUpdateRequest { + assignee: None, + client_user_id: None, + entity_watchlist_screening_id: entity_watchlist_screening_id.to_owned(), + reset_fields: None, + search_terms: None, + status: None, + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_create.rs b/src/request/watchlist_screening_individual_create.rs index 7be5c2fe..774d6279 100644 --- a/src/request/watchlist_screening_individual_create.rs +++ b/src/request/watchlist_screening_individual_create.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::WatchlistScreeningRequestSearchTerms; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_create`]. On request success, this will return a [`WatchlistScreeningIndividualCreateResponse`].*/ @@ -12,8 +10,8 @@ pub struct WatchlistScreeningIndividualCreateRequest { pub client_user_id: Option, pub search_terms: WatchlistScreeningRequestSearchTerms, } -impl WatchlistScreeningIndividualCreateRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualCreateRequest> { + ///Set the value of the client_user_id field. pub fn client_user_id(mut self, client_user_id: &str) -> Self { self.params.client_user_id = Some(client_user_id.to_owned()); self @@ -21,19 +19,40 @@ impl FluentRequest<'_, WatchlistScreeningIndividualCreateRequest> { } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualCreateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningIndividualCreateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/watchlist_screening/individual/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.client_user_id { - r = r.json(json!({ "client_user_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); } - r = r.json(json!({ "search_terms" : self.params.search_terms })); + r = r.json(serde_json::json!({ "search_terms" : self.params.search_terms })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a watchlist screening for a person + +Create a new Watchlist Screening to check your customer against watchlists defined in the associated Watchlist Program. If your associated program has ongoing screening enabled, this is the profile information that will be used to monitor your customer over time. + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_create( + &self, + search_terms: WatchlistScreeningRequestSearchTerms, + ) -> FluentRequest<'_, WatchlistScreeningIndividualCreateRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualCreateRequest { + client_user_id: None, + search_terms, + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_get.rs b/src/request/watchlist_screening_individual_get.rs index 135f6d89..67e0863d 100644 --- a/src/request/watchlist_screening_individual_get.rs +++ b/src/request/watchlist_screening_individual_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_get`]. On request success, this will return a [`WatchlistScreeningIndividualGetResponse`].*/ @@ -11,11 +8,12 @@ On request success, this will return a [`WatchlistScreeningIndividualGetResponse pub struct WatchlistScreeningIndividualGetRequest { pub watchlist_screening_id: String, } -impl WatchlistScreeningIndividualGetRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningIndividualGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { @@ -23,7 +21,7 @@ for FluentRequest<'a, WatchlistScreeningIndividualGetRequest> { let mut r = self.client.client.post(url); r = r .json( - json!( + serde_json::json!( { "watchlist_screening_id" : self.params.watchlist_screening_id } ), ); @@ -32,4 +30,22 @@ for FluentRequest<'a, WatchlistScreeningIndividualGetRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Retrieve an individual watchlist screening + +Retrieve a previously created individual watchlist screening + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_get( + &self, + watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningIndividualGetRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualGetRequest { + watchlist_screening_id: watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_history_list.rs b/src/request/watchlist_screening_individual_history_list.rs index 043f3e84..bc9186ba 100644 --- a/src/request/watchlist_screening_individual_history_list.rs +++ b/src/request/watchlist_screening_individual_history_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_history_list`]. On request success, this will return a [`WatchlistScreeningIndividualHistoryListResponse`].*/ @@ -12,8 +9,8 @@ pub struct WatchlistScreeningIndividualHistoryListRequest { pub cursor: Option, pub watchlist_screening_id: String, } -impl WatchlistScreeningIndividualHistoryListRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualHistoryListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -22,7 +19,7 @@ impl FluentRequest<'_, WatchlistScreeningIndividualHistoryListRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualHistoryListRequest> { type Output = httpclient::InMemoryResult< - WatchlistScreeningIndividualHistoryListResponse, + crate::model::WatchlistScreeningIndividualHistoryListResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -30,11 +27,11 @@ for FluentRequest<'a, WatchlistScreeningIndividualHistoryListRequest> { let url = "/watchlist_screening/individual/history/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "watchlist_screening_id" : self.params.watchlist_screening_id } ), ); @@ -43,4 +40,23 @@ for FluentRequest<'a, WatchlistScreeningIndividualHistoryListRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List history for individual watchlist screenings + +List all changes to the individual watchlist screening in reverse-chronological order. If the watchlist screening has not been edited, no history will be returned. + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_history_list( + &self, + watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningIndividualHistoryListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualHistoryListRequest { + cursor: None, + watchlist_screening_id: watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_hit_list.rs b/src/request/watchlist_screening_individual_hit_list.rs index 77b2cb48..1d4ebd0d 100644 --- a/src/request/watchlist_screening_individual_hit_list.rs +++ b/src/request/watchlist_screening_individual_hit_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_hit_list`]. On request success, this will return a [`WatchlistScreeningIndividualHitListResponse`].*/ @@ -12,8 +9,8 @@ pub struct WatchlistScreeningIndividualHitListRequest { pub cursor: Option, pub watchlist_screening_id: String, } -impl WatchlistScreeningIndividualHitListRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualHitListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -22,7 +19,7 @@ impl FluentRequest<'_, WatchlistScreeningIndividualHitListRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualHitListRequest> { type Output = httpclient::InMemoryResult< - WatchlistScreeningIndividualHitListResponse, + crate::model::WatchlistScreeningIndividualHitListResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -30,11 +27,11 @@ for FluentRequest<'a, WatchlistScreeningIndividualHitListRequest> { let url = "/watchlist_screening/individual/hit/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "watchlist_screening_id" : self.params.watchlist_screening_id } ), ); @@ -43,4 +40,23 @@ for FluentRequest<'a, WatchlistScreeningIndividualHitListRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List hits for individual watchlist screening + +List all hits found by Plaid for a particular individual watchlist screening. + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_hit_list( + &self, + watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningIndividualHitListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualHitListRequest { + cursor: None, + watchlist_screening_id: watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_list.rs b/src/request/watchlist_screening_individual_list.rs index b0a4db55..9c4db11f 100644 --- a/src/request/watchlist_screening_individual_list.rs +++ b/src/request/watchlist_screening_individual_list.rs @@ -1,9 +1,7 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::WatchlistScreeningStatus; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_list`]. On request success, this will return a [`WatchlistScreeningIndividualListResponse`].*/ @@ -12,55 +10,84 @@ pub struct WatchlistScreeningIndividualListRequest { pub assignee: Option, pub client_user_id: Option, pub cursor: Option, - pub status: Option, + pub status: Option, pub watchlist_program_id: String, } -impl WatchlistScreeningIndividualListRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualListRequest> { + ///Set the value of the assignee field. pub fn assignee(mut self, assignee: &str) -> Self { self.params.assignee = Some(assignee.to_owned()); self } + ///Set the value of the client_user_id field. pub fn client_user_id(mut self, client_user_id: &str) -> Self { self.params.client_user_id = Some(client_user_id.to_owned()); self } + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self } - pub fn status(mut self, status: &str) -> Self { - self.params.status = Some(status.to_owned()); + ///Set the value of the status field. + pub fn status(mut self, status: WatchlistScreeningStatus) -> Self { + self.params.status = Some(status); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualListRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningIndividualListResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/watchlist_screening/individual/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.assignee { - r = r.json(json!({ "assignee" : unwrapped })); + r = r.json(serde_json::json!({ "assignee" : unwrapped })); } if let Some(ref unwrapped) = self.params.client_user_id { - r = r.json(json!({ "client_user_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } if let Some(ref unwrapped) = self.params.status { - r = r.json(json!({ "status" : unwrapped })); + r = r.json(serde_json::json!({ "status" : unwrapped })); } r = r .json( - json!({ "watchlist_program_id" : self.params.watchlist_program_id }), + serde_json::json!( + { "watchlist_program_id" : self.params.watchlist_program_id } + ), ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List Individual Watchlist Screenings + +List previously created watchlist screenings for individuals + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_list( + &self, + watchlist_program_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningIndividualListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualListRequest { + assignee: None, + client_user_id: None, + cursor: None, + status: None, + watchlist_program_id: watchlist_program_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_program_get.rs b/src/request/watchlist_screening_individual_program_get.rs index 8336a551..0edd0986 100644 --- a/src/request/watchlist_screening_individual_program_get.rs +++ b/src/request/watchlist_screening_individual_program_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_program_get`]. On request success, this will return a [`WatchlistScreeningIndividualProgramGetResponse`].*/ @@ -11,12 +8,11 @@ On request success, this will return a [`WatchlistScreeningIndividualProgramGetR pub struct WatchlistScreeningIndividualProgramGetRequest { pub watchlist_program_id: String, } -impl WatchlistScreeningIndividualProgramGetRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualProgramGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualProgramGetRequest> { type Output = httpclient::InMemoryResult< - WatchlistScreeningIndividualProgramGetResponse, + crate::model::WatchlistScreeningIndividualProgramGetResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -25,11 +21,31 @@ for FluentRequest<'a, WatchlistScreeningIndividualProgramGetRequest> { let mut r = self.client.client.post(url); r = r .json( - json!({ "watchlist_program_id" : self.params.watchlist_program_id }), + serde_json::json!( + { "watchlist_program_id" : self.params.watchlist_program_id } + ), ); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get individual watchlist screening program + +Get an individual watchlist screening program + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_program_get( + &self, + watchlist_program_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningIndividualProgramGetRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualProgramGetRequest { + watchlist_program_id: watchlist_program_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_program_list.rs b/src/request/watchlist_screening_individual_program_list.rs index 31b2e0f1..6ecd2a63 100644 --- a/src/request/watchlist_screening_individual_program_list.rs +++ b/src/request/watchlist_screening_individual_program_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_program_list`]. On request success, this will return a [`WatchlistScreeningIndividualProgramListResponse`].*/ @@ -11,8 +8,8 @@ On request success, this will return a [`WatchlistScreeningIndividualProgramList pub struct WatchlistScreeningIndividualProgramListRequest { pub cursor: Option, } -impl WatchlistScreeningIndividualProgramListRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualProgramListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -21,7 +18,7 @@ impl FluentRequest<'_, WatchlistScreeningIndividualProgramListRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualProgramListRequest> { type Output = httpclient::InMemoryResult< - WatchlistScreeningIndividualProgramListResponse, + crate::model::WatchlistScreeningIndividualProgramListResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -29,11 +26,28 @@ for FluentRequest<'a, WatchlistScreeningIndividualProgramListRequest> { let url = "/watchlist_screening/individual/program/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List individual watchlist screening programs + +List all individual watchlist screening programs + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_program_list( + &self, + ) -> FluentRequest<'_, WatchlistScreeningIndividualProgramListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualProgramListRequest { + cursor: None, + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_review_create.rs b/src/request/watchlist_screening_individual_review_create.rs index 8e4909cc..c254e69a 100644 --- a/src/request/watchlist_screening_individual_review_create.rs +++ b/src/request/watchlist_screening_individual_review_create.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_review_create`]. On request success, this will return a [`WatchlistScreeningIndividualReviewCreateResponse`].*/ @@ -14,8 +11,8 @@ pub struct WatchlistScreeningIndividualReviewCreateRequest { pub dismissed_hits: Vec, pub watchlist_screening_id: String, } -impl WatchlistScreeningIndividualReviewCreateRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualReviewCreateRequest> { + ///Set the value of the comment field. pub fn comment(mut self, comment: &str) -> Self { self.params.comment = Some(comment.to_owned()); self @@ -24,7 +21,7 @@ impl FluentRequest<'_, WatchlistScreeningIndividualReviewCreateRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualReviewCreateRequest> { type Output = httpclient::InMemoryResult< - WatchlistScreeningIndividualReviewCreateResponse, + crate::model::WatchlistScreeningIndividualReviewCreateResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -32,13 +29,19 @@ for FluentRequest<'a, WatchlistScreeningIndividualReviewCreateRequest> { let url = "/watchlist_screening/individual/review/create"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.comment { - r = r.json(json!({ "comment" : unwrapped })); + r = r.json(serde_json::json!({ "comment" : unwrapped })); } - r = r.json(json!({ "confirmed_hits" : self.params.confirmed_hits })); - r = r.json(json!({ "dismissed_hits" : self.params.dismissed_hits })); r = r .json( - json!( + serde_json::json!({ "confirmed_hits" : self.params.confirmed_hits }), + ); + r = r + .json( + serde_json::json!({ "dismissed_hits" : self.params.dismissed_hits }), + ); + r = r + .json( + serde_json::json!( { "watchlist_screening_id" : self.params.watchlist_screening_id } ), ); @@ -47,4 +50,27 @@ for FluentRequest<'a, WatchlistScreeningIndividualReviewCreateRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Create a review for an individual watchlist screening + +Create a review for the individual watchlist screening. Reviews are compliance reports created by users in your organization regarding the relevance of potential hits found by Plaid. + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_review_create( + &self, + confirmed_hits: &[&str], + dismissed_hits: &[&str], + watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningIndividualReviewCreateRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualReviewCreateRequest { + comment: None, + confirmed_hits: confirmed_hits.iter().map(|&x| x.to_owned()).collect(), + dismissed_hits: dismissed_hits.iter().map(|&x| x.to_owned()).collect(), + watchlist_screening_id: watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_review_list.rs b/src/request/watchlist_screening_individual_review_list.rs index 44fad8ad..c527818a 100644 --- a/src/request/watchlist_screening_individual_review_list.rs +++ b/src/request/watchlist_screening_individual_review_list.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_review_list`]. On request success, this will return a [`WatchlistScreeningIndividualReviewListResponse`].*/ @@ -12,8 +9,8 @@ pub struct WatchlistScreeningIndividualReviewListRequest { pub cursor: Option, pub watchlist_screening_id: String, } -impl WatchlistScreeningIndividualReviewListRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualReviewListRequest> { + ///Set the value of the cursor field. pub fn cursor(mut self, cursor: &str) -> Self { self.params.cursor = Some(cursor.to_owned()); self @@ -22,7 +19,7 @@ impl FluentRequest<'_, WatchlistScreeningIndividualReviewListRequest> { impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualReviewListRequest> { type Output = httpclient::InMemoryResult< - WatchlistScreeningIndividualReviewListResponse, + crate::model::WatchlistScreeningIndividualReviewListResponse, >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { @@ -30,11 +27,11 @@ for FluentRequest<'a, WatchlistScreeningIndividualReviewListRequest> { let url = "/watchlist_screening/individual/review/list"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.cursor { - r = r.json(json!({ "cursor" : unwrapped })); + r = r.json(serde_json::json!({ "cursor" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "watchlist_screening_id" : self.params.watchlist_screening_id } ), ); @@ -43,4 +40,23 @@ for FluentRequest<'a, WatchlistScreeningIndividualReviewListRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**List reviews for individual watchlist screenings + +List all reviews for the individual watchlist screening. + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_review_list( + &self, + watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningIndividualReviewListRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualReviewListRequest { + cursor: None, + watchlist_screening_id: watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/watchlist_screening_individual_update.rs b/src/request/watchlist_screening_individual_update.rs index 68e80319..ea4ad151 100644 --- a/src/request/watchlist_screening_individual_update.rs +++ b/src/request/watchlist_screening_individual_update.rs @@ -1,9 +1,10 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; +use crate::model::{ + WatchlistScreeningIndividualUpdateRequestResettableFieldList, + UpdateIndividualScreeningRequestSearchTerms, WatchlistScreeningStatus, +}; /**You should use this struct via [`PlaidClient::watchlist_screening_individual_update`]. On request success, this will return a [`WatchlistScreeningIndividualUpdateResponse`].*/ @@ -11,32 +12,33 @@ On request success, this will return a [`WatchlistScreeningIndividualUpdateRespo pub struct WatchlistScreeningIndividualUpdateRequest { pub assignee: Option, pub client_user_id: Option, - pub reset_fields: Option>, + pub reset_fields: Option< + WatchlistScreeningIndividualUpdateRequestResettableFieldList, + >, pub search_terms: Option, - pub status: Option, + pub status: Option, pub watchlist_screening_id: String, } -impl WatchlistScreeningIndividualUpdateRequest {} impl FluentRequest<'_, WatchlistScreeningIndividualUpdateRequest> { + ///Set the value of the assignee field. pub fn assignee(mut self, assignee: &str) -> Self { self.params.assignee = Some(assignee.to_owned()); self } + ///Set the value of the client_user_id field. pub fn client_user_id(mut self, client_user_id: &str) -> Self { self.params.client_user_id = Some(client_user_id.to_owned()); self } + ///Set the value of the reset_fields field. pub fn reset_fields( mut self, - reset_fields: impl IntoIterator>, + reset_fields: WatchlistScreeningIndividualUpdateRequestResettableFieldList, ) -> Self { - self - .params - .reset_fields = Some( - reset_fields.into_iter().map(|s| s.as_ref().to_owned()).collect(), - ); + self.params.reset_fields = Some(reset_fields); self } + ///Set the value of the search_terms field. pub fn search_terms( mut self, search_terms: UpdateIndividualScreeningRequestSearchTerms, @@ -44,37 +46,40 @@ impl FluentRequest<'_, WatchlistScreeningIndividualUpdateRequest> { self.params.search_terms = Some(search_terms); self } - pub fn status(mut self, status: &str) -> Self { - self.params.status = Some(status.to_owned()); + ///Set the value of the status field. + pub fn status(mut self, status: WatchlistScreeningStatus) -> Self { + self.params.status = Some(status); self } } impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WatchlistScreeningIndividualUpdateRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WatchlistScreeningIndividualUpdateResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/watchlist_screening/individual/update"; let mut r = self.client.client.post(url); if let Some(ref unwrapped) = self.params.assignee { - r = r.json(json!({ "assignee" : unwrapped })); + r = r.json(serde_json::json!({ "assignee" : unwrapped })); } if let Some(ref unwrapped) = self.params.client_user_id { - r = r.json(json!({ "client_user_id" : unwrapped })); + r = r.json(serde_json::json!({ "client_user_id" : unwrapped })); } if let Some(ref unwrapped) = self.params.reset_fields { - r = r.json(json!({ "reset_fields" : unwrapped })); + r = r.json(serde_json::json!({ "reset_fields" : unwrapped })); } if let Some(ref unwrapped) = self.params.search_terms { - r = r.json(json!({ "search_terms" : unwrapped })); + r = r.json(serde_json::json!({ "search_terms" : unwrapped })); } if let Some(ref unwrapped) = self.params.status { - r = r.json(json!({ "status" : unwrapped })); + r = r.json(serde_json::json!({ "status" : unwrapped })); } r = r .json( - json!( + serde_json::json!( { "watchlist_screening_id" : self.params.watchlist_screening_id } ), ); @@ -83,4 +88,27 @@ for FluentRequest<'a, WatchlistScreeningIndividualUpdateRequest> { res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Update individual watchlist screening + +Update a specific individual watchlist screening. This endpoint can be used to add additional customer information, correct outdated information, add a reference id, assign the individual to a reviewer, and update which program it is associated with. Please note that you may not update `search_terms` and `status` at the same time since editing `search_terms` may trigger an automatic `status` change. + +See endpoint docs at .*/ + pub fn watchlist_screening_individual_update( + &self, + watchlist_screening_id: &str, + ) -> FluentRequest<'_, WatchlistScreeningIndividualUpdateRequest> { + FluentRequest { + client: self, + params: WatchlistScreeningIndividualUpdateRequest { + assignee: None, + client_user_id: None, + reset_fields: None, + search_terms: None, + status: None, + watchlist_screening_id: watchlist_screening_id.to_owned(), + }, + } + } +} diff --git a/src/request/webhook_verification_key_get.rs b/src/request/webhook_verification_key_get.rs index 07603208..bb1b4ee7 100644 --- a/src/request/webhook_verification_key_get.rs +++ b/src/request/webhook_verification_key_get.rs @@ -1,9 +1,6 @@ -use serde_json::json; -use crate::model::*; use crate::FluentRequest; use serde::{Serialize, Deserialize}; use httpclient::InMemoryResponseExt; -use crate::PlaidClient; /**You should use this struct via [`PlaidClient::webhook_verification_key_get`]. On request success, this will return a [`WebhookVerificationKeyGetResponse`].*/ @@ -11,20 +8,41 @@ On request success, this will return a [`WebhookVerificationKeyGetResponse`].*/ pub struct WebhookVerificationKeyGetRequest { pub key_id: String, } -impl WebhookVerificationKeyGetRequest {} impl FluentRequest<'_, WebhookVerificationKeyGetRequest> {} impl<'a> ::std::future::IntoFuture for FluentRequest<'a, WebhookVerificationKeyGetRequest> { - type Output = httpclient::InMemoryResult; + type Output = httpclient::InMemoryResult< + crate::model::WebhookVerificationKeyGetResponse, + >; type IntoFuture = ::futures::future::BoxFuture<'a, Self::Output>; fn into_future(self) -> Self::IntoFuture { Box::pin(async move { let url = "/webhook_verification_key/get"; let mut r = self.client.client.post(url); - r = r.json(json!({ "key_id" : self.params.key_id })); + r = r.json(serde_json::json!({ "key_id" : self.params.key_id })); r = self.client.authenticate(r); let res = r.await?; res.json().map_err(Into::into) }) } -} \ No newline at end of file +} +impl crate::PlaidClient { + /**Get webhook verification key + +Plaid signs all outgoing webhooks and provides JSON Web Tokens (JWTs) so that you can verify the authenticity of any incoming webhooks to your application. A message signature is included in the `Plaid-Verification` header. + +The `/webhook_verification_key/get` endpoint provides a JSON Web Key (JWK) that can be used to verify a JWT. + +See endpoint docs at .*/ + pub fn webhook_verification_key_get( + &self, + key_id: &str, + ) -> FluentRequest<'_, WebhookVerificationKeyGetRequest> { + FluentRequest { + client: self, + params: WebhookVerificationKeyGetRequest { + key_id: key_id.to_owned(), + }, + } + } +} diff --git a/src/serde.rs b/src/serde.rs index 3c2dc553..1262f600 100644 --- a/src/serde.rs +++ b/src/serde.rs @@ -1 +1 @@ -pub use ::serde::*; \ No newline at end of file +pub use ::serde::*;